/* ================================================================
   appointment.css — Booking Flow (Final Production)
   Loads on: /book-appointment, /appointment
   Depends on style.css for global tokens (--blue, --surface, etc.)
   ================================================================ */

/* ── Design Tokens ──────────────────────────────────────────── */
/* FIX: Added :root block — comment claimed hex colours were replaced
   with CSS variables, but no variables were ever defined. All repeated
   colour values are now tokenised here. */
:root {
  --appt-blue:        #2563eb;
  --appt-blue-light:  #3b82f6;
  --appt-blue-pale:   #eff6ff;
  --appt-blue-border: #93c5fd;
  --appt-green:       #047857;
  --appt-green-light: #10b981;
  --appt-red:         #ef4444;
  --appt-gray-100:    #f3f4f6;
  --appt-gray-200:    #e5e7eb;
  --appt-gray-300:    #d1d5db;
  --appt-gray-500:    #6b7280;
  --appt-gray-700:    #374151;
  --appt-surface:     #f8fafc;
  --appt-white:       #ffffff;
  --appt-focus-ring:  0 0 0 3px rgba(59, 130, 246, 0.1);
  --appt-red-ring:    0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ── Step Visibility ────────────────────────────────────────── */
.appointment-step {
  transition: all 0.3s ease;
}
.appointment-step.hidden {
  display: none;
}

/* ── Service Selection ──────────────────────────────────────── */
.service-option {
  margin-bottom: 0.75rem;
}
.service-radio:checked + .service-label {
  border-color: var(--blue-light);
  background-color: var(--blue-pale);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.service-label {
  transition: all 0.2s ease;
  cursor: pointer;
}
.service-label:hover {
  border-color: var(--blue-border);
  background-color: var(--surface-2);
}

/* ── Date Selection ─────────────────────────────────────────── */
.date-option {
  margin-bottom: 0.5rem;
}
.date-radio:checked + .date-label {
  border-color: var(--blue-light);
  background-color: var(--blue-pale);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.date-label {
  transition: all 0.2s ease;
  cursor: pointer;
}
.date-label:hover {
  border-color: var(--blue-border);
  background-color: var(--surface-2);
}
.date-label .text-sm,
.date-label .text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}
.date-label .text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
}

/* ── Time Slots ─────────────────────────────────────────────── */
.time-slot-option {
  margin-bottom: 0.5rem;
}
.time-slot-radio:checked + .time-slot-label {
  border-color: var(--blue-light);
  background-color: var(--blue-pale);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.time-slot-radio:disabled + .time-slot-label {
  cursor: not-allowed;
  opacity: 0.6;
}
.time-slot-radio:disabled + .time-slot-label:hover {
  border-color: var(--border-strong);
  background-color: var(--surface-3);
}
.time-slot-label {
  transition: all 0.2s ease;
  cursor: pointer;
}
.time-slot-label:hover {
  border-color: var(--blue-border);
  background-color: var(--surface-2);
}

/* ── Step Navigation Buttons ────────────────────────────────── */
.next-step-btn,
.prev-step-btn,
.submit-btn {
  transition: all 0.2s ease;
}
.next-step-btn:hover:not(:disabled),
.prev-step-btn:hover:not(:disabled),
.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.next-step-btn:disabled,
.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Form Input Focus ───────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  transition: all 0.2s ease;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ── Appointment Summary ────────────────────────────────────── */
#appointment-summary {
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading Spinner ────────────────────────────────────────── */
.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--blue-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Form Validation ────────────────────────────────────────── */
.invalid-input.invalid-input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
.validation-error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.validation-error::before {
  content: "⚠";
  font-size: 0.75rem;
}

/* ── Calendar Overrides ─────────────────────────────────────── */
.calendar-container {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  background-color: var(--surface);
}
.calendar-container .react-calendar {
  border: none;
  width: 100%;
  font-family: inherit;
}
.calendar-container .react-calendar__tile--active {
  background-color: var(--blue);
  color: var(--white);
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--white);
}
.calendar-container .react-calendar__tile--active:enabled:hover,
.calendar-container .react-calendar__tile--active:enabled:focus {
  background-color: var(--blue);
}
.calendar-container .react-calendar__tile:enabled:hover,
.calendar-container .react-calendar__tile:enabled:focus {
  background-color: var(--blue-pale);
}

/* ── Success Message ────────────────────────────────────────── */
.success-message {
  animation: fadeInUp 0.5s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .service-label,
  .date-label,
  .time-slot-label {
    padding: 0.75rem;
  }
}

/* ── Print Styles ───────────────────────────────────────────── */
@media print {
  .no-print {
    display: none !important;
  }
  .print-confirmation {
    border: 1px solid var(--ink);
    padding: 2rem;
    page-break-inside: avoid;
  }
}

/* ================================================================
   Booking page layout (merged from page inline <style>)
   ================================================================ */

.appt-page {
  background: var(--surface-2, #f8fafc);
  min-height: 100vh;
}

.appt-hero {
  background: linear-gradient(135deg, var(--blue, #1E40AF) 0%, var(--blue-mid, #2563EB) 55%, var(--cyan, #0891B2) 100%);
  padding: 3.5rem 0 2.5rem;
  position: relative;
  overflow: hidden;
}
.appt-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 80% at 90% 40%, rgba(255, 255, 255, .07) 0%, transparent 60%);
}
.appt-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: .65rem;
}
.appt-hero p {
  font-size: 1rem;
  color: rgba(255, 255, 255, .78);
  max-width: 480px;
  line-height: 1.7;
}
.appt-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .25);
  color: rgba(255, 255, 255, .9);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .32rem .9rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}
