/* OffLabel — full-screen onboarding.
 *
 * Ported from the Stitch design: Material-3 periwinkle system, Libre Caslon Text
 * headlines + Inter body, a glass card floating over a pearlescent ambient
 * background, primary-fixed selected states, and pill buttons. (The Stitch export
 * used Tailwind CDN + Material Symbols, neither allowed under an MV3 page CSP, so
 * this is hand-written CSS with inline SVG icons.) Class names are unchanged so
 * onboarding.js keeps working as-is.
 */

:root {
  --surface: #ffffff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #fafafa;
  --surface-container: #f4f4f4;
  --surface-container-high: #f0f0f0;
  --surface-container-highest: #ededed;
  --surface-variant: #e6e6e6;
  --on-surface: #0a0a0a;
  --on-surface-variant: #5c5c5c;
  --outline: #999999;
  --outline-variant: #dcdcdc;
  --primary: #2e74ea;
  --on-primary: #ffffff;
  --primary-container: #dbe8ff;
  --on-primary-container: #0a3a86;
  --primary-fixed: #e8f1ff;
  --on-primary-fixed-variant: #1a4fa0;
  --tertiary-fixed: #f0f0f0;
  --secondary: #5c5c5c;
  --secondary-container: #f0f0f0;
  --error: #ba1a1a;
  --error-container: #ffdad6;
  --selected-bg: #e8f1ff;

  --serif: "Geist", system-ui, -apple-system, sans-serif;
  --sans: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;

  --r-card: 24px;
  --r-xl: 14px;
  --r-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px;
  position: relative;
  overflow-x: hidden;
}
/* pearlescent ambient lighting */
body::before, body::after { content: ""; position: fixed; pointer-events: none; z-index: -1; }
/* iridescent wash — pink -> purple -> blue -> cyan */
body::before {
  top: -25%; left: -12%; width: 124%; height: 95%;
  background: #ffffff;
  filter: blur(64px); opacity: 0.72; animation: ol-aurora 22s ease-in-out infinite alternate;
}
body::after {
  bottom: -28%; left: 50%; transform: translateX(-50%); width: 120%; height: 64%;
  background: #ffffff;
  filter: blur(86px); opacity: 0.6;
}
@keyframes ol-aurora { from { transform: translate(0,0) scale(1); } to { transform: translate(2%, 1.5%) scale(1.06); } }

/* The contained tool: a glass card floating over the ambient glow. */
.ol-card {
  width: 100%;
  max-width: 500px;
  min-height: min(760px, calc(100vh - 96px));
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--r-card);
  box-shadow: 0 10px 44px rgba(72, 94, 141, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- header ---- */
.ol-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--surface-variant); flex-shrink: 0;
  background: rgba(248, 249, 250, 0.55);
}
.ol-brand { font-family: var(--serif); font-size: 23px; font-weight: 700; color: var(--primary); }
.ol-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; background: none; border-radius: 9999px;
  color: var(--on-surface-variant); cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.ol-iconbtn:hover { background: rgba(72,94,141,0.08); }
.ol-iconbtn:active { transform: scale(0.95); }
.ol-iconbtn svg { width: 22px; height: 22px; }

/* ---- progress ---- */
.ol-progress-wrap { padding: 18px 24px 0; flex-shrink: 0; }
.ol-progress { width: 100%; height: 6px; background: var(--surface-container-highest); border-radius: 9999px; overflow: hidden; }
.ol-progress-bar {
  height: 100%; width: 0%; border-radius: 9999px;
  background: #2e74ea; background-size: 220% 100%;
  animation: ol-prog 3s linear infinite;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ol-prog { to { background-position: 220% 0; } }
.ol-step-meta {
  display: flex; justify-content: space-between; margin-top: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--secondary);
}
.ol-step-meta span:first-child { color: var(--primary); }

