/* =============================================================================
   BillGrid public site: sign in, sign up, password reset (layout/auth.html).
   Loads after outer/site.css. Design source: docs/mocks/site/payday-signin.html.
   ============================================================================= */

/* the body is the grid; its other children (icon sprite, scripts) must not claim a row, so the two
   panes share one row that takes all the height */
.auth { --auth-preview-scale: .8; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: minmax(100vh, 1fr); min-height: 100vh; }
.auth > :not(.auth__pane, .auth__story) { position: absolute; }

/* ---------- form pane ---------- */
.auth__pane { position: sticky; top: 0; align-self: start; isolation: isolate; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; padding: var(--space-7) clamp(20px, 5vw, 72px); background: var(--bg-panel); }
.auth__pane::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: url("/images/marketing/away-landscape-81a41c8af098980b84cc68398f4a020b.svg") 65% center / auto 100% no-repeat; opacity: .48; filter: saturate(.5); mask-image: linear-gradient(transparent, var(--ink) 28%, var(--ink) 70%, transparent); }
.auth-intro { margin-bottom: var(--space-7); }
.auth-intro h1 { line-height: 1.12; }
.auth-intro .accent { display: inline-block; margin-top: var(--space-1); }
.auth .field__reveal { min-width: 44px; min-height: 44px; }
.auth__top { display: flex; justify-content: space-between; align-items: center; }
.auth__back { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--fs-sm); color: var(--text-muted); text-decoration: none; }
.auth__back:hover { color: var(--ink); }
.auth__body { width: 100%; max-width: 420px; margin: auto; padding-block: 48px; }
.auth__body h1 { font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: clamp(30px, 3.2vw, 40px); }
.auth__lead { margin-top: 12px; font-size: var(--fs-body); color: var(--text-muted); }
.auth__foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; font-size: var(--fs-sm); color: var(--caption); }
.auth__foot a { color: inherit; text-decoration: none; }
.auth__foot a:hover { color: var(--ink); }

.auth__tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: var(--space-6); padding: var(--space-1); border: 1px solid var(--border); border-radius: var(--r-lg); background: color-mix(in srgb, var(--bg-panel) 60%, transparent); }
.auth__tabs a { display: grid; place-items: center; min-height: 44px; padding: var(--space-2); border-radius: var(--r-md); text-align: center; text-decoration: none; font-size: var(--fs-body); font-weight: 600; color: var(--text-muted); }
.auth__tabs a[aria-current="page"] { background: var(--bg-panel); color: var(--ink); box-shadow: var(--shadow-sm); }

