/* ── ChicaCharmer onboarding ────────────────────────────
   Additive stylesheet. Uses the tokens from style.css (--bg, --surface,
   --surface2, --accent, --accent2, --text, --text-muted, fonts).
   Everything is namespaced .ob-* ; nothing here touches existing selectors
   except the temporary hiding rules for html.cc-ob-active.            */

:root {
  --ob-accent-deep: #a2301f;           /* 3D "edge" of the red buttons */
  --ob-edge:        #151527;           /* 3D edge of neutral surfaces   */
  --ob-ease:        cubic-bezier(.2, .8, .2, 1);
  --ob-grad:        linear-gradient(135deg, var(--accent), var(--accent2));
}

/* ── While onboarding is active the existing app stays out of the way ── */
html.cc-ob-active body { overflow: hidden; }
html.cc-ob-active #app,
html.cc-ob-active #pepper-rain,
html.cc-ob-active #confetti-rain,
html.cc-ob-active #badge-notification,
html.cc-ob-active #trophy-overlay,
html.cc-ob-active #daily-dose-overlay { display: none !important; }

/* ── Overlay shell ──────────────────────────────────── */
.ob {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  height: 100vh;
  height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
html.cc-ob-active .ob { display: flex; }
.ob.ob--exit { animation: ob-exit .42s var(--ob-ease) forwards; pointer-events: none; }

.ob button { font-family: inherit; }
.ob :focus-visible { outline: 3px solid rgba(231, 111, 81, .7); outline-offset: 3px; }
.ob .ob-input:focus-visible { outline: none; }   /* the animated line is the focus indicator */

/* ── Top bar: back + progress ───────────────────────── */
.ob-top {
  flex: none;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 1.1rem 1.4rem .4rem;
  transition: max-width .4s var(--ob-ease);
}
.ob[data-step="2"] .ob-top,
html[data-ob-step="2"] .ob-top { max-width: 880px; }

.ob-back {
  flex: none;
  width: 0;
  height: 36px;
  margin-right: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: width .3s var(--ob-ease), margin .3s var(--ob-ease), opacity .2s, color .15s, background .15s;
}
.ob-back svg { width: 22px; height: 22px; display: block; margin: 0 auto; }
.ob[data-step="2"] .ob-back,
html[data-ob-step="2"] .ob-back {
  width: 36px; margin-right: .6rem; opacity: 1; pointer-events: auto;
}
.ob-back:hover { color: var(--text); background: var(--surface); }

.ob-progress {
  position: relative;
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
}
.ob-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p, 20%);
  border-radius: inherit;
  background: var(--ob-grad);
  transition: width .7s var(--ob-ease);
}
.ob-progress-fill::after {              /* soft highlight, a nod to Duolingo's bar */
  content: "";
  position: absolute;
  left: 8px; right: 8px; top: 3px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .28);
}

/* ── Screens ────────────────────────────────────────── */
.ob-screen {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  width: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.ob-screen.is-active { display: flex; }
html[data-ob-step="2"] .ob-screen { display: none; }
html[data-ob-step="2"] #ob-s2 { display: flex; }

.ob-screen.is-leaving { animation: ob-leave .26s ease-in forwards; }

.ob-body {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 1rem 1.4rem 1.5rem;
}
.ob-body--wide { max-width: 880px; }

/* Entrance choreography: every .ob-in rises in, staggered by --d (ms) */
.ob-screen.is-active .ob-in,
html[data-ob-step="2"] #ob-s2 .ob-in {
  opacity: 0;
  animation: ob-rise .65s var(--ob-ease) forwards;
  animation-delay: calc(var(--d, 0) * 1ms);
}

/* ── Floating peppers + hearts (decorative, fills the empty space on screen 1) ── */
#ob-s1 { position: relative; }
.ob-float { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.ob-float span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-size: var(--s, 2rem);
  line-height: 1;
  opacity: 0;
  filter: saturate(1.05);
  animation: ob-float var(--t, 8s) ease-in-out var(--d, 0s) infinite both;
  will-change: transform, opacity;
}
#ob-s1 .ob-body, #ob-s1 .ob-footer { position: relative; z-index: 1; }
#ob-s1 .ob-footer { position: sticky; }
@media (min-width: 760px) {
  .ob-float span { left: var(--x2, var(--x)); top: var(--y2, var(--y)); }
}

