/* g3-app · auth.css · Sign in or join (Paper "Sign in or join (auth flow)", Auth 01-06) */
.screen.au-screen { padding-bottom: 0; }
.au {
  /* local sizes from the design (no base token for these radii) */
  --au-r-field: 16px; --au-r-box: 14px; --au-r-band: 12px; --au-row: 44px;
  position: relative; overflow: hidden; min-height: 100vh; min-height: 100dvh; background: var(--white);
}

/* one step = one full-height column; steps slide sideways inside the screen */
.au-step {
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
  /* the bottom edge stays page colour under the lowest button: iOS Safari tints its toolbar from it */
  padding: var(--safe-top) var(--gutter) calc(var(--safe-bottom) + var(--foot-gap));
  /* in-place step change like flow B: old fades where it is (120ms), new rises out of a soft blur */
  transition: transform 220ms var(--ease) 100ms, opacity 220ms var(--ease) 100ms, filter 220ms var(--ease) 100ms;
}
.au-step.is-out { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
.au-step.is-in-fwd, .au-step.is-in-back { opacity: 0; transform: translateY(8px); filter: blur(6px); }
.au-step.is-out-fwd, .au-step.is-out-back { opacity: 0; transition: opacity 120ms ease-out; }

.au-top { display: flex; align-items: center; justify-content: space-between; height: var(--btn); flex-shrink: 0; }
.au-pill {
  display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--beige); color: var(--muted); font-size: 13px; line-height: 16px; font-weight: 500; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.au-pill.is-ink { color: var(--ink); }
button.au-pill { transition: transform var(--dur-fast) var(--ease); }
button.au-pill:active { transform: scale(0.96); }

.au-body { flex: 1 1 auto; display: flex; flex-direction: column; padding-top: 56px; }
.au-title {
  display: flex; flex-direction: column; color: var(--ink);
  font-family: var(--f-stripes); font-weight: 900; text-transform: uppercase; font-size: 34px; line-height: 36px;
  text-wrap: balance;
}
.au-title .is-red { color: var(--red); }
.au-lead { margin-top: 12px; font-size: 15px; line-height: 21px; color: var(--muted); }

/* fields: label inside the beige box */
.au-form { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.au-field {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; cursor: text;
  background: var(--beige); border: 1.5px solid var(--beige); border-radius: var(--au-r-field);
  transition: border-color var(--dur-fast) var(--ease);
}
.au-field:focus-within { border-color: var(--ink); }
.au-field.is-err { border-color: var(--red); }
.au-field-l { font-size: 13px; line-height: 16px; color: var(--muted); }
.au-field-in { width: 100%; padding: 0; border: 0; background: transparent; outline: none; font-size: 17px; line-height: 22px; color: var(--ink); }
.au-err { font-size: 13px; line-height: 16px; font-weight: 500; color: var(--red-ink); }

.au-perks { display: flex; flex-direction: column; gap: 10px; padding-top: 24px; }
.au-perks li { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 18px; color: var(--ink); }
.au-perks svg { flex-shrink: 0; color: var(--red); }

.au-foot { display: flex; flex-direction: column; gap: 12px; margin-top: auto; padding-top: 24px; }
.au-terms { padding: 0 12px 4px; text-align: center; font-size: 12px; line-height: 17px; color: var(--muted); text-wrap: balance; }
.au-terms.is-13 { padding: 0 0 8px; font-size: 13px; line-height: 18px; }
.au-skip { display: flex; align-items: center; justify-content: center; height: var(--btn); font-size: 15px; line-height: 20px; font-weight: 500; color: var(--ink); }

/* code: one real input over six boxes */
.au-code { position: relative; display: block; margin-top: 28px; }
.au-code-in {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.01; border: 0; outline: none;
  font-size: 16px; color: transparent; caret-color: transparent; letter-spacing: 40px;
}
.au-boxes { display: flex; gap: 8px; pointer-events: none; }
.au-box {
  flex: 1 1 0; height: 60px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--au-r-box); background: var(--beige); border: 1.5px solid var(--beige);
  font-family: var(--f-sans); font-size: 26px; line-height: 32px; color: var(--ink);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.au-code-in:focus + .au-boxes .au-box.is-cur { background: var(--white); border-color: var(--ink); }
.au-code-in:focus + .au-boxes .au-box.is-cur::after {
  content: ""; width: 2px; height: 26px; background: var(--red); animation: au-caret 1s steps(1) infinite;
}
.au-code.is-busy .au-box { opacity: 0.5; }
.au-dig { display: inline-block; } /* so a digit can drop in (transform) */
@keyframes au-caret { 50% { opacity: 0; } }
.au-code-acts { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding-top: 20px; }
.au-chip {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--beige); font-size: 14px; line-height: 18px; font-weight: 500; color: var(--ink);
  transition: transform var(--dur-fast) var(--ease);
}
.au-chip:active { transform: scale(0.96); }
.au-link { font-size: 14px; line-height: 18px; color: var(--ink); }
.au-hint { display: inline-flex; align-items: center; gap: 8px; height: 36px; font-size: 14px; line-height: 18px; color: var(--muted); }
.au-hint.is-busy::after {
  content: ""; width: 12px; height: 12px; border-radius: 999px; border: 2px solid var(--handle); border-top-color: var(--ink);
  animation: au-spin 700ms linear infinite;
}
@keyframes au-spin { to { transform: rotate(360deg); } }

/* birthday wheel: 3 scroll-snap columns, 44px rows, beige band behind the middle row */
.au-wheel {
  position: relative; display: flex; flex-shrink: 0; height: calc(var(--au-row) * 5); margin-top: 36px; padding: 0 18px;
}
.au-band {
  position: absolute; left: 0; right: 0; top: calc(var(--au-row) * 2); height: var(--au-row);
  border-radius: var(--au-r-band); background: var(--beige); pointer-events: none;
}
.au-col {
  position: relative; height: 100%; overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; padding: calc(var(--au-row) * 2) 0; scrollbar-width: none; outline-offset: -2px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.45) 30%, #000 40%, #000 60%, rgba(0, 0, 0, 0.45) 70%, rgba(0, 0, 0, 0.2) 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.45) 30%, #000 40%, #000 60%, rgba(0, 0, 0, 0.45) 70%, rgba(0, 0, 0, 0.2) 100%);
}
.au-col::-webkit-scrollbar { display: none; }
.au-col.is-d { width: 70px; flex-shrink: 0; }
.au-col.is-m { flex: 1 1 0; min-width: 0; }
.au-col.is-y { width: 80px; flex-shrink: 0; }
.au-opt {
  height: var(--au-row); display: flex; align-items: center; justify-content: center; scroll-snap-align: center;
  font-size: 20px; line-height: 24px; color: var(--ink); white-space: nowrap; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.au-opt.is-sel { font-weight: 600; }

/* offers */
.au-rows { margin-top: 24px; border-top: 1px solid var(--line); }
.au-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.au-row-t { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.au-row-n { font-size: 15px; line-height: 19px; font-weight: 600; color: var(--ink); }
.au-row-s { font-size: 13px; line-height: 17px; color: var(--muted); }
.au-note { padding-top: 14px; font-size: 13px; line-height: 18px; color: var(--muted); }

/* ---------- welcome (Paper "Auth · 06 welcome v2b"): white, the first reward as the goal ---------- */
.au-wel { display: flex; flex-direction: column; padding-top: 82px; }
.au-wel-title { display: flex; flex-direction: column; font-family: var(--f-stripes); font-weight: 900; text-transform: uppercase; font-size: 40px; line-height: 40px; color: var(--ink); }
.au-wel-title .is-red { color: var(--red); }
.au-wel-sub { margin-top: 12px; font-size: 15px; line-height: 22px; color: var(--muted); }
.au-wel-goal { display: flex; flex-direction: column; gap: 14px; margin-top: 88px; padding: 0 20px 20px; border-radius: var(--r-card); background: var(--beige); }
.au-wel-ph { position: relative; height: 196px; flex-shrink: 0; }
.au-wel-ph img { position: absolute; left: 50%; top: -104px; width: 460px; height: 333px; max-width: none; margin-left: -230px; object-fit: contain; transform-origin: 50% 80%; }
.au-wel-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.au-wel-name { font-family: var(--f-sans); font-size: 22px; line-height: 26px; color: var(--ink); }
.au-wel-pts { font-family: var(--f-sans); font-size: 15px; line-height: 20px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.au-wel-bar { display: block; height: 8px; border-radius: 999px; background: var(--white); }
.au-wel-bar i { display: block; width: 8px; height: 8px; border-radius: 999px; background: var(--red); }
.au-wel-how { font-size: 13px; line-height: 18px; color: var(--muted); }
.au-wel-link { height: 48px; width: 100%; text-align: center; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--ink); }
.au-step.is-welcome .au-foot { gap: 4px; }
/* the welcome always fits the visible screen (Safari with its toolbar is ~100px shorter than the
   home-screen app): the space above the title gives way first, so the button never ends up under
   Safari's toolbar or needs a scroll */
.au-step.is-welcome { height: 100vh; height: 100dvh; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.au-step.is-welcome::-webkit-scrollbar { display: none; }
.au-step.is-welcome .au-wel { flex: 0 0 auto; padding-top: 0; } /* never shrink below its content: it used to slide under the button */
.au-step.is-welcome .au-wel::before { content: ""; flex: 0 1 82px; min-height: 8px; }
.au-step.is-welcome .au-wel > * { flex-shrink: 0; }
.au-step.is-welcome .au-foot { flex-shrink: 0; }
/* first-time delight: title, panel, then the shake pops out over the panel edge (< 600 ms) */
.au-wel-title span { animation: au-rise 320ms var(--ease) both; }
.au-wel-title span + span { animation-delay: 60ms; }
.au-wel-sub { animation: au-rise 320ms var(--ease) 120ms both; }
.au-wel-goal { animation: au-rise 360ms var(--ease) 160ms both; }
.au-wel-ph img { animation: au-shake 420ms cubic-bezier(0.34, 1.36, 0.64, 1) 220ms both; }
.au-wel-bar i { animation: au-dot 300ms var(--ease) 420ms both; }
@keyframes au-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes au-shake { from { opacity: 0; transform: translateY(24px) scale(0.92); } }
@keyframes au-dot { from { transform: scale(0); } }

/* steps with a text field (flow A): the buttons follow right under the content instead of the
   bottom edge, so nothing depends on the keyboard (B: .aub.is-field in onboard.css) */
.au:not(.aub) .au-step:is([data-au-step="email"], [data-au-step="code"], [data-au-step="name"]) .au-foot { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  .au-step { transition: opacity var(--dur-fast) linear; }
  .au-step.is-in-fwd, .au-step.is-in-back, .au-step.is-out-fwd, .au-step.is-out-back { transform: none; filter: none; }
  .au-wel-title span, .au-wel-sub, .au-wel-goal, .au-wel-ph img, .au-wel-bar i { animation-name: au-fade; }
  .au-code-in:focus + .au-boxes .au-box.is-cur::after { animation: none; }
}
@keyframes au-fade { from { opacity: 0; } }

/* ---------- flow B (Ore style, html.flow-b), Paper "Onboarding B" 06-10: shell + motion from onboard.css (.obb-*) ---------- */
.flow-b .au.aub { min-height: 0; height: 100vh; height: 100dvh; overflow: hidden; }
/* field: 64px, label inside, 2px ink ring on focus */
.flow-b .aub .au-form { margin-top: 24px; gap: 10px; }
.flow-b .aub .au-field {
  justify-content: center; gap: 2px; height: 64px; padding: 0 16px; border: 0;
  border-radius: var(--obb-r-opt); box-shadow: inset 0 0 0 2px transparent;
  transition: box-shadow var(--dur-fast) var(--ease);
}
.flow-b .aub .au-field:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.flow-b .aub .au-field.is-err { box-shadow: inset 0 0 0 2px var(--red); }
.flow-b .aub .au-field-l { font-size: 12px; line-height: 16px; }
/* Safari autofill (contact name, saved email) paints the field pale yellow: keep the field's own colours */
.au-field-in:-webkit-autofill, .au-field-in:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--beige) inset; box-shadow: 0 0 0 1000px var(--beige) inset;
  -webkit-text-fill-color: var(--ink); caret-color: var(--ink); transition: background-color 0s 600000s;
}
.au-field-in:autofill { background: transparent; }
.flow-b .aub-terms { font-size: 12px; line-height: 16px; color: var(--muted); }

/* code: Inter digits, 2px inset ring on the current box, resend as a quiet line */
.flow-b .aub .au-code { margin-top: 24px; }
.flow-b .aub .au-box {
  height: 60px; border: 0; border-radius: var(--au-r-band); box-shadow: inset 0 0 0 2px transparent;
  font-family: var(--f-ui); font-size: 24px; line-height: 28px; font-weight: 600;
  transition: background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.flow-b .aub .au-code-in:focus + .au-boxes .au-box.is-cur { background: var(--beige); box-shadow: inset 0 0 0 2px var(--ink); }
.flow-b .aub .au-code.is-wrong .au-box { box-shadow: inset 0 0 0 2px var(--red); }
.flow-b .aub .au-code.is-shake .au-boxes { animation: aub-shake 300ms var(--ease); }
.flow-b .aub .au-code.is-ok .au-box { background: var(--green-soft); box-shadow: inset 0 0 0 2px var(--green); color: var(--green-ink); }
.flow-b .aub .au-code.is-ok .au-box::after { display: none; }
.flow-b .aub-code-lines { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.flow-b .aub-err { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--red-ink); }
.flow-b .aub-err:empty { display: none; }
.flow-b .aub-resend { align-self: flex-start; font-size: 13px; line-height: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.flow-b .aub-resend.is-btn { color: var(--ink); font-weight: 500; text-decoration: underline 1px; text-underline-position: from-font; }
.flow-b .aub-chip { align-self: flex-start; margin-top: 16px; }
@keyframes aub-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

/* birthday: the same wheel, three rows */
.flow-b .aub .au-wheel { height: calc(var(--au-row) * 3); margin-top: 24px; padding: 0 8px; gap: 8px; }
.flow-b .aub .au-band { top: var(--au-row); }
.flow-b .aub .au-col {
  padding: var(--au-row) 0;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.32) 0%, rgba(0, 0, 0, 0.32) 33.3%, #000 33.4%, #000 66.6%, rgba(0, 0, 0, 0.32) 66.7%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.32) 0%, rgba(0, 0, 0, 0.32) 33.3%, #000 33.4%, #000 66.6%, rgba(0, 0, 0, 0.32) 66.7%);
}
.flow-b .aub .au-col.is-d { width: 56px; }
.flow-b .aub .au-opt { font-size: 20px; scale: 0.9; transition: scale 140ms var(--ease); }
/* detent: the row passing through the band grows to full size; the one that snaps pops (auth.js) */
.flow-b .aub .au-opt.is-sel { scale: 1; }

/* offers: switches on one beige card */
.flow-b .aub .au-rows.obb-card .au-row { min-height: 60px; padding: 10px 0; border-bottom: 1px solid var(--obb-divider); }
.flow-b .aub .au-rows.obb-card .au-row:last-child { border-bottom: 0; }
.flow-b .aub .au-note { padding-top: 12px; }

/* typing: valid input brightens the field edge once, the email check pops in at the right */
.flow-b .aub .au-field { position: relative; }
.flow-b .aub .au-field::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 0 1.5px var(--b-text);
}
.flow-b .aub .au-field.is-flash::after { animation: aub-edge 420ms var(--ease) both; }
@keyframes aub-edge { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.flow-b .aub .aub-ok {
  position: absolute; right: 16px; top: 50%; margin-top: -11px; display: grid; place-items: center;
  width: 22px; height: 22px; color: var(--green); pointer-events: none;
  opacity: 0; transform: scale(0.6); transition: opacity 120ms var(--ease), transform 240ms var(--ob-pop);
}
.flow-b .aub .au-field.is-valid .aub-ok { opacity: 1; transform: none; }
.flow-b .aub .au-field:has(.aub-ok) .au-field-in { padding-right: 30px; }
/* the button is "ready" only when the step's input is valid (still tappable: it explains what is missing) */
.flow-b .aub .cta.is-wait { opacity: 0.4; }

/* code: green tick runs across the boxes, 30 ms apart */
.flow-b .aub .au-code.is-ok .au-box { animation: aub-ok 260ms var(--ob-pop) both; }
.flow-b .aub .au-code.is-ok .au-box:nth-child(2) { transition-delay: 30ms; animation-delay: 30ms; }
.flow-b .aub .au-code.is-ok .au-box:nth-child(3) { transition-delay: 60ms; animation-delay: 60ms; }
.flow-b .aub .au-code.is-ok .au-box:nth-child(4) { transition-delay: 90ms; animation-delay: 90ms; }
.flow-b .aub .au-code.is-ok .au-box:nth-child(5) { transition-delay: 120ms; animation-delay: 120ms; }
.flow-b .aub .au-code.is-ok .au-box:nth-child(6) { transition-delay: 150ms; animation-delay: 150ms; }
@keyframes aub-ok { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .flow-b .aub .au-code.is-shake .au-boxes { animation: none; }
  .flow-b .aub .au-code.is-ok .au-box { animation: none; }
  .flow-b .aub .au-opt { scale: none; font-size: 18px; transition: none; }
  .flow-b .aub .au-opt.is-sel { font-size: 20px; }
  .flow-b .aub .aub-ok { transform: none; }
  .flow-b .aub .au-field.is-flash::after { animation-name: aub-edge; }
}

/* flow B black (Paper "B black"): thin rings, error pink, green tick that reads on black */
.flow-b .aub .au-field:focus-within { box-shadow: inset 0 0 0 1.5px var(--b-edge); }
.flow-b .aub .au-field.is-err { box-shadow: inset 0 0 0 1.5px var(--b-err); }
.flow-b .aub .au-code-in:focus + .au-boxes .au-box.is-cur { box-shadow: inset 0 0 0 1.5px var(--b-edge); }
.flow-b .aub .au-code.is-wrong .au-box, .flow-b .aub .au-code.is-wrong .au-code-in:focus + .au-boxes .au-box.is-cur { box-shadow: inset 0 0 0 1.5px var(--b-err); }
.flow-b .aub .au-code.is-ok .au-box { background: var(--b-raised); box-shadow: inset 0 0 0 1.5px var(--green); color: var(--green); }
.flow-b .aub .au-col {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.34) 0%, rgba(0, 0, 0, 0.34) 33.3%, #000 33.4%, #000 66.6%, rgba(0, 0, 0, 0.34) 66.7%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.34) 0%, rgba(0, 0, 0, 0.34) 33.3%, #000 33.4%, #000 66.6%, rgba(0, 0, 0, 0.34) 66.7%);
}

/* welcome on shorter screens / longer languages (ET title runs to 3 lines): a calmer title and a
   smaller milkshake so the panel, the link and the button all fit without overlapping */
@media (max-height: 900px) {
  .au-step.is-welcome .au-wel-title { font-size: 34px; line-height: 35px; }
  .au-step.is-welcome .au-wel-goal { margin-top: 64px; padding-bottom: 16px; gap: 10px; }
  .au-step.is-welcome .au-wel-ph { height: 132px; }
  .au-step.is-welcome .au-wel-ph img { top: -78px; width: 330px; height: 240px; margin-left: -165px; }
}
