/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --teal:        #1A6B6B;
  --teal-deep:   #14504F;
  --teal-soft:   #e3f4f4;
  --teal-mid:    #2a8a8a;
  --sand:        #f5f1ea;
  --sand-soft:   #faf8f4;
  --text:        #1a1a1a;
  --text-light:  #6b7280;
  --border:      #e5e7eb;
  --error:       #b00020;
  --success:     #1a6b3c;
  --radius:      3px;
  --shadow:      0 4px 28px rgba(0,0,0,.07);
  --font:        'Montserrat', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: linear-gradient(135deg, #e8f4f4 0%, #f5f1ea 100%);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 80px;
  color: var(--text);
}

/* ── Screen routing ────────────────────────────────────────── */
.screen { display: none; width: 100%; max-width: 680px; margin: 0 auto; }
.screen.active { display: block; }

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  position: relative;
}
.card.wide { max-width: 760px; }

@media (max-width: 560px) {
  .card { padding: 20px 16px; }
  h1 { font-size: 1.15rem; }
  h2 { font-size: 1.15rem; margin-bottom: 12px; }
  .btn-primary { padding: 13px; margin-top: 12px; }
  .fine-print { margin-top: 8px; }
}

/* ── Logo ──────────────────────────────────────────────────── */
.logo-wrap {
  text-align: center;
  margin-bottom: 24px;
  background: var(--teal);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-left: -4px;
  margin-right: -4px;
}
.logo {
  height: 60px;
  object-fit: contain;
}

/* ── Typography ────────────────────────────────────────────── */
h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -.01em;
  text-align: center;
  color: var(--teal);
}
h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 18px;
}
.subtitle {
  font-size: .95rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 24px;
}
.hint {
  font-size: .88rem;
  color: var(--text-light);
  margin-bottom: 14px;
}
.fine-print {
  font-size: .76rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 12px;
}
.fine-print a { color: var(--teal); text-decoration: none; }
.fine-print a:hover { text-decoration: underline; }

/* ── Path buttons (landing) ────────────────────────────────── */
.path-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 24px 0;
}
.btn-path {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--sand-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  text-align: left;
  width: 100%;
  font-family: var(--font);
}
.btn-path:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}
.path-icon { font-size: 1.4rem; margin-bottom: 4px; }
.path-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--teal);
}
.path-sub {
  font-size: .82rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* ── Patient gate buttons ──────────────────────────────────── */
#patient-type h1 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
}
.pt-gate { margin-top: 28px; }
.btn-gate {
  flex-direction: row !important;
  align-items: center !important;
  gap: 16px;
  padding: 16px 20px !important;
}
.gate-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--teal-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  transition: background .18s, color .18s;
}
.gate-icon { font-size: 1.3rem; }
.btn-gate:hover .gate-icon { background: var(--teal-soft); }
.gate-label {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}
.btn-gate:hover .gate-label { color: var(--teal-deep); }