/* ── Typography ─────────────────────────────────────── */
.ob-wordmark {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 350;
  letter-spacing: -.02em;
  color: var(--accent);
  margin-bottom: auto;
  padding-top: .4rem;
}

.ob-hero { margin: 2.2rem 0 2rem; }

.ob .ob-title {
  display: block;                      /* style.css hides every h1 on mobile */
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 11.2vw, 5rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 300;
}
.ob-title > span { display: block; }
.ob-t-bold {
  display: block;
  width: fit-content;
  font-weight: 800;
  padding: 0 .04em .1em 0;
  background: var(--ob-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.ob .ob-title--sm {
  font-size: clamp(1.85rem, 7.6vw, 2.9rem);
  line-height: 1.08;
  font-weight: 300;
  letter-spacing: -.03em;
  outline: none;
  overflow-wrap: anywhere;
}
.ob-title--sm .ob-name {
  display: inline;
  font-weight: 800;
  background: var(--ob-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.ob-lede {
  margin-top: 1rem;
  max-width: 30rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-muted);
}
#ob-s2 .ob-lede { font-size: .95rem; margin-bottom: 1.4rem; }

/* ── Name field ─────────────────────────────────────── */
.ob-ask { margin-bottom: 1rem; }

.ob-q {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .005em;
  color: var(--text-muted);
  transition: color .25s;
}
.ob-ask:focus-within .ob-q,
.ob-ask.is-valid .ob-q { color: var(--text); }

.ob-field { position: relative; margin-top: .35rem; }

.ob-input {
  display: block;
  width: 100%;
  padding: .55rem 2.6rem .65rem 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  caret-color: var(--accent);
  font-family: var(--font-display);
  font-size: 2.1rem;               /* ≥16px: no iOS zoom-on-focus */
  font-weight: 700;
  letter-spacing: -.02em;
  -webkit-appearance: none;
  appearance: none;
}
.ob-input::placeholder { color: var(--text-muted); opacity: .5; font-weight: 500; transition: opacity .25s; }
.ob-input:focus::placeholder { opacity: .28; }

.ob-field-line {                   /* neutral rail + accent fill that sweeps in on focus */
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--surface2);
}
.ob-field-line::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--ob-grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ob-ease);
}
.ob-field:focus-within .ob-field-line::after,
.ob-ask.is-valid .ob-field-line::after { transform: scaleX(1); }
.ob-field:focus-within .ob-field-line { box-shadow: none; }

.ob-field-ok {
  position: absolute;
  right: 2px; top: 50%;
  width: 28px; height: 28px;
  margin-top: -18px;
  padding: 6px;
  border-radius: 50%;
  background: var(--ob-grad);
  color: #fff;
  transform: scale(0);
  opacity: 0;
  transition: transform .35s cubic-bezier(.2, 1.4, .4, 1), opacity .2s;
}
.ob-field-ok svg { display: block; width: 100%; height: 100%; }
.ob-ask.is-valid .ob-field-ok { transform: scale(1); opacity: 1; }

.ob-field.is-shaking { animation: ob-shake .4s ease; }

/* ── Footer + CTA ───────────────────────────────────── */
.ob-footer {
  flex: none;
  position: sticky;
  bottom: 0;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: .9rem 1.4rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 70%, rgba(15, 15, 26, 0));
}
#ob-s2 .ob-footer { max-width: 880px; }

.ob-cta {
  position: relative;
  display: block;
  width: 100%;
  padding: 1.05rem 1.5rem;
  border: 0;
  border-radius: 14px;
  background: var(--surface2);
  color: var(--text-muted);
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-align: center;
  cursor: not-allowed;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 4px 0 var(--ob-edge);
  transition: transform .12s ease, box-shadow .12s ease, background .3s, color .3s;
}
.ob-cta-label { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; transition: opacity .15s; }
.ob-arrow { display: inline-block; transition: transform .25s var(--ob-ease); }

