/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Exact brand colors from oceanaluxemedspa.com's own nav/buttons */
  --pink:       #133762;
  --pink-dark:  #0d2846;
  --pink-deep:  #091d33;
  --pink-soft:  #dce8f2;
  --header-bg:  #c2e4ff;
  --black:      #0e0e0e;
  --text:       #1a1a1a;
  --muted:      #6b6b6b;
  --faint:      #b0b0b0;
  --white:      #ffffff;
  --bg:         #f7f7f7;
  --line:       #e5e5e5;
  --error:      #c62828;
  --radius:     8px;
  --radius-pill: 999px;
  --trans:      0.2s ease;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

a { color: var(--pink); text-decoration: none; }
a:hover { opacity: 0.8; }

/* ===== Container ===== */
.form-container {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  position: relative;
  overflow: hidden;
  min-height: 400px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

/* ===== Progress Bar ===== */
.progress-bar {
  height: 2px;
  background: var(--line);
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  background: var(--pink);
  width: 0%;
  transition: width 0.4s ease;
}

/* ===== Session Error Banner ===== */
/* A direct child of .form-container (not scoped to any one .step), so it
   stays visible above whichever step is active while retries are pending. */
.session-error-banner {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 32px;
  text-align: center;
  background: #fdecea;
  border-bottom: 1px solid var(--line);
}

/* ===== Back Button ===== */
.back-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background var(--trans), border-color var(--trans);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-btn.visible { opacity: 1; pointer-events: auto; }
.back-btn:hover { background: var(--bg); border-color: var(--faint); color: var(--text); }

/* ===== Steps ===== */
/* Wraps back-btn + steps-wrapper below .session-error-banner, so back-btn's
   absolute positioning anchors here instead of the top of .form-container
   (which would otherwise overlap the banner). */
.content-area {
  flex: 1;
  min-height: 0; /* allow shrinking below content size so .form-container's max-height can actually cap it */
  position: relative;
  display: flex;
  flex-direction: column;
}

.steps-wrapper {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.step {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateX(60px);
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.step.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
  flex: 1;       /* fills .steps-wrapper so a short step's footer can pin to the bottom of the card */
  min-height: 0; /* lets overflow-y:auto actually engage once .form-container's max-height caps the total */
}
.step.exit-left  { opacity: 0; transform: translateX(-60px); }
.step.enter-right { transform: translateX(60px); }
.step.enter-left  { transform: translateX(-60px); }
.step.exit-right  { opacity: 0; transform: translateX(60px); }

/* ===== Step Content ===== */
.step-content {
  width: 100%;
  flex: 1;
  min-height: 0; /* lets overflow-y:auto actually engage once .form-container's max-height caps the total */
  overflow-y: auto;
  padding: 52px 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.step-header { margin-bottom: 28px; width: 100%; }

.step-header h2 { font-size: 1.5rem; }

.step-sub {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ===== Logo ===== */
/* A direct child of .step (not .step-content), so it stretches full-width
   as a natural block — clipped to .form-container's rounded corners via
   overflow:hidden — matching the light-blue nav band the logo sits in on
   oceanaluxemedspa.com, which the logo's white/light elements need to
   actually be visible against. */
.logo {
  width: 100%;
  flex-shrink: 0;
  padding: 28px 32px 24px;
  background: var(--header-bg);
  display: flex;
  justify-content: center;
}

.logo-img {
  height: 56px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 24px;
}

/* ===== Path Cards ===== */
.path-cards {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.path-card {
  width: 100%;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'Inter', sans-serif;
  transition: background var(--trans), border-color var(--trans), transform var(--trans);
}

/* Some path-cards are <a> elements (existing patient) — override the global
   a:hover opacity fade so they hover the same way as the <button> ones. */
.path-card:hover {
  opacity: 1;
  border-color: var(--pink);
  background: var(--pink-soft);
  transform: translateY(-1px);
}

.path-card.selected {
  border-color: var(--pink);
  background: var(--pink-soft);
}

.path-card-icon {
  width: 44px;
  height: 44px;
  background: var(--pink-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--pink);
}

.path-card:hover .path-card-icon,
.path-card.selected .path-card-icon {
  background: var(--white);
  color: var(--pink);
}

.path-card-text { display: flex; flex-direction: column; gap: 2px; }
.path-card-title { font-size: 0.95rem; font-weight: 600; color: var(--black); }
.path-card-desc  { font-size: 0.8rem; color: var(--muted); }

/* ===== Guide-me List ===== */
.guide-list {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.guide-item {
  width: 100%;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: background var(--trans), border-color var(--trans);
}

.guide-item:hover { border-color: var(--pink); background: var(--pink-soft); }
.guide-item.selected { border-color: var(--pink); background: var(--pink-soft); color: var(--pink); }

/* ===== Service List ===== */
.service-list {
  width: 100%;
  max-width: 380px;
  max-height: 480px;
  overflow-y: auto;
  text-align: left;
  padding-right: 4px;
  margin-bottom: 8px;
}

.service-item {
  display: block;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 6px;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--trans), background var(--trans);
}

.service-item:hover {
  border-color: var(--pink);
  background: var(--pink-soft);
}

.service-item.selected {
  border-color: var(--pink);
  background: var(--pink-soft);
}

.service-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--black);
}

.service-item-desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.service-empty {
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ===== Inputs ===== */
.input-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.field { display: flex; flex-direction: column; width: 100%; }

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}

input:focus, textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(26,58,92,0.10);
}

input.invalid, textarea.invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(198,40,40,0.08);
}

textarea { resize: vertical; min-height: 100px; }

.field-error {
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 4px;
  min-height: 18px;
  text-align: left;
  font-weight: 500;
}

/* ===== Buttons ===== */
.btn {
  width: 100%;
  max-width: 320px;
  padding: 14px 32px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--trans), transform var(--trans);
}