.auth-form { display: grid; gap: 16px; margin-top: 26px; }
.auth--login .auth-form, .auth--signup .auth-form { margin-top: 0; }
.auth__body > .alert { margin-bottom: var(--space-4); }
.auth-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth__switch { margin-top: 26px; text-align: center; font-size: var(--fs-body); color: var(--text-muted); }
.auth__switch a { font-weight: 600; color: var(--ink); text-underline-offset: 3px; }
.auth__legal { text-align: center; font-size: var(--fs-xs); color: var(--text-muted); }
.auth__legal a { color: var(--text); }
.auth__agreement { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); line-height: 1.5; color: var(--text); cursor: pointer; }
.auth__agreement input { flex: none; width: var(--space-4); height: var(--space-4); margin: 0; accent-color: var(--ink); }
.auth__agreement input:focus-visible { outline: var(--space-1) solid var(--trust); outline-offset: var(--space-1); }
.auth__agreement a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: var(--space-1); }
.auth__sent { text-align: center; }
.auth__sent-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 16px; background: var(--trust-bg); color: var(--trust); }
.auth__sent b { color: var(--ink); }
.auth__body > .btn { margin-top: 26px; }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength i { height: 4px; border-radius: 2px; background: var(--sand-200); transition: background .25s; }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--overdue-fg); }
.strength[data-level="2"] i:nth-child(-n+2) { background: #c9912f; }
.strength[data-level="3"] i:nth-child(-n+3) { background: #7a9a3f; }
.strength[data-level="4"] i { background: var(--paid-fg); }

/* Solo, Pro and Team (mock docs/mocks/site/payday-signin.html?mode=signup): the plan the link named as one
   line, and its choices behind Change, a <details>, so it works without JavaScript and posts the same radios. */

/* ---------- confirm your email (pages/verify-email.html; mock: docs/mocks/site/verify-email.html) ---------- */
.auth__top form { margin: 0; }
.auth__top button.auth__back { padding: 0; border: 0; background: none; cursor: pointer; }

/* one real input (autofill, paste, Backspace stay native) under six drawn cells; auth.js keeps them in step */
.otp { position: relative; margin-top: 30px; }
.otp input { width: 100%; padding: 12px 14px; border: 1px solid var(--field-border); border-radius: 10px; font: inherit; font-size: var(--fs-lg); letter-spacing: .3em; color: var(--ink); }
.otp input:focus { outline: none; border-color: var(--ink); box-shadow: var(--field-focus); }
.js .otp input { position: absolute; inset: 0; height: 100%; opacity: 0; border: 0; font-size: 16px; caret-color: transparent; cursor: text; }
.otp__cells { display: grid; grid-template-columns: repeat(3, 1fr) 12px repeat(3, 1fr); gap: 8px; align-items: center; pointer-events: none; }
html:not(.js) .otp__cells { display: none; }
.otp__gap { height: 2px; border-radius: 1px; background: var(--field-border); }
.otp__cell { display: grid; place-items: center; aspect-ratio: 6 / 7; border: 1px solid var(--field-border); border-radius: var(--r-lg); background: var(--bg-panel); font-size: clamp(22px, 4vw, 28px); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); transition: border-color .15s, box-shadow .15s, background .2s; }
.otp__cell.is-filled { border-color: var(--sand-400); }
.otp:focus-within .otp__cell.is-active { border-color: var(--ink); box-shadow: var(--field-focus); }
.otp:focus-within .otp__cell.is-active:empty::after { content: ""; width: 2px; height: 42%; border-radius: 1px; background: var(--gold); animation: otp-caret 1.05s steps(1) infinite; }
.otp[data-state="error"] .otp__cell { border-color: var(--overdue-fg); color: var(--overdue-fg); }
.otp[data-state="error"] .otp__cells { animation: otp-shake .32s; }
.otp[data-state="busy"] .otp__cell { border-color: var(--line); background: var(--paper); color: var(--text-muted); }
@keyframes otp-caret { 50% { opacity: 0; } }
@keyframes otp-shake { 20% { translate: -5px; } 40% { translate: 5px; } 60% { translate: -3px; } 80% { translate: 3px; } }

.verify__status { display: flex; gap: 7px; align-items: center; min-height: 22px; margin-top: 12px; font-size: var(--fs-sm); color: var(--text-muted); }
.verify__status svg { flex: none; }
.verify__status--error { color: var(--overdue-fg); }
.verify__status--ok { color: var(--paid-fg); }
.verify__submit { margin-top: 16px; }
.js [data-otp-form] .verify__submit { display: none; }
.two-step .auth__agreement { margin-top: var(--space-4); }
.auth__detail { margin-top: var(--space-5); font-size: var(--fs-sm); line-height: 1.6; color: var(--text-muted); }
.auth__detail a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }

.verify__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 22px; font-size: var(--fs-sm); color: var(--text-muted); }
.verify__actions form { margin: 0 0 0 auto; }
.verify__inbox { display: inline-flex; gap: 8px; align-items: center; padding: 7px 13px; border: 1px solid var(--field-border); border-radius: 999px; font-weight: 600; color: var(--ink); text-decoration: none; }
.verify__inbox:hover { border-color: var(--ink); }
.verify__link { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--trust); cursor: pointer; }
.verify__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.verify__link:disabled { font-weight: 500; color: var(--caption); cursor: default; text-decoration: none; }

