/* ============================================
   FlexPRO Smart Estimate — Multi-Step Form
   Premium, calm, mobile-first
   ============================================ */

/* ── Progress Bar ── */
.estimate-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-2xl);
  padding: 0 var(--space-xs);
}

.estimate-progress__step {
  display: flex;
  align-items: center;
  flex: 1;
  position: relative;
}

.estimate-progress__circle {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all var(--transition-base);
  position: relative;
  z-index: 2;
}

.estimate-progress__step.active .estimate-progress__circle {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.15);
}

.estimate-progress__step.completed .estimate-progress__circle {
  background: var(--success);
  color: var(--white);
}

.estimate-progress__step.completed .estimate-progress__circle::after {
  content: '';
  display: block;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: rotate(-45deg);
  margin-top: -2px;
}

.estimate-progress__step.completed .estimate-progress__circle span {
  display: none;
}

.estimate-progress__line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  transition: background var(--transition-base);
}

.estimate-progress__step.completed .estimate-progress__line {
  background: var(--success);
}

/* Hide line on last step */
.estimate-progress__step:last-child .estimate-progress__line {
  display: none;
}

/* Skipped step — visually collapse from progress bar */
.estimate-progress__step.skipped-step {
  max-width: 0;
  overflow: hidden;
  flex: 0;
  opacity: 0;
  padding: 0;
  margin: 0;
  transition: all 0.3s ease;
}

.estimate-progress__step.skipped-step .estimate-progress__circle,
.estimate-progress__step.skipped-step .estimate-progress__line,
.estimate-progress__step.skipped-step .estimate-progress__label {
  display: none;
}

/* ── Step Labels (desktop only) ── */
.estimate-progress__label {
  display: none;
  position: absolute;
  top: 38px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6875rem;
  color: var(--gray-400);
  white-space: nowrap;
  font-weight: 500;
  transition: color var(--transition-base);
}

.estimate-progress__step.active .estimate-progress__label {
  color: var(--primary);
}

.estimate-progress__step.completed .estimate-progress__label {
  color: var(--success);
}

@media (min-width: 768px) {
  .estimate-progress__label {
    display: block;
  }
  .estimate-progress {
    margin-bottom: calc(var(--space-2xl) + 12px);
  }
}

/* ── Step Containers ── */
.estimate-step {
  display: none;
  animation: stepFadeIn 0.3s ease;
}

.estimate-step.active {
  display: block;
}

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

/* ── Step Header ── */
.step-header {
  margin-bottom: var(--space-xl);
}

.step-header h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: var(--space-xs);
}

.step-header p {
  font-size: 0.9375rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ── Navigation Buttons ── */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--gray-100);
}

.step-nav .btn-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-500);
  background: transparent;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
}

.step-nav .btn-back:hover {
  color: var(--gray-700);
  border-color: var(--gray-300);
  background: var(--gray-100);
}

.step-nav .btn-back svg {
  width: 14px;
  height: 14px;
}

.step-nav .btn-next {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 14px rgba(0, 102, 255, 0.25);
  margin-left: auto;
}

.step-nav .btn-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.35);
}

.step-nav .btn-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.step-nav .btn-next svg {
  width: 14px;
  height: 14px;
}

/* ── Condition Cards ── */
.condition-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .condition-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.condition-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--white);
}

.condition-card:hover {
  border-color: var(--primary-light);
  background: var(--primary-light);
}

.condition-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.condition-card__radio {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all var(--transition-base);
}

.condition-card.selected .condition-card__radio {
  border-color: var(--primary);
  background: var(--primary);
}

.condition-card.selected .condition-card__radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--white);
}

.condition-card__content h5 {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 2px;
}

.condition-card__content p {
  font-size: 0.8125rem;
  color: var(--gray-500);
  line-height: 1.4;
}

/* ── Optional Toggle Cards (Pets, Children) ── */
.optional-toggles {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toggle-group__label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--dark);
}

.toggle-group__sublabel {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-bottom: var(--space-sm);
}

.toggle-options {
  display: flex;
  gap: var(--space-sm);
}

.toggle-option {
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition-base);
}

.toggle-option:hover {
  border-color: var(--gray-300);
}

.toggle-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Sub-options that appear after toggle */
.toggle-sub {
  display: none;
  margin-top: var(--space-sm);
  padding: var(--space-md);
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  animation: stepFadeIn 0.2s ease;
}

.toggle-sub.visible {
  display: block;
}

.toggle-sub label {
  font-size: 0.875rem;
  color: var(--gray-700);
  font-weight: 500;
  margin-bottom: var(--space-xs);
  display: block;
}

.toggle-sub input,
.toggle-sub select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  background: var(--white);
}

/* ── Photo Upload Zone ── */
.photo-upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--gray-100);
}

.photo-upload-zone:hover,
.photo-upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.photo-upload-zone__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-md);
  color: var(--gray-400);
}