.ob-cta[aria-disabled="false"] {
  background: var(--ob-grad);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ob-accent-deep);
}
.ob-cta.is-ready { animation: ob-ready .5s var(--ob-ease); }

@media (hover: hover) {
  .ob-cta[aria-disabled="false"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 0 var(--ob-accent-deep);
  }
  .ob-cta[aria-disabled="false"]:hover .ob-arrow { transform: translateX(5px); }
}
.ob-cta[aria-disabled="false"]:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--ob-accent-deep);
}

/* loading state (final click) */
.ob-spinner {
  position: absolute;
  left: 50%; top: 50%;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  border: 3px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: ob-spin .7s linear infinite;
  animation-play-state: paused;
}
.ob-cta.is-loading { pointer-events: none; }
.ob-cta.is-loading .ob-cta-label { opacity: 0; }
.ob-cta.is-loading .ob-spinner { opacity: 1; animation-play-state: running; }

/* ── Identity cards ─────────────────────────────────── */
.ob-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: .8rem;
}

.ob-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 1rem;
  width: 100%;
  padding: 1.05rem 1.1rem 1.15rem;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--surface2);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--surface2);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .14s ease, box-shadow .14s ease, border-color .2s, background .25s, opacity .25s;
}
.ob-card::after {                        /* one-shot ripple on selection */
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid var(--accent2);
  opacity: 0;
  pointer-events: none;
}

.ob-card-icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 15px;
  background: rgba(231, 76, 60, .12);
  color: var(--accent2);
  transition: background .25s, color .25s, transform .35s var(--ob-ease);
}
.ob-card-icon svg { width: 28px; height: 28px; display: block; }

.ob-card-body { display: block; min-width: 0; padding-right: 1.4rem; }
.ob-card-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
  line-height: 1.2;
}
.ob-card-desc {
  display: block;
  margin-top: .4rem;
  font-size: .9rem;
  line-height: 1.5;
  color: var(--text-muted);
  transition: color .25s;
}

.ob-card-check {
  position: absolute;
  top: .8rem; right: .8rem;
  width: 26px; height: 26px;
  padding: 5px;
  border-radius: 50%;
  background: var(--ob-grad);
  color: #fff;
  transform: scale(0);
  transition: transform .35s cubic-bezier(.2, 1.5, .4, 1);
}
.ob-card-check svg { display: block; width: 100%; height: 100%; }

@media (hover: hover) {
  .ob-card:hover {
    transform: translateY(-2px);
    border-color: rgba(231, 111, 81, .55);
    box-shadow: 0 6px 0 var(--surface2);
  }
  .ob-card:hover .ob-card-icon { transform: rotate(-6deg) scale(1.06); }
}
.ob-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--surface2); }

