/**
 * Har HaBituach - Form 1 Styles
 * Modern, clean Hebrew RTL design
 */

/* Prevent flash of unstyled content before Vue loads - smooth fade in */
[v-cloak] {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

/* When Vue is ready, fade in */
#HarHabituchForm1App {
  opacity: 1;
  transition: opacity 0.3s ease-in;
}

/* Container */
.hh-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
  background: transparent;
  direction: rtl;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Heebo', 'Arial',
    sans-serif;
}

/* Progress Bar */
.hh-progress-wrapper {
  margin-bottom: 40px;
}

.hh-progress-bar {
  width: 100%;
  height: 8px;
  background: #e8f1f2;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.hh-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a0dab 0%, #4f46e5 100%);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.hh-progress-text {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

/* Typography */
.hh-title {
  font-size: 32px;
  font-weight: 700;
  color: #1a0dab;
  margin-bottom: 12px;
  text-align: center;
}

.hh-subtitle {
  font-size: 16px;
  color: #6b7280;
  text-align: center;
  margin-bottom: 32px;
  line-height: 1.6;
}

.hh-section-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
}

.hh-help-text {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 20px;
}

/* Form Fields */
.hh-field-group {
  margin-bottom: 12px;
}

.hh-label {
  display: none;
}

.hh-field-label {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  text-align: right;
}

.hh-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: all 0.3s ease;
  background: #ffffff;
  direction: rtl;
  text-align: center !important;
  font-weight: 500 !important;
}

.hh-input:focus {
  outline: none;
  border-color: #1a0dab;
  box-shadow: none;
}

.hh-input::placeholder {
  color: #333;
  text-align: center;
  opacity: 1;
  font-weight: 500 !important;
}

/* Date Input Styling */
.hh-date-wrapper {
  position: relative;
  display: block;
}

.hh-date-wrapper::before {
  content: attr(data-placeholder);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #333;
  pointer-events: none;
  transition: opacity 0.2s ease;
  text-align: center;
  width: 100%;
  z-index: 1;
  font-weight: 500 !important;
}

.hh-date-wrapper:focus-within::before,
.hh-date-wrapper.has-value::before {
  opacity: 0;
}

.hh-date-input {
  font-family: inherit;
  cursor: pointer;
  color: #333;
  background: transparent;
  position: relative;
  font-weight: 500 !important;
}

/* Hide the default date format (dd/mm/yyyy) when empty */
.hh-date-input::-webkit-datetime-edit-text,
.hh-date-input::-webkit-datetime-edit-month-field,
.hh-date-input::-webkit-datetime-edit-day-field,
.hh-date-input::-webkit-datetime-edit-year-field {
  color: transparent;
  opacity: 0;
}

/* Show the date only when it has a value or on focus */
.hh-date-input:focus::-webkit-datetime-edit-text,
.hh-date-input:focus::-webkit-datetime-edit-month-field,
.hh-date-input:focus::-webkit-datetime-edit-day-field,
.hh-date-input:focus::-webkit-datetime-edit-year-field,
.hh-date-wrapper.has-value .hh-date-input::-webkit-datetime-edit-text,
.hh-date-wrapper.has-value .hh-date-input::-webkit-datetime-edit-month-field,
.hh-date-wrapper.has-value .hh-date-input::-webkit-datetime-edit-day-field,
.hh-date-wrapper.has-value .hh-date-input::-webkit-datetime-edit-year-field {
  color: #333;
  opacity: 1;
}

.hh-date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  font-size: 18px;
  position: relative;
  z-index: 2;
}

/* Help Link */
.hh-help-link {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #1a0dab;
  text-decoration: underline;
  transition: color 0.3s ease;
  text-align: center;
}

.hh-help-link:hover {
  color: #4f46e5;
}

/* SlimSelect Override for RTL */
.ss-main {
  width: 100% !important;
  direction: rtl;
}

.ss-main .ss-single-selected {
  padding: 14px 16px !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 10px !important;
  font-size: 16px !important;
  background-color: #ffffff !important;
  min-height: 52px;
}