.photo-upload-zone:hover .photo-upload-zone__icon,
.photo-upload-zone.dragover .photo-upload-zone__icon {
  color: var(--primary);
}

.photo-upload-zone__text {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: var(--space-xs);
}

.photo-upload-zone__subtext {
  font-size: 0.8125rem;
  color: var(--gray-400);
}

.photo-upload-zone input[type="file"] {
  display: none;
}

/* Photo Previews */
.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.photo-preview {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--gray-200);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}

.photo-preview__remove:hover {
  background: var(--error);
}

/* ── Estimate Summary Card (floating) ── */
.estimate-floating-summary {
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f0ff 100%);
  border: 1px solid rgba(0, 102, 255, 0.15);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  animation: stepFadeIn 0.3s ease;
}

.estimate-floating-summary h5 {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.estimate-floating-summary h5 svg {
  width: 16px;
  height: 16px;
}

.estimate-floating-summary .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) 0;
  font-size: 0.875rem;
}

.estimate-floating-summary .summary-row span:first-child {
  color: var(--gray-500);
}

.estimate-floating-summary .summary-row span:last-child {
  font-weight: 600;
  color: var(--dark);
}

.estimate-floating-summary .summary-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
}

/* ── Skip Link ── */
.step-skip {
  display: inline-block;
  font-size: 0.8125rem;
  color: var(--gray-400);
  text-decoration: underline;
  cursor: pointer;
  transition: color var(--transition-fast);
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-body);
}

.step-skip:hover {
  color: var(--gray-600);
}

/* ── Responsive ── */
@media (max-width: 639px) {
  .estimate-progress__circle {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 0.75rem;
  }

  .step-header h4 {
    font-size: 1.125rem;
  }

  .condition-cards {
    grid-template-columns: 1fr;
  }

  .step-nav {
    flex-wrap: wrap;
  }

  .step-nav .btn-next {
    width: 100%;
    justify-content: center;
    order: -1;
  }

  .step-nav .btn-back {
    width: 100%;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════
   TOUCH DEVICE FIXES v6.3 — Surgical, interactive-only
   NO global rules. NO container rules. Only buttons, links, cards.
   ══════════════════════════════════════════════ */

/* 1. iOS tap highlight — ONLY on interactive elements */
button,
a,
.service-card,
.condition-card,
.toggle-option,
.path-option-card {
  -webkit-tap-highlight-color: transparent;
}

/* 2. Prevent text selection — ONLY on tappable cards */
.service-card,
.condition-card,
.toggle-option,
.path-option-card {
  -webkit-user-select: none;
  user-select: none;
}

/* 3. Focus — hide on touch, show on keyboard */
button:focus,
a:focus,
.service-card:focus,
.condition-card:focus,
.toggle-option:focus,
.path-option-card:focus {
  outline: none;
}
button:focus-visible,
a:focus-visible,
.service-card:focus-visible,
.condition-card:focus-visible,
.toggle-option:focus-visible,
.path-option-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 4. Controlled :active state for ALL buttons — smooth press feel */
button:active,
a.btn:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* 5. Remove Safari grey background flash on buttons */
button,
a.btn,
.path-option-card {
  background-clip: padding-box;
  -webkit-touch-callout: none;
}

/* 6. Touch device hover neutralization */
@media (hover: none) and (pointer: coarse) {
  /* Service cards */
  .service-card:hover {
    border-color: var(--gray-200) !important;
    background: var(--white) !important;
    transform: none !important;
    box-shadow: none !important;
  }
  .service-card:hover .service-card__icon {
    background: var(--gray-100) !important;
    color: var(--gray-500) !important;
  }
  .service-card:hover .service-card__text strong {
    color: var(--dark) !important;
  }
  /* Selected state preserved */
  .service-card.selected {
    border-color: var(--primary) !important;
    background: var(--primary-light, #f0f7ff) !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12) !important;
  }
  .service-card.selected .service-card__icon {
    background: var(--primary) !important;
    color: var(--white) !important;
  }
  .service-card.selected .service-card__text strong {
    color: var(--primary) !important;
  }
  /* Condition cards */
  .condition-card:hover {
    border-color: var(--gray-200) !important;
    background: var(--white) !important;
  }
  .condition-card.selected {
    border-color: var(--primary) !important;
    background: var(--primary-light) !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1) !important;
  }
  /* Toggle options */
  .toggle-option:hover {
    border-color: var(--gray-200) !important;
  }
  .toggle-option.selected {
    border-color: var(--primary) !important;
    background: var(--primary-light) !important;
    color: var(--primary) !important;
  }
  /* Path option cards */
  .path-option-card:hover {
    border-color: var(--gray-200, #e5e7eb) !important;
    box-shadow: none !important;
    transform: none !important;
  }
  .path-option-card:hover .path-arrow {
    fill: var(--gray-400) !important;
    transform: none !important;
  }
  /* Buttons — no hover transform/shadow on touch */
  .btn:hover,
  .btn-primary:hover,
  .step-nav .btn-next:hover,
  .step-nav .btn-back:hover {
    transform: none !important;
  }
}

/* 7. Eliminate fadeSlideIn flash on mobile transitions */
@media (hover: none) and (pointer: coarse) {
  .booking-step-visible,
  .booking-flow-visible,
  .estimate-step.active {
    animation: none !important;
  }
}

/* ── Date Picker Full-Width Click Area v6.2 ── */
.form-group input[type="date"] {
  cursor: pointer;
  width: 100%;
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 1;
}

/* :has() fallback — works in modern browsers */
.form-group:has(input[type="date"]) {
  cursor: pointer;
  position: relative;
}

/* Ensure the date input covers the full clickable area */
.form-group input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ── Service Selection Cards ── */
.service-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

@media (min-width: 640px) {
  .service-cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }
}

.service-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  background: var(--white);
  text-align: left;
  font-family: var(--font-body);
  width: 100%;
}

.service-card:hover {
  border-color: var(--primary-light, #cce0ff);
  background: var(--primary-light, #f0f7ff);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.08);
}

.service-card.selected {
  border-color: var(--primary);
  background: var(--primary-light, #f0f7ff);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

.service-card__icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--gray-100);
  color: var(--gray-500);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.service-card:hover .service-card__icon,
.service-card.selected .service-card__icon {
  background: var(--primary);
  color: var(--white);
}

.service-card__icon svg {
  width: 20px;
  height: 20px;
}

.service-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.service-card__text strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--dark);
}

.service-card__text span {
  font-size: 0.8125rem;
  color: var(--gray-500);
  line-height: 1.4;
}

.service-card.selected .service-card__text strong {
  color: var(--primary);
}

/* Mobile: smaller cards */
@media (max-width: 639px) {
  .service-card {
    padding: var(--space-md);
  }

  .service-card__icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .service-card__icon svg {
    width: 18px;
    height: 18px;
  }

  .service-card__text strong {
    font-size: 0.875rem;
  }
}

/* ═══════════════════════════════════════
   TRUST STRIP — Social Proof Before Estimate
═══════════════════════════════════════ */
.booking-trust-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #f8fffe 0%, #f0f7ff 100%);
  border: 1px solid #e0eef9;
  border-radius: var(--radius-lg, 0.75rem);
}

.trust-strip__rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trust-strip__stars {
  display: flex;
  gap: 2px;
}

.trust-strip__stars svg {
  width: 18px;
  height: 18px;
}

.trust-strip__score {
  font-family: var(--font-display, 'Poppins', sans-serif);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--dark, #1A1A2E);
}

.trust-strip__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.trust-strip__badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-600, #4B5563);
}