.ob-card[aria-checked="true"] {
  border-color: var(--accent);
  background: #34202f;
  box-shadow: 0 4px 0 var(--ob-accent-deep);
}
.ob-card[aria-checked="true"] .ob-card-icon { background: var(--ob-grad); color: #fff; }
.ob-card[aria-checked="true"] .ob-card-desc { color: #c3cad8; }
.ob-card[aria-checked="true"] .ob-card-check { transform: scale(1); }
.ob-card.is-popping { animation: ob-pop .4s var(--ob-ease); }
.ob-card.is-popping::after { animation: ob-ring .55s ease-out; }
.ob-card.is-popping .ob-card-icon { animation: ob-icon .5s var(--ob-ease); }

/* once something is picked, the others step back a little */
.ob-cards.has-choice .ob-card[aria-checked="false"] { opacity: .72; }
.ob-cards.has-choice .ob-card[aria-checked="false"]:hover { opacity: 1; }

/* ── Desktop ────────────────────────────────────────── */
@media (min-width: 760px) {
  .ob-top { padding-top: 1.6rem; }
  .ob-body { padding-top: 1.6rem; }
  .ob-hero { margin: 3rem 0 2.6rem; }
  .ob .ob-title { font-size: clamp(4rem, 8vw, 5.6rem); }
  .ob .ob-title--sm { font-size: clamp(2.2rem, 3.7vw, 2.9rem); }
  .ob-q { font-size: 1.2rem; }
  .ob-input { font-size: 2.6rem; }
  #ob-s2 .ob-lede { font-size: 1.05rem; margin-bottom: 2rem; }

  .ob-cards { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .ob-card { gap: 1.1rem; padding: 1.3rem 1.4rem 1.4rem; }
  .ob-card-icon { width: 58px; height: 58px; border-radius: 17px; }
  .ob-card-icon svg { width: 31px; height: 31px; }
  .ob-card-body { padding-right: 1.2rem; }
  .ob-card-title { font-size: 1.2rem; }
  .ob-card-desc { font-size: .95rem; }
  .ob-card-check { top: 1.1rem; right: 1.1rem; }

  .ob-footer,
  #ob-s2 .ob-footer { max-width: 880px; display: flex; justify-content: flex-end; padding-bottom: 1.8rem; }
  #ob-s1 .ob-footer { max-width: 620px; }
  .ob-cta { width: auto; min-width: 320px; padding: 1.1rem 2.4rem; }
  #ob-s1 .ob-footer .ob-cta { width: 100%; }
}

/* Short viewports (landscape phones, tiny screens) */
@media (max-height: 640px) {
  .ob-hero { margin: 1.2rem 0 1.2rem; }
  .ob-wordmark { padding-top: 0; }
}

/* ── Keyframes ──────────────────────────────────────── */
@keyframes ob-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ob-leave {
  to { opacity: 0; transform: translateX(calc(var(--dir, 1) * -28px)); }
}
@keyframes ob-exit {
  to { opacity: 0; transform: scale(1.03); }
}
@keyframes ob-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
@keyframes ob-ready {
  0%   { transform: scale(.97); }
  55%  { transform: scale(1.025); }
  100% { transform: scale(1); }
}
@keyframes ob-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.025) translateY(-2px); }
  100% { transform: scale(1); }
}
@keyframes ob-ring {
  0%   { opacity: .75; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.06); }
}
@keyframes ob-icon {
  0%   { transform: scale(.82) rotate(-10deg); }
  60%  { transform: scale(1.1) rotate(4deg); }
  100% { transform: none; }
}
@keyframes ob-float {
  0%   { opacity: 0;   transform: translateY(26px) rotate(var(--r1, -10deg)) scale(.8); }
  22%  { opacity: .8; }
  78%  { opacity: .8; }
  100% { opacity: 0;   transform: translateY(-70px) rotate(var(--r2, 10deg)) scale(1.08); }
}
@keyframes ob-spin { to { transform: rotate(360deg); } }

/* ── Reduced motion: keep the layout + state changes, drop the movement ── */
@media (prefers-reduced-motion: reduce) {
  .ob *, .ob *::before, .ob *::after { transition-duration: .01ms !important; }
  .ob-screen.is-active .ob-in,
  html[data-ob-step="2"] #ob-s2 .ob-in { animation: ob-fade .2s linear forwards; animation-delay: 0ms; }
  .ob-screen.is-leaving { animation: ob-fade-out .12s linear forwards; }
  .ob.ob--exit { animation: ob-fade-out .2s linear forwards; }
  .ob-cta.is-ready, .ob-card.is-popping, .ob-card.is-popping::after,
  .ob-card.is-popping .ob-card-icon, .ob-field.is-shaking { animation: none; }
  .ob-card:hover, .ob-cta[aria-disabled="false"]:hover { transform: none; }
  .ob-spinner { animation-duration: 1.6s; }
  .ob-float span { animation: none; opacity: .3; }
}
@keyframes ob-fade     { from { opacity: 0; } to { opacity: 1; } }
@keyframes ob-fade-out { to { opacity: 0; } }