.ss-main .ss-single-selected:hover {
  border-color: #1a0dab !important;
}

.ss-main .ss-single-selected.ss-open-below,
.ss-main .ss-single-selected.ss-open-above {
  border-color: #1a0dab !important;
  box-shadow: 0 0 0 3px rgba(26, 13, 171, 0.1) !important;
}

.ss-main .ss-multi-selected {
  padding: 12px 16px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  font-size: 16px !important;
  background-color: #ffffff !important;
  min-height: 48px;
  direction: rtl;
  text-align: center;
  justify-content: center;
  font-weight: 500 !important;
}

.ss-main .ss-multi-selected:hover {
  border-color: #1a0dab !important;
}

.ss-main .ss-multi-selected.ss-open-below,
.ss-main .ss-multi-selected.ss-open-above {
  border-color: #1a0dab !important;
  box-shadow: 0 0 0 2px rgba(26, 13, 171, 0.1) !important;
}

.ss-main .ss-multi-selected .ss-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  direction: rtl;
  justify-content: center;
  width: 100%;
}

/* Center the placeholder when empty */
.ss-main .ss-multi-selected .ss-placeholder,
.ss-main .ss-values .ss-placeholder {
  display: block !important;
  text-align: center !important;
  color: #333 !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1.5 !important;
  font-weight: 500 !important;
}