/* ---- step canvas ---- */
.ol-body { flex: 1; overflow-y: auto; padding: 28px 24px; }
.ol-step { display: none; }
.ol-step.show { display: flex; flex-direction: column; animation: ol-fade 0.4s ease; }
@keyframes ol-fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---- typography ---- */
.ol-h1 { font-family: var(--serif); font-size: 30px; line-height: 1.18; font-weight: 700; color: var(--on-surface); margin-bottom: 10px; letter-spacing: -0.01em; }
.ol-h2 { font-family: var(--serif); font-size: 20px; line-height: 1.3; font-weight: 700; color: var(--on-surface); margin-bottom: 4px; }
.ol-sub { font-size: 15px; color: var(--on-surface-variant); line-height: 1.55; }
.ol-label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--secondary); margin-bottom: 12px; display: block; }
.ol-label-opt { text-transform: none; letter-spacing: normal; font-weight: 400; color: var(--on-surface-variant); }
.ol-help { font-size: 12.5px; line-height: 1.5; color: var(--on-surface-variant); margin: -4px 0 12px; text-transform: none; }

/* ---- centered hero (welcome / done) ---- */
.ol-center { align-items: center; text-align: center; }
.ol-badge {
  width: 96px; height: 96px; border-radius: 9999px; color: var(--primary);
  background: #e6e6e6;
  display: flex; align-items: center; justify-content: center; margin: 24px 0 28px;
  box-shadow: 0 10px 26px rgba(72, 94, 141, 0.2);
  animation: ol-float 3.8s ease-in-out infinite;
}
@keyframes ol-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.ol-badge svg { width: 44px; height: 44px; }
.ol-badge-mark { width: 104px; height: 104px; background: none; box-shadow: none; border-radius: 0; }
.ol-badge-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ol-brand-wordmark { height: 24px; width: auto; display: block; }
.ol-welcome-head { font-family: var(--serif); font-size: 24px; font-weight: 700; text-align: center; color: var(--on-surface); margin: 26px 0 2px; }
.ol-badge-wordmark { margin: 4px 0 22px; animation: ol-float 3.8s ease-in-out infinite; }
.ol-badge-wordmark img { width: 230px; max-width: 72%; height: auto; display: block; margin: 0 auto; }
.ol-badge.ol-badge-done { background: #2e74ea; color: var(--on-primary); }
.ol-center .ol-sub { margin-bottom: 28px; max-width: 380px; }
.ol-center .ol-h1 { margin-bottom: 12px; }

/* ---- buttons ---- */
.ol-btn {
  width: 100%; padding: 14px 24px; border: none; border-radius: 9999px;
  background: #2e74ea; color: var(--on-primary);
  font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: 0.01em; cursor: pointer;
  box-shadow: 0 4px 14px rgba(72, 94, 141, 0.3), inset 0 1px 0 rgba(255,255,255,0.26);
  transition: background 0.15s, transform 0.1s, opacity 0.15s, box-shadow 0.2s;
}
.ol-btn:hover { background: #3c4f78; box-shadow: 0 6px 20px rgba(72, 94, 141, 0.36); transform: translateY(-1px); }
.ol-btn:active { transform: scale(0.98); }
.ol-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }
.ol-btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); box-shadow: none; }
.ol-btn-outline:hover { background: rgba(72, 94, 141, 0.06); }
.ol-btn-ghost { background: none; border: none; color: var(--secondary); font-weight: 600; font-size: 14px; cursor: pointer; padding: 10px; box-shadow: none; }
.ol-btn-ghost:hover { color: var(--primary); }

