/* Superstar Peptides — protocol funnel
   Rebranded to the site design system: light cream paper, dusty-rose accent,
   Archivo / Inter / JetBrains Mono. (Funnel structure ported from the
   Claude Design "Peptides Funnel" handoff; visuals match peptides.cynthiaconcierge.com.)
*/

:root {
  /* Accent — brand dusty rose. --accent is for FILLS (buttons, progress, chips);
     --accent-deep is for TEXT / icons / borders that must read on light paper. */
  --accent: #E8B5A8;
  --accent-deep: #C68B7C;
  --accent-soft: rgba(232,181,168, 0.18);
  --accent-glow: rgba(232,181,168, 0.45);
  --accent-ink: #6E4034;

  /* Surfaces — light */
  --bg: #FAFAF7;          /* paper */
  --bg-2: #F2F1EC;        /* paper-2 */
  --card: #FFFFFF;
  --card-hover: #F7F6F2;
  --card-elev: #FFFFFF;
  --line: #E8E7E0;        /* paper-3 */
  --line-strong: #D8D7D0;
  --soft: rgba(0, 0, 0, 0.03);

  /* Ink */
  --ink: #0A0A0A;
  --ink-2: #222222;
  --ink-3: #6B6B66;       /* muted */
  --ink-4: #9A9A93;       /* muted-2 */
  --ink-5: #C4C4BE;

  /* Semantic */
  --success: #1FB36B;
  --success-bg: rgba(31, 179, 107, 0.10);
  --warn: #E8C76B;
  --danger: #E5484D;

  /* Card plate (portrait body cards) */
  --plate: radial-gradient(80% 100% at 50% 50%, #F4F2EC 0%, #ECEAE3 100%);
  --plate-selected: radial-gradient(80% 100% at 50% 50%, rgba(232,181,168,0.28) 0%, #FBF5F3 100%);

  /* Type — matches styles.css site-wide */
  --display: "Archivo", "Inter", -apple-system, system-ui, sans-serif;
  --ui:      "Inter", "Archivo", -apple-system, system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  /* Radii / motion */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Layout */
  --content-max: 640px;
  --header-h: 64px;
  --progress-h: 4px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--ui);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: transparent; padding: 0; }
input, select { font: inherit; color: inherit; }

/* ─── Top app bar ──────────────────────────────────────────── */
.sp-app {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.sp-topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(250, 250, 247, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.sp-topbar-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-h);
  padding: 0 20px;
  gap: 16px;
}
.sp-back {
  width: 36px; height: 36px; border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.05);
  color: var(--ink);
  transition: background 0.15s var(--ease);
  justify-self: start;
}
.sp-back:hover { background: rgba(0,0,0,0.10); }
.sp-back:disabled { opacity: 0; pointer-events: none; }

.sp-topbar-right {
  display: flex; align-items: center; gap: 22px;
  justify-self: end;
  color: var(--ink);
  font-size: 14px; font-weight: 500;
}
.sp-topbar-right .sp-link { color: var(--ink); cursor: pointer; transition: color 0.15s; }
.sp-topbar-right .sp-link:hover { color: var(--accent-deep); }
.sp-menu {
  display: grid; place-items: center; width: 28px; height: 28px;
  color: var(--ink); cursor: pointer;
}

/* Wordmark — brand star + SUPERSTAR/PEPTIDES (matches site brandmark) */
.sp-wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
  user-select: none;
}
.sp-wordmark .wm-star { color: var(--accent); display: inline-flex; }
.sp-wordmark .wm-sub { opacity: 0.55; margin-left: 4px; }

/* Progress bar */
.sp-progress-wrap {
  position: relative;
  height: var(--progress-h);
  background: var(--line);
}
.sp-progress-fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--accent);
  transition: width 0.45s var(--ease);
  box-shadow: 0 0 12px var(--accent-glow);
}
.sp-progress-count {
  position: absolute;
  top: 8px; right: 20px;
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-4);
  font-weight: 500;
}