.verify__change { margin-top: 18px; font-size: var(--fs-sm); }
.verify__change summary { width: fit-content; font-weight: 600; color: var(--trust); cursor: pointer; }
.verify__change[open] summary { margin-bottom: 10px; }
.verify__change-form { display: flex; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.verify__change-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--field-border); border-radius: 10px; font: inherit; font-size: 16px; color: var(--ink); }
.verify__change-form input:focus { outline: none; border-color: var(--ink); box-shadow: var(--field-focus); }
.verify__change-form--reauth { flex-wrap: wrap; }
.verify__change-form--reauth input { flex-basis: 100%; }
.verify__change-form--reauth .btn { margin-left: auto; }

.verify__trust { display: flex; gap: 9px; align-items: flex-start; margin-top: 34px; font-size: var(--fs-sm); line-height: 1.5; color: var(--trust); }
.verify__trust svg { flex: none; margin-top: 2px; }

.verify--done { text-align: center; }
.verify__seal { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 20px; background: var(--paid-bg); color: var(--paid-fg); animation: verify-pop .5s var(--ease-out) both; }
.verify__progress { max-width: 220px; height: 3px; margin: 26px auto 22px; overflow: hidden; border-radius: 2px; background: var(--line); }
.verify__progress i { display: block; width: 0; height: 100%; background: var(--ink); animation: verify-fill 1.5s .1s ease-in-out forwards; }
@keyframes verify-pop { from { opacity: 0; transform: scale(.6); } }
@keyframes verify-fill { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .otp__cells, .otp__cell::after, .verify__seal, .verify__progress i { animation: none !important; } }

