/* ============================================
   OZYDE — In-house booking wizard
   ============================================ */

.wizard {
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

/* ---------- Progress stepper ---------- */
.wizard-progress {
  display: flex;
  align-items: center;
  padding: 22px clamp(18px, 4vw, 40px);
  background: var(--ink);
  gap: 6px;
}
.wizard-progress .p-step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
  transition: opacity var(--dur-fast) var(--ease);
}
.wizard-progress .p-step.is-active,
.wizard-progress .p-step.is-done { opacity: 1; }
.wizard-progress .p-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--cream);
  box-shadow: inset 0 0 0 1.5px var(--line-on-dark);
  flex-shrink: 0;
}
.wizard-progress .p-step.is-active .p-dot { background: var(--gold); box-shadow: none; color: var(--ink); }
.wizard-progress .p-step.is-done .p-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--gold-light); color: var(--gold-light); }
.wizard-progress .p-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--cream);
  white-space: nowrap;
}
.wizard-progress .p-line {
  flex-grow: 1;
  height: 1px;
  background: var(--line-on-dark);
  margin-inline: 4px;
  min-width: 12px;
}
@media (max-width: 700px) {
  .wizard-progress .p-label { display: none; }
  .wizard-progress { justify-content: center; gap: 8px; }
}

/* ---------- Steps ---------- */
.wizard-body { padding: clamp(24px, 4vw, 48px); }
.wizard-step { display: none; }
.wizard-step.is-active { display: block; animation: fade-in 0.4s var(--ease) both; }
.wizard-step h2 { font-size: clamp(22px, 2.6vw, 28px); margin-bottom: 8px; }
.wizard-step .step-hint { opacity: 0.65; font-size: 14px; margin-bottom: 28px; max-width: 52ch; }

/* ---------- Step 1: service cards ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.service-card {
  text-align: left;
  padding: 22px;
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1.5px var(--line);
  cursor: pointer;
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  display: flex; flex-direction: column; gap: 8px;
}
.service-card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--gold); }
.service-card.is-selected { background: var(--ink); box-shadow: none; }
.service-card.is-selected h3,
.service-card.is-selected .service-desc { color: var(--cream); }
.service-card.is-selected .service-price { color: var(--gold-light); }
.service-card h3 { font-size: 17px; }
.service-card .service-price { font-family: var(--font-display); color: var(--gold-deep); font-size: 15px; }
.service-card .service-desc { font-size: 13px; opacity: 0.68; line-height: 1.5; }

@media (max-width: 600px) {
  .service-grid { grid-template-columns: 1fr; }
}

/* ---------- Step 2: calendar + time slots ---------- */
.picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 40px);
  align-items: start;
}
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-head .cal-month { font-family: var(--font-display); font-size: 18px; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button {
  width: 44px; height: 44px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
  display: flex; align-items: center; justify-content: center;
}
.cal-nav button:disabled { opacity: 0.3; cursor: not-allowed; }
.cal-nav button:not(:disabled):hover { background: var(--cream-deep); }
.cal-nav svg { width: 14px; height: 14px; }

.cal-weekdays, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-weekdays span {
  text-align: center; font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; opacity: 0.5; padding-bottom: 8px;
}
.cal-day {
  aspect-ratio: 1;
  min-height: 44px;
  min-width: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 13.5px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.cal-day:not(.is-disabled):hover { background: var(--cream-deep); }
.cal-day.is-disabled,
.cal-day:disabled { opacity: 0.22; cursor: not-allowed; }
.cal-day.is-empty { visibility: hidden; }
.cal-day.is-selected { background: var(--ink); color: var(--cream); }
.cal-day.is-today:not(.is-selected) { box-shadow: inset 0 0 0 1.5px var(--gold); }

.slot-panel h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; opacity: 0.7; }
.slot-error {
  display: none;
  font-size: 13px;
  color: var(--jewel);
  background: rgba(110,36,56,0.08);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  margin-bottom: 14px;
}
.slot-error.is-visible { display: block; }
.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.slot-btn {
  min-height: 44px;
  padding: 10px 6px;
  border-radius: var(--r-sm);
  font-size: 13px;
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: center;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.slot-btn:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.slot-btn.is-selected { background: var(--gold-deep); box-shadow: none; color: var(--white); font-weight: 600; }
.slot-empty { opacity: 0.55; font-size: 13.5px; padding: 20px 0; }

@media (max-width: 780px) {
  .picker-grid { grid-template-columns: 1fr; }
}

/* A 7-column week grid at full 44px touch targets needs ~330px of clear
   width; a real phone viewport (360-390px) doesn't have that much left
   once the page gutter and wizard padding are subtracted. Tightening both
   here recovers most of that gap rather than letting the day buttons
   shrink to ~37px — 40px is the largest a true 7-in-a-row layout can hit at
   this width without redesigning the calendar into a scroller. */
@media (max-width: 420px) {
  .wizard-body { padding-left: 16px; padding-right: 16px; }
  .cal-weekdays, .cal-grid { gap: 3px; }
  .cal-day { min-height: 40px; min-width: 40px; font-size: 13px; }
}

/* ---------- Step 3: details form ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field.is-full { grid-column: 1 / -1; }
.form-field label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.65; }
.form-field input, .form-field textarea, .form-field select {
  padding: 13px 16px;
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1.5px var(--line);
  background: var(--white);
  font-size: 14.5px;
  color: var(--ink);
  transition: box-shadow var(--dur-fast) var(--ease);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none; box-shadow: inset 0 0 0 1.5px var(--gold);
}
.form-field textarea { resize: vertical; min-height: 90px; font-family: var(--font-body); }
.form-field input[type="date"] { cursor: pointer; }
.form-field input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 4px;
  margin-right: -2px;
  border-radius: var(--r-sm);
}
.form-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background: var(--cream-deep);
}
.form-field .req-mark { color: var(--jewel); margin-left: 2px; }
.field-hint { font-size: 12px; opacity: 0.65; line-height: 1.5; }
.field-error { font-size: 12px; color: var(--jewel); display: none; }
.form-field.has-error input, .form-field.has-error textarea { box-shadow: inset 0 0 0 1.5px var(--jewel); }
.form-field.has-error .field-error { display: block; }

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Measurements pop-up (built in js/booking.js) ---------- */
/* Two columns even on a phone: these are short numbers, and a single column
   of five fields would push the buttons far down the bottom sheet. 16px text so
   iOS doesn't zoom the page when a field takes focus. */
.measure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.measure-grid input { font-size: 16px; width: 100%; min-width: 0; }

/* ---------- Step 4: review ---------- */
.review-card {
  background: var(--cream);
  border-radius: var(--r-md);
  padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 24px;
}
.review-row { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.review-row:last-child { border-bottom: none; padding-bottom: 0; }
.review-row .r-label { opacity: 0.6; }
.review-row .r-value { font-weight: 600; text-align: right; }

/* .review-note is the "good to know" block js/booking.js adds under the payment
   note — same card, so the two read as a pair. */
.payment-note,
.review-note {
  display: flex; gap: 14px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--cream-deep);
  margin-bottom: 24px;
}
.payment-note svg,
.review-note svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--gold-deep); margin-top: 2px; }
.payment-note p { font-size: 13.5px; opacity: 0.78; line-height: 1.6; }
.payment-note strong,
.review-note strong { display: block; font-size: 14.5px; opacity: 1; margin-bottom: 4px; }
.review-note ul { display: flex; flex-direction: column; gap: 4px; }
.review-note li {
  position: relative;
  padding-left: 14px;
  font-size: 13.5px; opacity: 0.78; line-height: 1.6;
}
.review-note li::before {
  content: '';
  position: absolute; left: 0; top: 0.7em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold-deep);
}