/* ─── Main layout ─────────────────────────────────────────── */
.sp-main {
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  align-items: center;
  padding: 56px 24px 0;
}
.sp-screen-inner {
  width: 100%;
  max-width: var(--content-max);
  display: flex; flex-direction: column;
  gap: 28px;
  padding-bottom: 140px; /* room for sticky footer */
}
.sp-screen-inner.wide { max-width: 880px; }

.sp-title-block {
  text-align: center;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center;
}

/* ─── Type ────────────────────────────────────────────────── */
.sp-h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.sp-h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}
.sp-sub {
  font-family: var(--ui);
  font-size: 15px; line-height: 1.55;
  color: var(--ink-3);
  margin: 0;
  max-width: 540px;
  text-wrap: pretty;
}
.sp-eyebrow {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 600;
}
.sp-tiny { font-size: 12px; line-height: 1.45; color: var(--ink-4); }
.sp-mono { font-family: var(--mono); }

/* ─── Sticky CTA footer ───────────────────────────────────── */
.sp-footer {
  position: sticky;
  bottom: 0;
  width: 100%;
  padding: 24px 24px 32px;
  background: linear-gradient(180deg, rgba(250, 250, 247, 0) 0%, var(--bg) 42%);
  display: flex; justify-content: center;
  pointer-events: none;
  z-index: 5;
}
.sp-footer-inner {
  width: 100%;
  max-width: 420px;
  pointer-events: auto;
  display: flex; flex-direction: column; gap: 10px;
}

/* ─── Primary CTA (rose pill, ink text — matches .btn-primary) ─ */
.sp-cta {
  width: 100%;
  height: 56px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 8px 20px -6px rgba(232,181,168, 0.55),
              0 1px 0 rgba(255,255,255,0.4) inset;
  transition: transform 0.12s var(--ease), box-shadow 0.2s var(--ease), background 0.15s;
}
.sp-cta:hover:not(:disabled) { background: #f0c5b8; box-shadow: 0 12px 30px -8px rgba(232,181,168, 0.7); }
.sp-cta:active { transform: translateY(1px); }
.sp-cta:disabled { opacity: 0.4; box-shadow: none; cursor: not-allowed; }
.sp-cta.ghost {
  background: transparent; color: var(--ink);
  box-shadow: none;
  border: 1.5px solid var(--ink);
}

/* ─── Option card (horizontal row) ────────────────────────── */
.sp-card {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 16px;
  text-align: left;
  transition: all 0.15s var(--ease);
  width: 100%;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
}
.sp-card:hover { background: var(--card-hover); border-color: var(--line-strong); }
.sp-card:active { transform: scale(0.995); }
.sp-card.selected {
  border-color: var(--accent-deep);
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
}
.sp-card-title { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.sp-card-sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.sp-card-icon {
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(0,0,0,0.04);
  display: grid; place-items: center;
  color: var(--ink-2);
}
.sp-card-icon.dot {
  background: var(--accent-soft); color: var(--accent-deep);
}
.sp-card.selected .sp-card-icon.dot { background: var(--accent); color: var(--ink); }
.sp-card-grow { flex: 1 1 auto; min-width: 0; }
.sp-card-trail {
  flex: 0 0 auto;
  color: var(--ink-4);
}

/* Multi-select checkbox */
.sp-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center;
  color: transparent; transition: 0.15s;
  flex: 0 0 auto;
}
.sp-card.selected .sp-check { background: var(--accent); border-color: var(--accent-deep); color: var(--ink); }

/* Single-select radio circle */
.sp-radio {
  width: 22px; height: 22px; border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.sp-card.selected .sp-radio { border-color: var(--accent-deep); }
.sp-card.selected .sp-radio::after {
  content: ''; width: 10px; height: 10px; border-radius: 999px; background: var(--accent-deep);
}

/* ─── Portrait/body card (light plate w/ silhouette) ──────── */
.sp-portrait {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--plate);
  border: 2px solid var(--line);
  color: var(--ink);
  transition: all 0.18s var(--ease);
  display: flex; flex-direction: column;
  cursor: pointer;
}
.sp-portrait:hover { border-color: var(--line-strong); }
.sp-portrait.selected {
  border-color: var(--accent-deep);
  background: var(--plate-selected);
  box-shadow: 0 0 0 1px var(--accent-deep),
              0 12px 32px -8px rgba(232,181,168, 0.45);
}
.sp-portrait-body {
  flex: 1 1 auto;
  display: grid; place-items: center;
  padding: 18px 10px 8px;
  position: relative;
}
.sp-portrait-label {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px 16px;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  color: var(--ink);
  border-top: 1px solid var(--line);
}
.sp-portrait.selected .sp-portrait-label {
  background: rgba(232,181,168, 0.28);
  color: var(--ink);
}

/* Grid helpers */
.sp-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.sp-grid-2-tall { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.sp-stack { display: flex; flex-direction: column; gap: 12px; }
.sp-row { display: flex; align-items: center; gap: 8px; }

/* Divider */
.sp-divider {
  border: 0; border-top: 1px solid var(--line-strong);
  margin: 4px 0; height: 0;
}

/* Banner */
.sp-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--success-bg);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  color: var(--success);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px; font-weight: 600;
}
.sp-banner svg { flex: 0 0 auto; }