/* ---------- compact methods and the public product showcase ---------- */
.auth-actionbar { display: flex; min-width: 0; }
.auth-actionbar > .btn { flex: 1; width: auto; min-width: 0; border-radius: var(--r-lg); }
.auth-actionbar:has(.auth-provider) > .btn { border-radius: var(--r-lg) 0 0 var(--r-lg); }
.auth-provider { flex: 0 0 48px; min-height: 48px; display: grid; place-items: center; padding: 0; border: 1px solid var(--field-border); border-radius: 0 var(--r-lg) var(--r-lg) 0; background: var(--bg-panel); cursor: pointer; text-decoration: none; }
.auth-provider img { width: var(--icon-size-lg); height: var(--icon-size-lg); object-fit: contain; }
.auth-provider:hover { background: var(--bg-hover); }
.auth-provider:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; z-index: 1; }
.auth__story { position: sticky; top: 0; align-self: start; min-height: 100svh; isolation: isolate; display: grid; align-content: space-between; gap: var(--space-8); min-width: 0; overflow: hidden; padding: clamp(28px, 3.2vw, 52px); color: var(--sand-50); background: radial-gradient(ellipse at 105% 12%, color-mix(in srgb, var(--gold-bright) 64%, transparent), transparent 56%), linear-gradient(155deg, var(--sand-900), var(--sand-800) 65%, var(--sand-700)); }
.auth__story::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .65; background: repeating-radial-gradient(ellipse at 104% 20%, transparent 0 72px, color-mix(in srgb, var(--sand-200) 11%, transparent) 73px, transparent 74px 130px); }
.auth__story::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 0 100%, color-mix(in srgb, var(--sent-fg) 27%, transparent), transparent 65%); }
.auth__story .kicker { color: var(--sand-300); font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .06em; text-transform: none; }
.auth__headline { font-family: var(--font-display); font-weight: var(--font-display-weight); margin-top: var(--space-4); font-size: clamp(42px, 4.3vw, 66px); letter-spacing: -.04em; line-height: 1.04; color: var(--sand-50); }
.auth__headline .accent { color: var(--cream-line); }
.auth__story-copy { max-width: 28em; margin: var(--space-5) 0 0; color: var(--sand-200); font-size: var(--fs-md); line-height: 1.6; }
.auth__trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin: 0; padding: var(--space-5) 0 0; list-style: none; border-top: 1px solid color-mix(in srgb, var(--sand-200) 20%, transparent); }
.auth__trust li { display: flex; gap: var(--icon-gap-md); align-items: flex-start; font-size: var(--fs-sm); color: var(--sand-300); line-height: 1.5; }
.auth__trust .bg-icon { flex: none; margin-top: var(--space-1); }
.auth__trust b { display: block; font-weight: 600; color: var(--sand-50); }
.auth-showcase { zoom: var(--auth-preview-scale); width: 90%; justify-self: center; min-width: 0; margin: 0; overflow: clip; border: 1px solid color-mix(in srgb, var(--sand-200) 40%, transparent); border-radius: var(--r-xl); background: var(--bg-app); color: var(--text); box-shadow: var(--shadow-dialog); }
.auth-showcase figcaption { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--border); background: var(--bg-panel); font-size: var(--fs-xs); color: var(--text-muted); }
.auth-showcase figcaption > span:first-child { display: inline-flex; align-items: center; gap: var(--icon-gap-md); font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.auth-showcase__body { padding: var(--space-4); }
.auth-showcase .greeting { margin-bottom: var(--space-4); }
.auth-showcase .greeting h2 { font-family: var(--font-serif); font-size: var(--fs-xl); line-height: 1.2; }
.auth-showcase .kpis { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.auth-showcase .kpi { padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-panel); }
.auth-showcase .kpi p { margin: 0; }
.auth-showcase .k-label { color: var(--text-muted); font-size: var(--fs-sm); }
.auth-showcase .kpi .k-value { margin-top: var(--space-2); font-family: var(--font-serif); font-size: clamp(20px, 2.1vw, 30px); font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.2; color: var(--ink); }
.auth-showcase .kpi .k-other { margin-top: var(--space-1); color: var(--text-muted); font-size: var(--fs-xs); }
.auth-showcase__section { margin-top: var(--space-4); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-panel); overflow: hidden; }
.auth-showcase__section h3 { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: 0; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-soft); font-size: var(--fs-sm); font-weight: 600; line-height: 1.5; }
.auth-showcase__section h3 > span { font-size: var(--fs-xs); font-weight: 400; color: var(--text-muted); }
.auth-showcase .dtable { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.auth-showcase .dtable th { text-align: left; font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); }
.auth-showcase .dtable :is(th, td) { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-soft); }
.auth-showcase .dtable tr:last-child td { border-bottom: 0; }
.auth-showcase .dtable :is(th, td):last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.auth-showcase .dtable td:first-child :is(b, span) { display: block; }
.auth-showcase .dtable td:first-child span { font-size: var(--fs-xs); color: var(--text-muted); }
.auth-activity { list-style: none; margin: 0; padding: var(--space-1) var(--space-4); }
.auth-activity li { display: flex; gap: var(--icon-gap-md); align-items: flex-start; padding: var(--space-2) 0; position: relative; }
.auth-activity__icon { display: grid; place-items: center; width: var(--space-7); height: var(--space-7); flex: none; border-radius: var(--r-md); background: var(--bg-hover); color: var(--text-muted); }
.auth-activity__paid .auth-activity__icon { background: var(--paid-bg); color: var(--paid-fg); }
.auth-activity b { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--ink); }
.auth-activity b span { font-weight: 600; }
.auth-activity p { margin: var(--space-1) 0 0; color: var(--text-muted); font-size: var(--fs-xs); line-height: 1.3; }
[data-theme="dark"] .auth { --paper: var(--bg-app); --line: var(--border); --caption: var(--text-muted); --field-border: var(--sand-400); --field-focus: 0 0 0 4px var(--gold-wash); }
[data-theme="dark"] .auth__pane::before { opacity: .12; }
[data-theme="dark"] .auth .field input:not([type="radio"]) { background: var(--bg-panel); }
[data-theme="dark"] .auth__story { background: radial-gradient(ellipse at 105% 12%, var(--gold-wash), transparent 60%), var(--bg-app); color: var(--text); }
[data-theme="dark"] .auth__story :is(.auth__headline, .auth__trust b) { color: var(--ink); }
[data-theme="dark"] .auth__story :is(.kicker, .auth__story-copy, .auth__trust li) { color: var(--text-muted); }
[data-theme="dark"] .auth__headline .accent { color: var(--gold-bright); }
@media (min-width: 981px) and (max-height: 900px) { .auth__story { padding-block: var(--space-6); gap: var(--space-4); } .auth__headline { font-size: 44px; } .auth__story-copy { margin-top: var(--space-3); } }
@media (min-width: 981px) and (max-height: 780px) { .auth { --auth-preview-scale: .68; } .auth__story { padding-block: var(--space-5); gap: var(--space-3); } .auth__headline { font-size: 40px; } }