.trust-strip__badge svg {
  width: 16px;
  height: 16px;
  color: var(--success, #10B981);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   PRICE EXAMPLES — Reduces Abandonment
═══════════════════════════════════════ */
.price-examples {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--gray-100, #F3F4F6);
  border-radius: var(--radius-lg, 0.75rem);
  border: 1px solid var(--gray-200, #E5E7EB);
}

.price-examples__title {
  font-family: var(--font-display, 'Poppins', sans-serif);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray-700, #4B5563);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.price-examples__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.price-examples__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: var(--white, #fff);
  border-radius: var(--radius-md, 0.5rem);
  border: 1px solid var(--gray-200, #E5E7EB);
}

.price-examples__service {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-600, #4B5563);
  margin-bottom: 0.25rem;
}

.price-examples__range {
  font-family: var(--font-display, 'Poppins', sans-serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary, #06F);
}

.price-examples__note {
  font-size: 0.75rem;
  color: var(--gray-400, #9CA3AF);
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .price-examples__grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .price-examples__item {
    flex-direction: row;
    justify-content: space-between;
    padding: 0.6rem 1rem;
  }
  .price-examples__service {
    margin-bottom: 0;
  }
}

/* ═══════════════════════════════════════
   AVAILABILITY NUDGE — Scarcity (Step 6)
═══════════════════════════════════════ */
.availability-nudge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: var(--radius-md, 0.5rem);
  border-left: 4px solid #f59e0b;
}

.availability-nudge svg {
  width: 22px;
  height: 22px;
  color: #d97706;
  flex-shrink: 0;
}

.availability-nudge span {
  font-size: 0.875rem;
  color: #92400e;
  line-height: 1.4;
}

.availability-nudge strong {
  color: #78350f;
}

@media (max-width: 600px) {
  .booking-trust-strip {
    padding: 1rem;
    gap: 0.5rem;
  }
  .trust-strip__badges {
    gap: 0.5rem;
  }
  .trust-strip__badge {
    font-size: 0.75rem;
  }
  .availability-nudge {
    padding: 0.75rem 1rem;
  }
  .availability-nudge span {
    font-size: 0.8rem;
  }
}