/* Pill */
.sp-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: rgba(0,0,0,0.05); color: var(--ink-2);
  border: 1px solid var(--line);
}
.sp-pill.accent {
  background: var(--accent-soft); color: var(--accent-deep);
  border-color: color-mix(in srgb, var(--accent-deep) 35%, transparent);
}

/* Input */
.sp-input {
  width: 100%;
  height: 64px;
  border-radius: 14px;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  padding: 0 20px;
  font-size: 18px; font-weight: 600;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  text-align: center;
}
.sp-input:focus {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.sp-input::placeholder { color: var(--ink-4); font-weight: 500; }

/* Unit toggle */
.sp-toggle {
  display: inline-flex; padding: 4px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
}
.sp-toggle button {
  height: 36px; padding: 0 18px; border-radius: 999px;
  font-size: 14px; font-weight: 700; color: var(--ink-3);
  transition: all 0.15s;
}
.sp-toggle button.on { background: var(--accent); color: var(--ink); }

/* Slider */
.sp-slider-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 24px 22px;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
}
.sp-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--p, 50%), rgba(0,0,0,0.10) var(--p, 50%), rgba(0,0,0,0.10) 100%);
  outline: none;
}
.sp-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(198,139,124, 0.5);
  cursor: pointer;
}
.sp-slider::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--accent); border: 3px solid #fff;
}

/* Loader dots */
@keyframes spbounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4 } 40% { transform: scale(1); opacity: 1 } }
.sp-dots { display: inline-flex; gap: 6px; }
.sp-dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--accent-deep); animation: spbounce 1.2s infinite var(--ease); }
.sp-dots span:nth-child(2) { animation-delay: 0.15s; }
.sp-dots span:nth-child(3) { animation-delay: 0.3s; }

/* Doctor card */
.sp-doc {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
}
.sp-doc-avatar {
  width: 44px; height: 44px; border-radius: 999px;
  background: linear-gradient(135deg, #E8B5A8, #C68B7C);
  flex: 0 0 auto;
}

/* Star rating */
.sp-stars { color: var(--accent-deep); font-size: 14px; letter-spacing: 2px; }

/* Trust row (landing) + chip row (education) */
.sp-trust-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sp-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Page transitions */
@keyframes spIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sp-enter { animation: spIn 0.36s var(--ease) both; }

/* Body silhouette glow (used on portrait cards) */
.bs-glow {
  filter: drop-shadow(0 6px 18px rgba(110, 64, 52, 0.12));
}
.sp-portrait.selected .bs-glow {
  filter: drop-shadow(0 6px 22px rgba(198,139,124, 0.45));
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.10); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); }

/* Mobile responsiveness */
@media (max-width: 640px) {
  .sp-main { padding: 32px 16px 0; }
  .sp-topbar-row { padding: 0 16px; }
  .sp-topbar-right { gap: 14px; font-size: 14px; }
  .sp-topbar-right .sp-link.hide-mobile { display: none; }
  .sp-screen-inner { gap: 22px; padding-bottom: 130px; }
  .sp-grid-2 { gap: 10px; }
  .sp-footer { padding: 18px 16px 24px; }
}