@keyframes auth-drop { from { opacity: 0; transform: translateY(-14px); } }

/* Connecting an app (pages/connect-app.html; design docs/mocks/app/connections.html#consent). */
.connect__marks { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.connect__mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; font-family: var(--font-serif); font-size: 20px; font-weight: 700; }
.connect__mark--app { background: var(--sand-100); color: var(--ink); }
.connect__mark--ours { background: light-dark(var(--bg-panel), var(--ink)); forced-color-adjust: none; }
.connect__mark--ours img { display: block; width: 100%; height: 100%; object-fit: contain; }
.connect__who-out { margin: 4px 0 0; }
.connect__link { width: 24px; border-top: 2px dotted var(--line); }
.connect__domain { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: var(--fs-sm); color: var(--trust); }
.connect { display: grid; gap: 10px; margin-top: 22px; }
.connect__h { margin: 10px 0 0; font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--caption); }
.connect__list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); line-height: 1.45; color: var(--text); }
.connect__list li, .connect__list label { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start; }
.connect__list li:has(> label) { display: block; }
.connect__list label { cursor: pointer; }
.connect__list input[type=checkbox] { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--gold); }
.connect__list .bg-icon { margin-top: 2px; }
.connect__list--can .bg-icon { color: var(--paid-fg); }
.connect__list--cant .bg-icon { color: var(--caption); }
.connect__note { margin: 8px 0 6px; font-size: var(--fs-sm); line-height: 1.45; color: var(--caption); }
.connect__status { margin: 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text); }
/* A form that posts once (form[data-once], outer/auth.js: connecting an app, signing up): its button spins while it waits. */
form[data-once] .once-spinner { display: none; }
form[data-once] [aria-busy="true"] .once-spinner { display: inline-block; animation: bg-spin .9s linear infinite; }
.connect__cancel { margin-top: 10px; }
.connect__unverified, .connect__refused { margin: 14px 0 0; }

@media (max-width: 980px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth__story { display: none; } }
@media (max-width: 480px) { .auth-form__row { grid-template-columns: minmax(0, 1fr); } .auth .field input:not([type="radio"]) { font-size: max(1rem, var(--fs-body)); } }

/* The free generator's invoice coming along on sign-up (pages/signup.html, GeneratorCarry): a ticked choice, so it
   works without JavaScript and unticking leaves the invoice behind. Design source: docs/mocks/site/payday-signin.html. */
.carry { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper); font-size: var(--fs-sm); color: var(--text-muted); cursor: pointer; }
.carry input { flex: none; margin-top: 3px; accent-color: var(--ink); }
.carry b { display: block; color: var(--ink); font-weight: 600; }
.carry b + span { font-variant-numeric: tabular-nums; }

/* =============================================================================
   Signing up and its code step (pages/signup.html, verify-email.html, fragments/signup-story.html; body.auth--next).
   Design: docs/mocks/site/signup-next.html, docs/SIGNUP_FIRST_RUN_PLAN.md D1-D3, D8. Every control is one height and
   takes the fields' one focus ring; Google leads; the rule shows before anyone types; an error names its fix under its
   field (the shared aria-invalid styling in outer/site.css marks the field).
   ============================================================================= */
.auth--next { --auth-control: 48px; }