.btn-primary {
  background: var(--pink);
  color: var(--white);
}

.btn-primary:hover { background: var(--pink-dark); transform: translateY(-1px); }
.btn-primary:active { background: var(--pink-deep); transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-cherry {
  background: #00C37D;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-cherry:hover { background: #00a66a; transform: translateY(-1px); }
.cherry-apply-icon { flex-shrink: 0; }

/* ===== Calendar ===== */
.datetime-picker {
  width: 100%;
  margin-bottom: 20px;
}

.calendar {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-nav {
  background: none;
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  transition: border-color var(--trans), color var(--trans);
}

.cal-nav:hover { border-color: var(--pink); color: var(--pink); }

.cal-month {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--black);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text);
  transition: background var(--trans), color var(--trans);
  font-family: 'Inter', sans-serif;
}

.cal-day:hover:not(.disabled) { background: var(--pink-soft); color: var(--pink); }
.cal-day.today { border: 1px solid var(--pink); color: var(--pink); }
.cal-day.selected { background: var(--pink); color: var(--white); }
.cal-day.selected:hover { background: var(--pink-dark); }
.cal-day.disabled { color: var(--faint); cursor: default; }
.cal-day.empty { background: none; cursor: default; }

/* ===== Time Slots ===== */
.time-slots {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: none;
}

.time-slots.visible { display: block; }

.time-slots h3 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-bottom: 10px;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.time-slot {
  padding: 9px 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background var(--trans), border-color var(--trans), color var(--trans);
  font-family: 'Inter', sans-serif;
}

.time-slot:hover { background: var(--pink-soft); border-color: var(--pink); color: var(--pink); }
.time-slot.selected { background: var(--pink); border-color: var(--pink); color: var(--white); }

.availability-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.no-availability {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 6px 0;
}

/* ===== Summary ===== */
.summary {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0; /* prevent flexbox from squeezing this below its content height and clipping rows */
  margin-bottom: 20px;
  text-align: left;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.summary-item:last-child { border-bottom: none; }

.summary-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  flex-shrink: 0;
}

.summary-value {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  text-align: right;
}

/* ===== Payment (card capture) ===== */
.payment-section {
  width: 100%;
  margin-bottom: 20px;
  text-align: left;
}

.payment-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 6px;
}

.payment-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-top: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* ===== Confirmation ===== */
.confirmation-step { padding-top: 56px; }

.checkmark-circle {
  width: 56px; height: 56px;
  background: var(--pink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--white);
}

.checkmark-path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawCheck 0.45s 0.15s ease forwards;
}

@keyframes drawCheck { to { stroke-dashoffset: 0; } }

.confirm-title { font-size: 1.75rem; margin-bottom: 10px; }

.confirm-message {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 24px;
  line-height: 1.55;
}

/* ===== Cherry Prompt ===== */
.cherry-prompt {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-align: center;
  margin-bottom: 20px;
}

.cherry-logo-row {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.cherry-logo-img { height: 26px; width: auto; }

.cherry-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--black);
}

.cherry-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.cherry-apply-btn { margin-bottom: 12px; width: 100%; }

/* ===== Resource Links ===== */
.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.resource-link {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: border-color var(--trans), background var(--trans);
}

.resource-link:hover { border-color: var(--pink); background: var(--pink-soft); color: var(--pink); opacity: 1; }

/* ===== Consent / Privacy ===== */
.consent-text {
  font-size: 0.7rem;
  color: var(--faint);
  line-height: 1.55;
  margin-top: 12px;
  text-align: center;
}

.consent-text a { color: var(--faint); text-decoration: underline; }

.cherry-disclosure { margin-top: 8px; }

.privacy-link {
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.72rem;
  color: var(--faint);
}

.privacy-link a { color: var(--faint); text-decoration: underline; }

/* ===== Microcopy ===== */
.microcopy-bottom {
  font-size: 0.8rem;
  color: var(--faint);
  margin-top: 4px;
}

.microcopy-bottom a { color: var(--pink); }

/* ===== Cherry iframe ===== */
.iframe-step-content {
  padding: 0 !important;
  min-height: 600px;
}

.cherry-iframe {
  width: 100%;
  height: 100%;
  min-height: 600px;
  border: none;
  display: block;
}

.iframe-fallback {
  padding: 16px;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 500px) {
  body { padding: 0; align-items: flex-start; }
  .form-container {
    max-width: 100%;
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  .step-content { padding: 48px 24px 36px; }
}