.ss-main .ss-multi-selected .ss-values .ss-value {
  background: linear-gradient(135deg, #1a0dab 0%, #4f46e5 100%);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ss-main .ss-multi-selected .ss-values .ss-value .ss-value-delete {
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.8;
}

.ss-main .ss-multi-selected .ss-values .ss-value .ss-value-delete:hover {
  opacity: 1;
}

.ss-main .ss-content {
  border: 2px solid #1a0dab !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
  direction: rtl;
}

.ss-main .ss-content .ss-search input {
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  font-size: 1.5rem !important;
  direction: rtl;
  font-weight: 500 !important;
}

.ss-main .ss-content .ss-list .ss-option {
  padding: 12px 16px !important;
  font-size: 1.5rem !important;
  direction: rtl;
  text-align: right;
  font-weight: 500 !important;
}

.ss-main .ss-content .ss-list .ss-option:hover {
  background-color: #f3f4f6 !important;
  color: #1a0dab !important;
}

.ss-main .ss-content .ss-list .ss-option.ss-highlighted {
  background-color: #eff6ff !important;
  color: #1a0dab !important;
}

.ss-main .ss-content .ss-list .ss-option.ss-selected {
  background: linear-gradient(135deg, #1a0dab 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
}

.ss-main .ss-content .ss-list .ss-option.ss-disabled {
  background-color: #f9fafb !important;
  color: #d1d5db !important;
  cursor: not-allowed !important;
}

.hh-input:focus {
  outline: none;
  border-color: #1a0dab;
  box-shadow: 0 0 0 3px rgba(26, 13, 171, 0.1);
}

.hh-input::placeholder {
  color: black !important;
  text-align: center !important;
  font-weight: 500 !important;
}

/* Checkbox Grid */
.hh-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Mobile-only labels for date fields */
.hh-date-label-mobile {
  display: none;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  text-align: right;
}

@media (max-width: 600px) {
  .hh-date-label-mobile {
    display: block;
  }
  .hh-checkbox-grid {
    grid-template-columns: 1fr;
  }
}

.hh-checkbox-item {
  display: flex;
  align-items: center;
  padding: 14px;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hh-checkbox-item:hover {
  background: #f3f4f6;
  border-color: #1a0dab;
}

.hh-checkbox-item input[type='checkbox'] {
  width: 20px;
  height: 20px;
  margin-left: 12px;
  cursor: pointer;
  accent-color: #1a0dab;
}

.hh-checkbox-item input[type='checkbox']:checked + .hh-checkbox-label {
  color: #374151;
}

.hh-checkbox-label {
  flex: 1;
  font-size: 15px;
  color: #374151;
  user-select: none;
}

/* Terms Checkbox */
.hh-terms {
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 10px;
}

.hh-terms .hh-checkbox-label {
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

.hh-terms .hh-checkbox-label a {
  color: #1a0dab;
  text-decoration: underline;
}

.hh-terms .hh-checkbox-label a:hover {
  color: #4f46e5;
}

/* Radio Cards (Step 2) */
.hh-radio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .hh-radio-grid {
    grid-template-columns: 1fr;
  }
}

.hh-radio-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.hh-radio-card input[type='radio'] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.hh-radio-content {
  padding: 24px 16px;
  background: #ffffff;
  border: 3px solid #e5e7eb;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
}

.hh-radio-card:hover .hh-radio-content {
  border-color: #1a0dab;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 13, 171, 0.15);
}

.hh-radio-card input[type='radio']:checked + .hh-radio-content {
  background: linear-gradient(135deg, #1a0dab 0%, #4f46e5 100%);
  border-color: #1a0dab;
  color: #ffffff;
}

.hh-radio-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.hh-radio-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.hh-radio-card input[type='radio']:checked + .hh-radio-content .hh-radio-title {
  color: #ffffff;
}

/* Thank You Box */
.hh-thank-you-box {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  padding: 32px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 32px;
  color: #ffffff;
}

.hh-thank-you-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.hh-thank-you-box .hh-title {
  color: #ffffff;
  margin-bottom: 8px;
}

.hh-thank-you-box .hh-subtitle {
  color: #ffffff;
  opacity: 0.95;
}

/* Buttons */
.hh-button-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.hh-button {
  flex: 1;
  max-width: 300px;
  padding: 14px 32px;
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.hh-button-primary {
  background: linear-gradient(135deg, #1a0dab 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(26, 13, 171, 0.3);
}

.hh-button-primary:hover:not(:disabled):not(.hh-button-disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 13, 171, 0.4);
  color: white !important;
}

.hh-button-primary:disabled,
.hh-button-primary.hh-button-disabled {
  background: #d1d5db;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.hh-button-secondary {
  background: #ffffff;
  color: #1a0dab;
  border: 2px solid #1a0dab;
}

.hh-button-secondary:hover {
  background: #f9fafb;
}

/* Errors */
.hh-error {
  font-size: 13px;
  color: #ef4444;
  margin-top: 6px;
  font-weight: 500;
}

/* Loading Overlay */
.hh-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: #ffffff;
}

.hh-spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

label {
  font-weight: 400;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hh-loading-overlay p {
  font-size: 18px;
  font-weight: 500;
}

/* Step Transitions */
.hh-step {
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Title (for steps 2 & 3) */
.hh-section-title {
  font-size: 22px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 20px 0;
  line-height: 1.4;
  text-align: center;
}

/* Radio List Layout (for steps 2 & 3) */
.hh-radio-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
  text-align: right;
}

.hh-radio-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: right;
}

.hh-radio-list-item:hover {
  border-color: #1a0dab;
  background: #f8fafc;
  transform: translateX(-2px);
}

.hh-radio-list-item input[type='radio'] {
  margin-top: 4px;
  min-width: 20px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #1a0dab;
}

.hh-radio-list-item input[type='radio']:checked {
  accent-color: #1a0dab;
}

.hh-radio-list-text {
  flex: 1;
  font-size: 16px;
  line-height: 1.6;
  color: #374151;
  text-align: right;
  font-weight: 400;
}

.hh-radio-list-text strong {
  color: #1a0dab;
  font-weight: 600;
}

.hh-radio-list-item:has(input[type='radio']:checked) {
  border-color: #1a0dab;
  background: #f0f9ff;
}

.hh-radio-list-item:has(input[type='radio']:checked) .hh-radio-list-text {
  color: #1a0dab;
}

/* Responsive */
@media (max-width: 768px) {
  .hh-container {
    margin: 20px;
    padding: 30px 20px;
  }

  .hh-title {
    font-size: 26px;
  }

  .hh-section-title {
    font-size: 18px;
  }

  .hh-button-group {
    flex-direction: column-reverse;
  }

  .hh-button {
    width: 100%;
  }

  .hh-radio-list-text {
    font-size: 15px;
  }
}