/* sign-in is a link in the top bar, not a tab */
.auth__have { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.auth__have a { display: inline-flex; align-items: center; min-height: var(--tap-min); font-weight: 600; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.auth__have a:hover { text-decoration-color: var(--ink); }

.auth--next .auth__body { max-width: 400px; margin-block: 0 auto; padding-block: clamp(40px, 9vh, 88px) var(--space-7); }
.auth--next .auth-intro { margin-bottom: var(--space-6); }
.auth--next .auth-intro h1, .auth__next { text-wrap: balance; }
.auth--next .auth__lead b { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }

.auth--next .field input:not([type="checkbox"]) { height: var(--auth-control); }
.auth--next :is(.btn--primary, .btn-google) { min-height: var(--auth-control); }
.auth--next :is(.btn--primary, .btn-google, .verify__inbox, .verify__link, .auth__have a, .code-change a):focus-visible,
.auth--next :is(.carry, .auth__agreement):has(input:focus-visible) { outline: none; box-shadow: var(--field-focus); border-radius: var(--r-lg); }
.auth--next :is(.auth__agreement, .carry) input:focus-visible { outline: none; }

/* the fastest honest path leads */
#google-signup-start { margin: 0; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: var(--icon-gap-md); width: 100%;
  padding: 0 var(--space-4); border: 1px solid var(--field-border); border-radius: var(--r-lg); background: var(--bg-panel);
  box-shadow: var(--shadow-sm); font: inherit; font-size: var(--fs-body); font-weight: 600; color: var(--ink); cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast); }
.btn-google:hover { border-color: var(--sand-400); background: var(--bg-hover); }
.btn-google:active { transform: translateY(1px); }
.btn-google img { flex: none; width: var(--icon-size-lg); height: var(--icon-size-lg); }
.btn-google[aria-busy="true"] img { display: none; }
.auth__or { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-5) 0 0; font-size: var(--fs-sm); color: var(--caption); }
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth--next .auth-form { gap: var(--space-4); }
.auth--next .auth__or + .auth-form { margin-top: var(--space-5); }
.field__rule, .field__error { display: flex; align-items: flex-start; gap: var(--icon-gap-sm); margin: var(--space-2) 0 0;
  font-size: var(--fs-sm); line-height: 1.45; }
.field__rule { color: var(--text-muted); }
.field__rule[hidden] { display: none; }
.field__error { color: var(--overdue-fg); }
.field__error > .bg-icon { flex: none; margin-top: 1px; }
.field__error a { color: inherit; font-weight: 600; text-underline-offset: 3px; }
/* a hollow mark until the rule is met, then a filled check: it never reads as done before typing */
.rule-mark { display: grid; place-items: center; flex: none; width: var(--icon-size-md); height: var(--icon-size-md); margin-top: 1px;
  border: 1.5px solid var(--sand-400); border-radius: var(--r-pill);
  transition: background var(--duration-normal), border-color var(--duration-normal); }
.rule-mark .bg-icon { color: var(--bg-panel); opacity: 0; transition: opacity var(--duration-normal); }
.field__rule[data-met] { color: var(--text); }
.field__rule[data-met] .rule-mark { border-color: var(--paid-fg); background: var(--paid-fg); }
.field__rule[data-met] .rule-mark .bg-icon { opacity: 1; }

/* D3 A: the required tick directly above the button, a full-height row; missing it is said under it, once */
.auth__tick { display: grid; }
.auth--next .auth__agreement { min-height: var(--tap-min); }
.auth--next .auth__agreement a { font-weight: 500; text-decoration-color: var(--sand-400); }
.auth--next .auth__agreement:has(input[aria-invalid="true"]) { color: var(--overdue-fg); }
.auth__tick .field__error { margin-top: 0; }

.auth--next .auth-form .btn--primary { gap: var(--icon-gap-sm); }

/* what the visitor made, coming along */
.carry--next { align-items: center; gap: var(--space-3); min-height: 56px; margin-bottom: var(--space-5); padding: var(--space-3) var(--space-4);
  border-radius: var(--r-lg); }
.carry--next input { margin: 0; }
.carry__doc { position: relative; flex: none; width: 28px; height: 34px; border-radius: var(--r-xs); background: var(--bg-panel);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.carry__doc::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: var(--r-xs) var(--r-xs) 0 0; background: var(--letterhead); }
.carry__doc::after { content: ""; position: absolute; left: 5px; right: 5px; top: 10px; height: 14px;
  background: repeating-linear-gradient(var(--sand-200) 0 2px, transparent 2px 6px); }