/* Done-screen demo verdict — the aha: a real, personalized verdict on an example product */
.ol-demo { width: 100%; margin: 6px 0 18px; text-align: left; animation: ol-demo-rise 0.55s ease both; }
@keyframes ol-demo-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ol-demo-head { font-size: 12.5px; line-height: 1.45; color: var(--secondary); text-align: center; margin-bottom: 12px; }
.ol-demo-card { background: var(--surface-container-lowest); border: 1px solid var(--surface-variant); border-radius: 18px; padding: 16px 18px; box-shadow: 0 8px 22px rgba(40, 48, 90, 0.07); }
.ol-demo-top { display: flex; align-items: center; gap: 14px; }
.ol-demo-score { flex: none; width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 21px; font-weight: 700; color: #fff; box-shadow: 0 4px 12px rgba(40, 48, 90, 0.18); }
.ol-demo-score.ol-tone-good { background: var(--primary); }
.ol-demo-score.ol-tone-caution { background: #a86a1a; }
.ol-demo-score.ol-tone-bad { background: #ba1a1a; }
.ol-demo-meta { min-width: 0; }
.ol-demo-name { font-size: 14.5px; font-weight: 700; color: var(--on-surface); line-height: 1.3; }
.ol-demo-label { font-size: 13px; font-weight: 600; margin-top: 2px; }
.ol-demo-label.ol-tone-good { color: var(--primary); }
.ol-demo-label.ol-tone-caution { color: #a86a1a; }
.ol-demo-label.ol-tone-bad { color: #ba1a1a; }
.ol-demo-lines { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--surface-container-high); display: flex; flex-direction: column; gap: 8px; }
.ol-demo-line { font-size: 13px; line-height: 1.4; color: var(--on-surface-variant); }
.ol-demo-line .k { font-weight: 700; }
.ol-demo-line.flag .k { color: #ba1a1a; }
.ol-demo-line.good .k { color: var(--primary); }
.ol-demo-foot { font-size: 11.5px; color: var(--secondary); text-align: center; margin-top: 11px; line-height: 1.45; }
.ol-btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--surface-container-lowest); border: 1px solid var(--outline-variant); color: var(--on-surface); box-shadow: none; }
.ol-btn-google:hover { background: var(--surface-container-low); }
.ol-btn-google svg { width: 18px; height: 18px; }

/* ---- sign-in ---- */
.ol-divider { display: flex; align-items: center; gap: 12px; color: var(--outline); font-size: 12px; margin: 18px 0; }
.ol-divider::before, .ol-divider::after { content: ""; flex: 1; height: 1px; background: var(--outline-variant); }
.ol-field {
  width: 100%; padding: 13px 15px; border: 1px solid var(--outline-variant); border-radius: var(--r-lg);
  background: var(--surface-container-lowest); font-family: inherit; font-size: 14px; color: var(--on-surface);
}
.ol-field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(72,94,141,0.12); }
.ol-field::placeholder { color: var(--outline); }
.ol-fineprint { font-size: 11px; color: var(--outline); line-height: 1.5; margin-top: 14px; text-align: center; }
.ol-stack > * + * { margin-top: 10px; }

/* ---- option cards (goals) ---- */
.ol-cards { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.ol-optcard {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border: 1px solid var(--outline-variant); border-radius: var(--r-xl); background: var(--surface-container-lowest);
  cursor: pointer; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.ol-optcard:hover { background: var(--surface-container-low); border-color: var(--primary-container); }
.ol-optcard.selected { border-color: var(--primary); background: var(--primary-fixed); box-shadow: 0 4px 16px rgba(72, 94, 141, 0.20); }
.ol-opticon {
  width: 48px; height: 48px; border-radius: var(--r-lg); background: var(--tertiary-fixed); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.2s;
}
.ol-optcard:hover .ol-opticon { transform: scale(1.08); }
.ol-opticon svg { width: 24px; height: 24px; }
.ol-opttext { flex: 1; }
.ol-opttitle { font-size: 15px; font-weight: 600; color: var(--on-surface); display: block; }
.ol-optdesc { font-size: 12px; color: var(--on-surface-variant); margin-top: 2px; display: block; }
.ol-optcheck { color: var(--primary); opacity: 0; transition: opacity 0.2s; flex-shrink: 0; }
.ol-optcheck svg { width: 24px; height: 24px; }
.ol-optcard.selected .ol-optcheck { opacity: 1; }

/* ---- hero strip ---- */

/* ---- field groups ---- */
.ol-group + .ol-group { margin-top: 24px; }
.ol-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* selectable chips (skin type, sex, scalp, hair type, reactivity) */
.ol-choice {
  display: flex; align-items: center; justify-content: center; padding: 13px;
  border: 1px solid var(--outline-variant); border-radius: var(--r-lg); background: var(--surface-container-lowest);
  font-size: 14px; font-weight: 500; color: var(--on-surface); cursor: pointer; transition: all 0.15s; text-align: center;
}
.ol-choice:hover { border-color: var(--primary-container); background: var(--surface-container-low); }
.ol-choice.selected { background: var(--primary-fixed); color: var(--on-primary-fixed-variant); border-color: var(--primary); font-weight: 600; box-shadow: 0 2px 10px rgba(72, 94, 141, 0.16); }
.ol-choice.ol-choice-wide { grid-column: 1 / -1; }
.ol-choice-row { display: flex; gap: 10px; }
.ol-choice-row .ol-choice { flex: 1; }
/* skin-tone color chips */
.ol-swatch { width: 20px; height: 20px; border-radius: 50%; margin-right: 9px; flex: 0 0 auto; border: 1px solid rgba(0,0,0,0.14); box-shadow: inset 0 1px 2px rgba(0,0,0,0.16); }
/* hair-length cards: visual + label + inline spec, sized by sex */
.ol-len-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.ol-len-choice { flex-direction: column; gap: 3px; padding: 18px 6px; }
.ol-choice-main { font-size: 14px; font-weight: 600; }
.ol-choice-sub { font-size: 11px; font-weight: 400; line-height: 1.25; color: var(--on-surface-variant); }
.ol-len-choice.selected .ol-choice-sub { color: var(--on-primary-fixed-variant); }

/* concern pills */
/* the hidden attribute must beat display:flex/grid (otherwise hidden .ol-pills still show) */
[hidden] { display: none !important; }
.ol-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ol-pill-none:not(.selected) { border-style: dashed; }
.ol-pill {
  padding: 8px 13px; border: 1px solid var(--outline-variant); border-radius: 9999px; background: var(--surface-container-lowest);
  font-size: 13.5px; font-weight: 500; color: var(--on-surface); cursor: pointer; transition: all 0.15s;
}
.ol-pill:hover { border-color: var(--primary-container); background: var(--surface-container-low); }
.ol-pill.selected { background: var(--primary-fixed); color: var(--on-primary-fixed-variant); border-color: var(--primary); font-weight: 600; box-shadow: 0 2px 8px rgba(143, 165, 217, 0.32); }
/* iridescent sheen on any selected chip/card (text stays dark + readable) */
.ol-choice.selected, .ol-pill.selected, .ol-optcard.selected, .ol-listcard.selected {
  background-image: #f4f4f4;
}

/* select + textarea */
.ol-select, .ol-textarea {
  width: 100%; padding: 13px 15px; border: 1px solid var(--outline-variant); border-radius: var(--r-lg);
  background: var(--surface-container-lowest); font-family: inherit; font-size: 14px; color: var(--on-surface);
}
.ol-select:focus, .ol-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(72,94,141,0.12); }
.ol-textarea { resize: vertical; min-height: 88px; }

/* pregnancy note box */
.ol-notebox { padding: 16px; background: var(--secondary-container); border: 1px solid var(--primary-container); border-radius: var(--r-xl); }
.ol-notebox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ol-notebox-note { font-size: 12.5px; color: var(--on-surface-variant); margin-top: 8px; line-height: 1.45; max-width: 300px; }

/* toggle-style checkbox */
.ol-check {
  width: 24px; height: 24px; border: 1.5px solid var(--outline); border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  color: transparent; background: var(--surface-container-lowest); transition: all 0.15s;
}
.ol-check.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.ol-check svg { width: 16px; height: 16px; }

.ol-conditional[hidden] { display: none; }

/* ---- list cards (avoid step, if present) ---- */
.ol-listcards { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.ol-listcard {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px;
  border: 1px solid var(--outline-variant); border-radius: var(--r-xl); background: var(--surface-container-lowest); cursor: pointer; transition: all .2s;
}
.ol-listcard:hover { border-color: var(--primary-container); background: var(--surface-container-low); }
.ol-listcard.selected { border-color: var(--primary); background: var(--primary-fixed); box-shadow: 0 4px 16px rgba(72, 94, 141, 0.18); }
.ol-listcard-text { flex: 1; }
.ol-listcard-name { font-family: var(--serif); font-size: 18px; color: var(--on-surface); display: block; }
.ol-listcard-desc { font-size: 12px; color: var(--on-surface-variant); margin-top: 3px; display: block; }
.ol-listcard-check { color: var(--outline-variant); flex-shrink: 0; display: flex; }
.ol-listcard.selected .ol-listcard-check { color: var(--primary); }
.ol-listcard-check svg { width: 24px; height: 24px; }

/* ---- done summary cards ---- */
.ol-summary-cards { width: 100%; display: flex; flex-direction: column; gap: 10px; margin: 8px 0 24px; }
.ol-sumcard {
  display: flex; align-items: center; gap: 14px; padding: 16px; text-align: left;
  background: var(--surface-container-lowest); border: 1px solid var(--outline-variant); border-radius: var(--r-xl);
}
.ol-sumcard-icon { width: 42px; height: 42px; border-radius: var(--r-lg); background: var(--secondary-container); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ol-sumcard-icon svg { width: 22px; height: 22px; }
.ol-sumcard-text { flex: 1; }
.ol-sumcard-k { font-size: 11px; color: var(--on-surface-variant); display: block; }
.ol-sumcard-v { font-size: 14px; font-weight: 600; color: var(--on-surface); margin-top: 2px; display: block; }
.ol-sumcard-check { color: var(--primary); flex-shrink: 0; display: flex; }
.ol-sumcard-check svg { width: 22px; height: 22px; }
.ol-sumcard[hidden] { display: none; }

/* ---- footer ---- */
.ol-foot { flex-shrink: 0; padding: 16px 24px 20px; border-top: 1px solid var(--surface-variant); background: rgba(243, 244, 245, 0.6); }
.ol-foot-links { display: flex; justify-content: center; gap: 16px; margin-top: 12px; }
.ol-foot-links a { font-size: 11px; color: var(--on-surface-variant); text-decoration: none; }
.ol-foot-links a:hover { color: var(--primary); }
.ol-foot-disc { text-align: center; font-size: 12px; color: var(--secondary); margin-top: 8px; }
.ol-back { margin-top: 10px; }

/* phones / small windows */
@media (max-width: 560px) {
  body { padding: 0; }
  .ol-card { max-width: none; min-height: 100vh; border: none; border-radius: 0; box-shadow: none; background: var(--surface); backdrop-filter: none; }
}

/* ===== chrome boost (matches the landing) ===== */
@keyframes ol-mshim { to { background-position: 200% 50%; } }
@keyframes ol-bsheen { 0% { transform: translateX(-130%) skewX(-20deg); } 55%, 100% { transform: translateX(320%) skewX(-20deg); } }
.ol-h1 { color: #0a0a0a; }
.ol-btn:not(.ol-btn-google) { position: relative; overflow: hidden; background: #2e74ea; box-shadow: 0 5px 18px rgba(46,116,234,.34), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -3px 9px rgba(20,52,120,.32); }
.ol-btn:not(.ol-btn-google)::after { content: ""; position: absolute; top: 0; left: 0; width: 42%; height: 100%; pointer-events: none; display: none; }


/* ---- face scan (optional, pre-fills the form; photo never stored) ---- */
.ol-face-card { background: #f4f4f4; border: 1px solid #e6e6e6; border-radius: 14px; padding: 16px; }
.ol-face-btn { display: inline-flex; align-items: center; gap: 9px; border: none; cursor: pointer;
  background: #2e74ea; color: #fff; font-family: inherit;
  font-size: 14.5px; font-weight: 700; padding: 12px 20px; border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(31,86,192,.28); transition: transform .12s ease, box-shadow .12s ease; }
.ol-face-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(31,86,192,.36); }
.ol-face-btn svg { width: 19px; height: 19px; }
.ol-face-note { font-size: 12.5px; color: #5d647a; margin-top: 10px; line-height: 1.45; }
.ol-face-status { margin-top: 12px; font-size: 13.5px; line-height: 1.5; color: #1f2430;
  background: #fff; border: 1px solid #e2e6f0; border-radius: 10px; padding: 11px 13px; }
.ol-face-status.ol-face-busy { color: #41507d; }
.ol-face-status.ol-face-err { color: #93000a; background: #fff5f4; border-color: #f3d3d0; }
.ol-pill.ol-pill-ai::after { content: " ✨"; }

/* plain-language info icon on jargon options + its popover */
.ol-info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 7px; border-radius: 50%; flex: 0 0 auto;
  background: var(--surface-variant); color: var(--on-surface-variant);
  font: italic 700 10px/1 Georgia, "Times New Roman", serif; cursor: help;
  vertical-align: middle; user-select: none; transition: background 0.15s, color 0.15s;
}
.ol-info:hover { background: var(--primary-container); color: var(--on-primary-container); }
.ol-pill.selected .ol-info, .ol-choice.selected .ol-info { background: rgba(255,255,255,0.6); color: var(--on-primary-fixed-variant); }
.ol-info-pop {
  position: fixed; z-index: 100000; max-width: 264px;
  background: #1b1340; color: #fff; font-size: 12.5px; line-height: 1.45; font-weight: 400;
  padding: 10px 13px; border-radius: 10px; box-shadow: 0 10px 30px rgba(27,19,64,0.34);
}