.appt-breadcrumb {
  font-size: .78rem;
  color: rgba(255, 255, 255, .55);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.appt-breadcrumb a {
  color: rgba(255, 255, 255, .7);
  text-decoration: none;
}
.appt-breadcrumb span {
  color: rgba(255, 255, 255, .4);
}
.appt-body {
  padding: 2.5rem 0 4rem;
}

/* Step progress (System B – used in HTML) */
.step-bar {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
}
.step-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1rem;
  border-radius: 0;
  background: var(--surface-3);
  border: 1px solid var(--border);
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-400);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  position: relative;
}
.step-item:first-child {
  border-radius: var(--r-md) 0 0 var(--r-md);
}
.step-item:last-child {
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.step-item.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.step-item.done {
  background: var(--blue-pale);
  color: var(--blue);
  border-color: var(--blue-border);
}
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-item.active .step-num {
  background: rgba(255, 255, 255, .3);
}
.step-item.done .step-num {
  background: var(--blue);
  color: #fff;
}
.step-item:not(.active):not(.done) .step-num {
  background: var(--border);
  color: var(--ink-400);
}

/* Main form card */
.appt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.appt-main {
  padding: 2.5rem;
}
.appt-sidebar {
  padding: 2.25rem;
  background: var(--surface-2);
  border-left: 1px solid var(--border);
}

/* Section headings */
.form-sec-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .55rem;
}
.form-sec-title i {
  color: var(--blue);
  font-size: .88rem;
}

/* Form fields */
.field-group {
  margin-bottom: 1.35rem;
}
.field-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: .45rem;
  display: block;
}
.field-label span {
  font-weight: 400;
  color: var(--ink-400);
  font-size: .75rem;
}
.field-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: .7rem 1rem;
  font-size: .92rem;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, .1);
}
.field-input::placeholder {
  color: var(--ink-400);
}
.field-input.error {
  border-color: var(--danger);
}
.field-error {
  font-size: .73rem;
  color: var(--danger);
  margin-top: .3rem;
  display: none;
}
.field-error.show {
  display: block;
}

/* Service selector */
.service-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.service-opt {
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: var(--surface);
}
.service-opt:hover {
  border-color: var(--blue-border);
  background: var(--blue-pale);
}
.service-opt.selected {
  border-color: var(--blue);
  background: var(--blue-pale);
}
.service-opt input[type=radio] {
  display: none;
}
.service-opt-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}
.service-opt-text strong {
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
}
.service-opt-text span {
  font-size: .75rem;
  color: var(--ink-400);
}