.consent-field { margin-bottom: 18px; padding: 6px 2px; cursor: pointer; min-height: 44px; display: flex; flex-direction: row; align-items: center; gap: 0; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; }
.consent-row input[type="checkbox"] {
  width: 20px; height: 20px;
  min-width: 20px;
  margin-top: 2px;
  accent-color: var(--gold-deep);
  cursor: pointer;
}
.consent-row span { font-size: 13.5px; line-height: 1.55; opacity: 0.85; }
.consent-field.has-error .consent-row span { color: var(--jewel); opacity: 1; }

.submit-error {
  display: none;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  background: rgba(110,36,56,0.08);
  color: var(--jewel);
  font-size: 13.5px;
  margin-bottom: 18px;
}
.submit-error.is-visible { display: block; }

/* ---------- Nav buttons ---------- */
.wizard-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px;
  gap: 12px;
}
.wizard-nav .btn-back { opacity: 0.6; }
.wizard-nav .btn-back:hover { opacity: 1; }

/* ---------- Confirmation ---------- */
.confirm-panel { text-align: center; padding: clamp(20px, 4vw, 32px) 0; }
.confirm-mark {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--ink); color: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
}
.confirm-mark svg { width: 28px; height: 28px; }
.confirm-panel h2 { font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 10px; }
.confirm-panel .step-hint { margin: 0 auto 28px; }
/* The heading takes focus when the confirmation appears (see showConfirmation)
   so keyboard and screen-reader users land on the new screen. */
.confirm-panel h2:focus { outline: none; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Fitting notes + contact line, added under the confirmation text for slot
   bookings. The notes also appear in the "Before your fitting" pop-up, so the
   .fitting-* rules below have to read well on both the cream card here and the
   paper pop-up. */
.confirm-extras { max-width: 560px; margin: 0 auto 28px; }
.confirm-notes {
  text-align: left;
  padding: 22px;
  border-radius: var(--r-md);
  background: var(--cream);
}
.confirm-notes h3 { font-size: 18px; margin-bottom: 14px; }
.confirm-contact { margin-top: 18px; font-size: 14px; line-height: 1.6; }
.confirm-contact a { color: var(--gold-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.confirm-contact a:hover { color: var(--jewel); }

.fitting-notes { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.fitting-key { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fitting-key__item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--cream);
  font-size: 13.5px; line-height: 1.5;
}
.fitting-key__item strong { font-family: var(--font-display); font-size: 17px; color: var(--gold-light); }
.fitting-list { display: flex; flex-direction: column; gap: 10px; }
.fitting-list li { font-size: 14px; line-height: 1.55; }
.fitting-list strong {
  display: block;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gold-deep);
}
@media (max-width: 480px) {
  .fitting-key { grid-template-columns: 1fr; }
}

/* Spinner for submit state */
.btn.is-loading { pointer-events: none; opacity: 0.75; }
.spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