/* ── Generic option list ───────────────────────────────────── */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option-btn {
  background: var(--sand-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 500;
  text-align: left;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.option-btn:hover, .option-btn.selected {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

/* ── Input ─────────────────────────────────────────────────── */
.input-field {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .95rem;
  outline: none;
  transition: border-color .15s;
  background: #fff;
}
.input-field:focus { border-color: var(--teal); }
.input-field::placeholder { color: #b8bec7; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 16px;
  transition: background .18s;
}
.btn-primary:hover { background: var(--teal-deep); }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 500;
  font-size: .88rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.btn-secondary:hover { background: var(--teal-soft); }

.btn-back {
  background: none;
  border: none;
  color: var(--teal);
  font-family: var(--font);
  font-size: .85rem;
  cursor: pointer;
  padding: 0 0 16px;
  display: block;
  letter-spacing: .04em;
}
.btn-back:hover { text-decoration: underline; }

.btn-nav {
  background: var(--teal-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--teal);
  font-family: var(--font);
  transition: background .15s;
}
.btn-nav:hover { background: var(--teal); color: #fff; }
.btn-nav:disabled { opacity: .4; cursor: not-allowed; }

/* ── Calendar ──────────────────────────────────────────────── */
.cal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
#cal-month-label {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: .98rem;
  color: var(--teal);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.cal-dow {
  text-align: center;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 0 6px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s, color .15s;
  color: var(--text);
  min-width: 0;
}
.cal-day:hover:not(:disabled) {
  background: var(--teal-soft);
  color: var(--teal);
}
.cal-day--today {
  border: 2px solid var(--teal);
  color: var(--teal);
  font-weight: 600;
}
.cal-day--selected {
  background: var(--teal) !important;
  color: #fff !important;
  font-weight: 600;
}
.cal-day--disabled {
  color: #d1d5db;
  cursor: not-allowed;
}
.cal-day--empty {
  pointer-events: none;
}
.cal-selected-label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--teal);
  margin: 14px 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ── Time grid ─────────────────────────────────────────────── */
.time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.time-slot {
  padding: 12px 6px;
  text-align: center;
  background: var(--sand-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 500;
  transition: border-color .15s, background .15s;
}
.time-slot:hover, .time-slot.selected {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}
.no-slots {
  color: var(--text-light);
  font-size: .88rem;
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px 0;
}

/* ── Summary / confirm box ─────────────────────────────────── */
.summary-box {
  background: var(--teal-soft);
  border: 1.5px solid var(--teal);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: .88rem;
}
.confirm-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(26,107,107,.12);
  line-height: 1.4;
}
.confirm-row:last-child { border-bottom: none; }
.confirm-label {
  flex-shrink: 0;
  width: 64px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--teal);
}
.confirm-val {
  font-size: .88rem;
  color: var(--text);
  word-break: break-word;
}
.summary-box strong { color: var(--teal); display: block; margin-bottom: 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }

/* ── Address block ─────────────────────────────────────────── */
.address-block {
  font-size: .9rem;
  line-height: 1.7;
  background: var(--sand);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 18px;
}
.address-block a { color: var(--teal); text-decoration: none; }

/* ── Treatment grid (exploring) ────────────────────────────── */
.treatment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.treatment-card {
  background: var(--sand-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.treatment-card h3 {
  font-size: .98rem;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 8px;
}
.treatment-card p {
  font-size: .84rem;
  color: var(--text-light);
  line-height: 1.55;
  margin-bottom: 12px;
}
.price-badge {
  display: inline-block;
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 2px;
  padding: 3px 10px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
}

.cta-block {
  text-align: center;
  padding: 24px;
  background: var(--teal-soft);
  border-radius: var(--radius);
}
.cta-block p {
  font-size: .88rem;
  color: var(--teal);
  margin-bottom: 14px;
  font-weight: 500;
}
.cta-block .btn-primary { max-width: 280px; margin: 0 auto 10px; }
.cta-block .btn-secondary { max-width: 280px; margin: 0 auto; }

/* ── Cherry result ─────────────────────────────────────────── */
#cherry-result, #ex-cherry-result {
  margin-top: 16px;
  font-size: .9rem;
  line-height: 1.6;
}
.cherry-approved {
  color: var(--success);
  font-weight: 600;
  padding: 14px;
  background: #e8f5ee;
  border-radius: var(--radius);
  border: 1.5px solid var(--success);
}
.cherry-declined {
  color: var(--text-light);
  padding: 14px;
  background: var(--sand);
  border-radius: var(--radius);
}
.cherry-apply-link {
  display: block;
  margin-top: 12px;
  padding: 13px;
  background: var(--teal);
  color: #fff;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .18s;
}
.cherry-apply-link:hover { background: var(--teal-deep); }

/* ── Success icon ──────────────────────────────────────────── */
.success-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 16px;
}

/* ── Loader / spinner ──────────────────────────────────────── */
.loader {
  text-align: center;
  color: var(--text-light);
  font-size: .86rem;
  padding: 20px 0;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loading-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #e8f4f4 0%, #f5f1ea 100%);
  align-items: center;
  justify-content: center;
  z-index: 100;
}
#loading-screen.active { display: flex; }
.loading-inner { text-align: center; color: var(--text-light); }

/* ── Global footer ─────────────────────────────────────────── */
.global-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  text-align: center;
  font-size: .62rem;
  color: var(--text-light);
  z-index: 50;
  white-space: nowrap;
  overflow: hidden;
}
.global-footer a { color: var(--teal); text-decoration: none; }
.global-footer a:hover { text-decoration: underline; }
.footer-dot { margin: 0 3px; color: var(--border); }
body:has(#patient-type.active) .global-footer { display: none; }

/* ── Cherry info box ───────────────────────────────────────── */
.cherry-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f9fafb;
}
.cherry-info-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 2px;
}
.cherry-info-text {
  font-size: .72rem;
  color: var(--text-light);
  line-height: 1.4;
  margin: 0;
}

/* ── Done / confirmation screen ───────────────────────────── */
.done-title {
  text-align: center;
  font-size: 1.5rem;
  color: var(--teal);
  margin-bottom: 8px;
}
.done-summary-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
}
.done-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.done-row:last-child { border-bottom: none; }
.done-label {
  font-size: .82rem;
  color: var(--text-light);
  flex-shrink: 0;
  min-width: 60px;
}
.done-val {
  font-size: .88rem;
  color: var(--teal);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

/* ── Cherry apply card ─────────────────────────────────────── */
.cherry-logo {
  text-align: center;
  margin-bottom: 16px;
}
.cherry-logo-img {
  height: 36px;
  width: auto;
}
.cherry-banner {
  background: #e8f8f2;
  border: 1.5px solid #00c37d;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: .88rem;
  font-weight: 500;
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 18px;
}
.cherry-heading {
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 14px;
}
.cherry-benefits-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding: 0;
}
.cherry-benefits-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  color: var(--text);
}
.cherry-check-icon {
  color: #00c37d;
  font-weight: 700;
  font-size: 1rem;
}
.btn-cherry-apply {
  display: block;
  text-align: center;
  width: 100%;
  padding: 14px;
  background: #00c37d;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s;
  margin-bottom: 4px;
}
.btn-cherry-apply:hover { background: #00a86b; }
.cherry-footer-links {
  text-align: center;
  margin-top: 14px;
  font-size: .72rem;
}
.cherry-footer-links a { color: var(--teal); text-decoration: none; }
.cherry-footer-links a:hover { text-decoration: underline; }
.cherry-footer-links span { color: var(--text-light); margin: 0 2px; }

/* ── Consent / disclosure text ─────────────────────────────── */
.consent-text {
  font-size: .72rem;
  color: var(--text-light);
  line-height: 1.55;
  margin-top: 10px;
}
.consent-text a { color: var(--teal); text-decoration: none; }
.consent-text a:hover { text-decoration: underline; }
.cherry-disclosures {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}


/* ── Error ─────────────────────────────────────────────────── */
.error-msg {
  color: var(--error);
  font-size: .82rem;
  margin-top: 8px;
  min-height: 1em;
}