.carry--next span > span { display: block; font-variant-numeric: tabular-nums; }

/* the code step and Google's confirmation, on the same layout */
.auth--next .otp { margin-top: 0; }
.auth--next .verify__actions { margin-top: var(--space-5); }
.auth--next :is(.verify__link, .verify__inbox) { min-height: var(--tap-min); }
.auth--next .verify__trust { margin-top: var(--space-6); color: var(--text-muted); }
.auth--next .verify__trust .bg-icon { color: var(--trust); }
/* the email to look for, as its row in an inbox */
.mail-hint { margin: 0 0 var(--space-5); }
.mail-hint figcaption { margin-bottom: var(--space-2); font-size: var(--fs-sm); color: var(--text-muted); }
.mail-hint__row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-panel); box-shadow: var(--shadow-sm); }
.mail-hint__mark { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--r-pill);
  background: var(--paid-bg); color: var(--paid-fg); }
.mail-hint__text { flex: 1; min-width: 0; font-size: var(--fs-sm); line-height: 1.4; color: var(--text); }
.mail-hint__text b { display: block; font-size: var(--fs-body); color: var(--ink); }
.mail-hint__code { letter-spacing: .12em; color: var(--caption); }
/* right after signup: "You're in", and the business name */
.welcome .verify__seal { width: 56px; height: 56px; margin: 0 0 var(--space-5); border-radius: var(--r-xl); }
.code-change { margin: var(--space-4) 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.code-change a { font-weight: 600; color: var(--trust); text-underline-offset: 3px; }
.g-account { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-panel); }
.g-account > span:nth-child(2) { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--text-muted); overflow-wrap: anywhere; }
.g-account b { display: block; font-size: var(--fs-body); color: var(--ink); }
.g-account img { flex: none; width: var(--icon-size-lg); height: var(--icon-size-lg); }

/* on a phone the story panel is hidden: one line says what happens next, so nobody leaves to find out */
.auth__next { display: none; margin: var(--space-6) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--line);
  font-size: var(--fs-sm); line-height: 1.55; color: var(--text-muted); text-align: center; }
.auth__next b { color: var(--text); font-weight: 600; }

/* the story: a quieter voice than the form, the same top line, the same gutters */
.auth__story--next { align-content: start; gap: var(--space-7); padding: var(--space-7) clamp(28px, 5vw, 72px); }
.auth__story--next .kicker { display: flex; align-items: center; min-height: var(--tap-min); margin: 0; }
.auth__story--next .auth__headline { margin-top: clamp(40px, 9vh, 88px); font-size: clamp(30px, 2.6vw, 38px); letter-spacing: -.03em; }
.next-steps { display: grid; gap: var(--space-3); max-width: 30em; margin: var(--space-6) 0 0; padding: 0; list-style: none; counter-reset: step; }
.next-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: var(--space-3); align-items: start;
  font-size: var(--fs-body); line-height: 1.5; color: var(--sand-200); }
.next-steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 26px; height: 26px;
  border: 1px solid color-mix(in srgb, var(--sand-200) 34%, transparent); border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--sand-50); }
.next-steps b { display: block; font-weight: 600; color: var(--sand-50); }
/* the titles carry it; a description shows only where there is room to breathe (tall windows) */
.next-steps b + span { display: none; }
@media (min-height: 980px) { .next-steps b + span { display: block; } }

.next-stage { position: relative; justify-self: center; width: min(380px, 78%); margin-block: var(--space-2) 128px; }
.next-stage .paper-mini { --paper-mini-width: 300px; --paper-mini-scale: 1.04; box-shadow: var(--shadow-dialog);
  animation: next-rise .8s .15s var(--ease-out) both; }