/* Calendar */
.cal-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
}
.cal-month {
  font-size: .9rem;
  font-weight: 800;
  color: var(--ink);
}
.cal-nav {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: var(--ink-500);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.cal-nav:hover {
  background: var(--blue-pale);
  border-color: var(--blue);
  color: var(--blue);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-day-header {
  text-align: center;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-3);
}
.cal-day {
  text-align: center;
  padding: .55rem .25rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
}
.cal-day:hover:not(.disabled):not(.empty) {
  background: var(--blue-pale);
  color: var(--blue);
}
.cal-day.selected {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  border-radius: var(--r-sm);
}
.cal-day.today:not(.selected) {
  color: var(--blue);
  font-weight: 800;
}
.cal-day.disabled {
  color: var(--border-strong);
  cursor: not-allowed;
}
.cal-day.empty {
  cursor: default;
}

/* Time slots */
.time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin-bottom: 1.5rem;
}
.time-slot {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: .6rem .5rem;
  text-align: center;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  background: var(--surface);
}
.time-slot:hover:not(.unavailable) {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-pale);
}
.time-slot.selected {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.time-slot.unavailable {
  background: var(--surface-3);
  color: var(--border-strong);
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Submit */
.submit-btn {
  width: 100%;
  padding: .9rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-sans);
}
.submit-btn:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-blue);
}
.submit-btn:disabled {
  background: var(--border-strong);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-back {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--border);
  flex: 0 0 auto;
  width: auto;
  padding: .9rem 1.5rem;
}
.btn-back:hover:not(:disabled) {
  background: var(--surface-3);
  transform: none;
}

/* Success state */
.success-card {
  text-align: center;
  padding: 3rem 2rem;
}
.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success-pale, #dcfce7);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.75rem;
  color: var(--success, #16a34a);
}

/* Sidebar widgets */
.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}
.widget-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: 1rem;
}
.why-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .9rem;
}
.why-item:last-child {
  margin-bottom: 0;
}
.why-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.why-text strong {
  font-size: .875rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
}
.why-text span {
  font-size: .8rem;
  color: var(--ink-500);
  line-height: 1.5;
}
.hours-row {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
}
.hours-row:last-child {
  border-bottom: none;
}
.hours-row span:first-child {
  color: var(--ink-500);
}
.hours-row span:last-child {
  font-weight: 600;
  color: var(--ink);
}
.hours-row.closed span:last-child {
  color: var(--danger);
}
.privacy-note {
  font-size: .75rem;
  color: var(--ink-400);
  text-align: center;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
}

/* Contact phone widget */
.contact-phone {
  background: var(--blue);
  border-color: var(--blue);
  text-align: center;
}
.contact-phone div:first-child {
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .7);
  margin-bottom: .5rem;
}
.contact-phone a {
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  display: block;
  margin-bottom: .35rem;
}
.contact-phone div:last-child {
  font-size: .75rem;
  color: rgba(255, 255, 255, .6);
}

/* Booking summary pill (from page) */
.booking-summary {
  background: var(--blue-pale);
  border: 1px solid var(--blue-border);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}
.booking-summary span {
  font-size: .78rem;
  font-weight: 600;
  color: var(--blue-mid);
}
.booking-summary span:first-child {
  color: var(--blue);
  font-weight: 700;
}
.booking-summary button {
  font-size: .75rem;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 700;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}

/* Confirmation details (from page) */
.confirmation-details {
  background: var(--blue-pale);
  border: 1px solid var(--blue-border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin: 1.5rem auto 2rem;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
}
.confirmation-details > div {
  text-align: center;
}
.conf-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: .25rem;
}
.conf-value {
  font-weight: 700;
  color: var(--blue);
}

/* Responsive */
@media(max-width:991px) {
  .appt-sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}
@media(max-width:767px) {
  .appt-main {
    padding: 1.5rem;
  }
  .appt-sidebar {
    padding: 1.5rem;
  }
  .service-options {
    grid-template-columns: 1fr;
  }
  .step-item .step-label {
    display: none;
  }
  .time-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media(max-width:480px) {
  .time-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}