/* Auth pages — the ledger, opened for signing in.
   Loads after landing.css and uses its tokens, buttons and ruled fields. */

body.au { background: var(--lp-cover); }

.au-wrap {
  position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.5rem; padding: 2.5rem 1.25rem 3rem; color: #f1ead0;
}
/* stitched hem, like the cover of the book */
.au-wrap::before { content: ''; position: absolute; left: 0; right: 0; bottom: 14px; border-bottom: 2px dashed var(--lp-cover-line); }

.au-shell { width: 100%; max-width: 1040px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }

.au-side .lp-brand-logo { height: 76px; }
.au-side h2 { margin-top: 1.75rem; font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1.06; color: #fbf6e2; }
.au-side-lead { margin: 1rem 0 0; font-size: 1.12rem; color: #e6e1cc; max-width: 30rem; }
.au-perks { list-style: none; margin: 1.75rem 0 0; padding: 0; border-top: 1px solid var(--lp-cover-line); max-width: 30rem; }
.au-perks li { display: flex; gap: 0.7rem; padding: 0.6rem 0; border-bottom: 1px solid var(--lp-cover-line); color: #e6e1cc; }
.au-perks svg { flex: 0 0 auto; margin-top: 0.35rem; color: var(--lp-gold); }

.au-sheet.lp-form { padding: 2rem 1.75rem 1.75rem 3.4rem; color: var(--lp-ink); }
.au-sheet h1 { font-size: 1.9rem; line-height: 1.1; margin-bottom: 0.35rem; }
.au-sub { margin: 0 0 1.25rem; color: var(--lp-muted); }

/* ---------- Fields ---------- */
.au-ctl { position: relative; }
.au-ctl input, .au-ctl select { width: 100%; }
.au-label { display: block; font-weight: 700; margin-bottom: 0.45rem; font-size: 0.98rem; }
.au-note { margin: 0.35rem 0 0; font-size: 0.88rem; color: var(--lp-muted); }
.au-note:empty { display: none; }
.au-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }

.au-status { position: absolute; right: 0.15rem; top: 50%; width: 1.15rem; height: 1.15rem; margin-top: -0.6rem; pointer-events: none; }
.lp-field.is-valid .au-status::after { content: ''; position: absolute; left: 0.38rem; top: 0.1rem; width: 0.38rem; height: 0.72rem; border: solid #1f7a45; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.lp-field.is-invalid .au-status::after { content: '!'; position: absolute; inset: 0; display: grid; place-items: center; background: var(--lp-red); color: #fff; border-radius: 50%; font: 700 0.8rem/1 var(--lp-font-sans); }
.lp-field.is-valid .au-ctl input { padding-right: 1.9rem; }
.lp-field.is-invalid .au-ctl input, .lp-field.is-invalid .au-ctl select { border-bottom-color: var(--lp-red); }
.lp-field.is-invalid .au-ctl input { padding-right: 1.9rem; }
.au-pw .au-status { display: none; }

.au-pw input { padding-right: 4.5rem; }
.au-pw button { position: absolute; right: 0; bottom: 0.45rem; background: none; border: 0; color: var(--lp-ink-2); font: 700 0.85rem var(--lp-font-sans); padding: 0.25rem 0.4rem; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
.au-pw button:hover { color: var(--lp-ink); }

/* select: ruled like the inputs, with its own caret */
.au-select select {
  appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-bottom: 2px solid var(--lp-ink); border-radius: 0;
  padding: 0.55rem 1.8rem 0.55rem 0.1rem; font: 1.05rem/1.4 var(--lp-font-sans); color: var(--lp-ink); cursor: pointer; text-overflow: ellipsis;
}
.au-select::after { content: ''; position: absolute; right: 0.3rem; top: 50%; width: 0.5rem; height: 0.5rem; margin-top: -0.4rem; border: solid var(--lp-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }
.au-select select:focus, .au-select select:focus-visible { outline: 0; border-bottom-color: var(--lp-red); box-shadow: 0 3px 0 0 var(--lp-red); background: rgba(201, 48, 59, 0.06); }

.au-msg { min-height: 0; margin: 0; font-size: 0.92rem; line-height: 1.4; }
.au-msg.is-error, .au-msg.is-hint { margin-top: 0.4rem; }
.au-msg.is-error { color: var(--lp-red-dark); font-weight: 600; }
.au-msg.is-hint { color: var(--lp-stamp); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
.au-msg:empty { display: none; }
.au-caps { margin: 0.4rem 0 0; font-size: 0.92rem; font-weight: 700; color: #8a5a00; }
.au-caps[hidden] { display: none; }

.lp-field input::placeholder, .lp-field textarea::placeholder { color: #7a7fa3; opacity: 1; }

.au-check { display: flex; gap: 0.7rem; align-items: flex-start; margin: 0 0 1.4rem; font-size: 0.95rem; color: var(--lp-ink-2); }
.au-check input { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; flex: 0 0 auto; accent-color: var(--lp-red); }
.au-check-soft { font-size: 0.92rem; margin: 0.25rem 0 0; }
.au-check a { color: var(--lp-ink); font-weight: 700; }

.au-submit { width: 100%; }
.au-alt { margin: 1.25rem 0 0; font-size: 0.98rem; color: var(--lp-ink-2); }
.au-alt a { color: var(--lp-ink); font-weight: 700; }
.au-link-btn { display: block; width: 100%; margin-top: 1rem; background: none; border: 0; color: var(--lp-ink); font: 700 0.98rem var(--lp-font-sans); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; padding: 0.5rem; }
.au-link-btn[disabled] { color: var(--lp-muted); text-decoration: none; cursor: default; }

.au-otp { text-align: center; font: 700 2rem/1.2 var(--lp-font-display); letter-spacing: 0.5em; padding-left: 0.5em; }
.au-stamp { display: inline-block; transform: rotate(-4deg); margin-bottom: 1rem; border: 3px solid var(--lp-stamp); color: var(--lp-stamp); border-radius: 4px; padding: 0.15rem 0.7rem; font: 700 0.95rem/1.2 var(--lp-font-display); letter-spacing: 0.14em; text-transform: uppercase; outline: 1px solid var(--lp-stamp); outline-offset: 2px; }

.au-back { position: relative; color: #e6e1cc; font-weight: 600; text-decoration-color: rgba(230, 225, 204, 0.4); }
.au-back:hover { color: #fff; text-decoration-color: var(--lp-gold); }
.au-alert { margin-bottom: 1.25rem; }

/* Buttons: working keeps its colour, locked is pale */
.lp-btn.is-busy { cursor: progress; }
.lp-btn[disabled] { background: #c98c92; border-color: #c98c92; color: #fff; box-shadow: none; opacity: 1; transform: none; }
.lp-btn-ghost[disabled] { background: transparent; color: var(--lp-muted); border-color: var(--lp-rule-strong); }
.lp-btn.is-busy[disabled] { background: var(--lp-red); border-color: var(--lp-red); opacity: 0.85; }

/* ---------- Registration ---------- */
html:not(.js) .au-progress, html:not(.js) [data-back], html:not(.js) [data-next], html:not(.js) .au-for { display: none; }
.js .au-step:not(.is-active) { display: none; }
.au-step { border: 0; margin: 0; padding: 0; min-width: 0; }
.au-legend { padding: 0; font: 700 1.25rem/1.2 var(--lp-font-display); margin-bottom: 1rem; color: var(--lp-ink); }
.au-legend + .au-sub { margin-top: -0.6rem; }
.au-step.is-active { animation: auStepIn 0.3s var(--lp-ease) both; }
@keyframes auStepIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

/* progress: a label row over three ruled segments */
.au-progress { margin: 0.9rem 0 1.4rem; }
.au-progress-top { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--lp-muted); }
.au-progress-top strong { color: var(--lp-ink); font-family: var(--lp-font-display); font-size: 1.02rem; }
.au-segs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.au-segs span { position: relative; height: 5px; background: #cdd1e4; border-radius: 1px; overflow: hidden; }
.au-segs span::after { content: ''; position: absolute; inset: 0; background: var(--lp-ink); transform: scaleX(0); transform-origin: left center; transition: transform 0.4s var(--lp-ease); }
.au-segs span.is-done::after { transform: scaleX(1); }
.au-segs span.is-current::after { transform: scaleX(1); background: var(--lp-red); }

/* team-size pills */
.au-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.au-pill { position: relative; margin: 0; cursor: pointer; }
.au-pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.au-pill span { display: block; text-align: center; padding: 0.55rem 0.2rem; border: 2px solid var(--lp-rule-strong); border-radius: 3px; font-weight: 700; font-size: 0.98rem; color: var(--lp-ink-2); background: var(--lp-page); transition: border-color 0.15s, background 0.15s, color 0.15s; }
.au-pill:hover span { border-color: var(--lp-ink-2); }
.au-pill input:checked + span { background: var(--lp-ink); border-color: var(--lp-ink); color: var(--lp-gold); }
.au-pill input:focus-visible + span { outline: 3px solid var(--lp-stamp); outline-offset: 2px; }

.au-for { margin: -0.4rem 0 1.1rem; font-size: 0.95rem; color: var(--lp-muted); }
.au-for strong { color: var(--lp-ink); }
.au-for a { margin-left: 0.4rem; color: var(--lp-ink); font-weight: 700; }

.au-nav { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.au-nav [hidden] { display: none; }
.au-grow { flex: 1; }
.au-hint { margin: 0.7rem 0 0; font-size: 0.9rem; color: var(--lp-muted); }
.au-hint:empty { display: none; }

/* password: label row with actions, slim meter, requirement chips */
.au-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.3rem; }
.au-label-row label { margin: 0; }
.au-label-actions { display: inline-flex; gap: 0.9rem; }
.au-text-btn { background: none; border: 0; padding: 0; color: var(--lp-stamp); font: 700 0.9rem var(--lp-font-sans); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.au-text-btn:hover { color: var(--lp-ink); }
.au-text-btn[hidden] { display: none; }

.au-meter { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.65rem; }
.au-bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.au-bar { height: 5px; border-radius: 1px; background: #cdd1e4; transition: background 0.25s; }
.au-bar.is-on.s0, .au-bar.is-on.s1 { background: var(--lp-red); }
.au-bar.is-on.s2 { background: #d89b1f; }
.au-bar.is-on.s3 { background: #4f9a5f; }
.au-bar.is-on.s4 { background: #1f7a45; }
.au-strength-label { min-width: 4.8rem; text-align: right; font-weight: 700; font-size: 0.88rem; }
.au-meter[data-score="0"] .au-strength-label, .au-meter[data-score="1"] .au-strength-label { color: var(--lp-red-dark); }
.au-meter[data-score="2"] .au-strength-label { color: #8a5a00; }
.au-meter[data-score="3"] .au-strength-label, .au-meter[data-score="4"] .au-strength-label { color: #1f6b3a; }

.au-chips { list-style: none; margin: 0.55rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.au-chips li { padding: 0.1rem 0.55rem; border: 1px solid #c3c8de; border-radius: 999px; font-size: 0.82rem; font-weight: 600; color: var(--lp-muted); transition: background 0.2s, color 0.2s, border-color 0.2s; }
.au-chips li.is-met { background: #e3f3e6; border-color: #1f7a45; color: #14522e; }

/* consent: one quiet line, no panel */
.au-consent { margin: 1.1rem 0 0; }
.au-consent .au-check { margin: 0; font-size: 0.96rem; color: var(--lp-ink); }
.au-consent.is-invalid .au-check input { outline: 2px solid var(--lp-red); outline-offset: 2px; }

/* ---------- Side panel: what happens next ---------- */
.au-next { list-style: none; counter-reset: au; margin: 1.75rem 0 0; padding: 0; border-top: 1px solid var(--lp-cover-line); max-width: 30rem; }
.au-next li { counter-increment: au; display: grid; grid-template-columns: 2.4rem 1fr; gap: 0 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid var(--lp-cover-line); }
.au-next li::before { content: counter(au); grid-row: span 2; font: 700 1.6rem/1 var(--lp-font-display); color: var(--lp-gold); text-align: center; }
.au-next strong { color: #fbf6e2; }
.au-next span { color: #cfcab4; font-size: 0.95rem; }

@media (max-width: 860px) {
  .au-side .lp-brand-logo { height: 64px; }
  .au-shell { grid-template-columns: 1fr; }
  .au-side h2, .au-perks, .au-side-lead, .au-next { display: none; }
  .au-wrap { justify-content: flex-start; padding-top: 1.75rem; }
}
@media (max-width: 520px) {
  .au-sheet.lp-form { padding: 1.5rem 1.1rem 1.4rem 2.7rem; }
  .au-row { grid-template-columns: 1fr; }
  .au-nav { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .au-step.is-active { animation: none; }
  .au-segs span::after, .au-bar, .au-pill span { transition: none; }
}