.next-note { position: absolute; top: -15%; right: -14%; display: flex; align-items: center; gap: var(--icon-gap-md); margin: 0;
  padding: var(--space-2) var(--space-3); border-radius: var(--r-lg); background: var(--bg-panel); box-shadow: var(--shadow-pop);
  font-size: var(--fs-sm); line-height: 1.35; color: var(--text); white-space: nowrap; animation: auth-drop .7s .9s var(--ease-out) both; }
.next-note b { display: block; font-weight: 600; color: var(--ink); }
.next-note > span:last-child > span { display: block; color: var(--text-muted); font-size: var(--fs-xs); }
.next-note__mark { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: var(--r-md);
  background: var(--sent-bg); color: var(--sent-fg); }
/* one project's path over its estimate: the client, the stops passed, where it is now */
.next-project { position: absolute; right: -22%; bottom: -124px; width: 300px; padding: var(--space-3) var(--space-4) var(--space-2);
  border-radius: var(--r-lg); background: var(--bg-panel); box-shadow: var(--shadow-dialog); color: var(--text);
  animation: auth-drop .7s 1.2s var(--ease-out) both; }
.next-project__head { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); font-size: var(--fs-sm); line-height: 1.3; }
.next-project__head b { display: block; color: var(--ink); font-weight: 600; }
.next-project__head > span:last-child > span { color: var(--text-muted); font-size: var(--fs-xs); }
.next-project .progress-path { margin: 0; }
.next-project .pp-meta:empty::before { content: "\00a0"; }
.auth__story--next .auth__trust { align-self: end; }
.auth__trust .trust-more { display: block; }
@keyframes next-rise { from { opacity: 0; transform: translateY(18px); } }

/* dark: keep the seam, keep the paper below the button in brightness */
[data-theme="dark"] .auth__story--next { border-left: 1px solid var(--border); }
[data-theme="dark"] .next-steps li { color: var(--text-muted); }
[data-theme="dark"] .next-steps b { color: var(--ink); }
[data-theme="dark"] .next-steps li::before { border-color: var(--sand-400); color: var(--ink); }
[data-theme="dark"] .next-stage .paper-mini { filter: brightness(.9); }
[data-theme="dark"] :is(.next-note, .next-project) { border: 1px solid var(--border); background: var(--bg-hover); }

@media (prefers-reduced-motion: reduce) { .next-stage .paper-mini, .next-note, .next-project { animation: none; } }

/* compact desktops (short windows, or 981-1180px wide): the story keeps its titles, the paper shrinks */
@media (min-width: 981px) and (max-height: 860px), (min-width: 981px) and (max-width: 1180px) {
  .auth--next .auth__body { padding-top: clamp(28px, 5vh, 48px); }
  .auth__story--next .auth__headline { margin-top: clamp(28px, 5vh, 48px); }
  .auth--next .auth-intro { margin-bottom: var(--space-5); }
  .auth__story--next { gap: var(--space-5); }
  .next-steps { gap: var(--space-2); margin-top: var(--space-4); }
  .next-steps b + span { display: none; }
  .next-stage .paper-mini { --paper-mini-scale: .92; }
  .next-stage { margin-top: var(--space-5); margin-bottom: 124px; }
  .next-note { top: -13%; right: -4%; }
  .next-project { right: -10%; bottom: -126px; }
  .auth__story--next .auth__trust .trust-more { display: none; }
  .auth--next .carry--next { margin-bottom: var(--space-4); }
  .auth--next .auth__or { margin-top: var(--space-4); }
  .auth--next .auth-form { gap: var(--space-3); }
  .auth--next .auth__or + .auth-form { margin-top: var(--space-4); }
}
@media (min-width: 981px) and (max-height: 760px) { .auth__story--next .auth__trust { display: none; } }
@media (max-width: 980px) { .auth--next .auth__next { display: block; } }
@media (max-width: 480px) {
  .auth--next .auth__pane { padding-top: var(--space-5); }
  .auth--next .auth__body { padding-block: var(--space-6) var(--space-5); }
  .auth--next .auth-intro { margin-bottom: var(--space-5); }
  .auth--next .auth__body h1 { font-size: 30px; }
  .auth--next .verify__actions { flex-direction: column; align-items: flex-start; }
}
