/* ldu/pages-auth.css: sign in, sign up and the password pages (layouts/landing) in the landing's look. Layout only, tokens only.
   Mobile first: on a phone the form alone (Milan, 20 Oct: no slides there); from 1024 px the form on the left half and the slides pinned on the
   right half. It borrows the landing's pieces from ldu/pages-marketing.css: the logo, the CTA (.mk-go) and the fibres. */

.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto auto; }

/* ── the form side, paper ────────────────────────────────────── */
.auth__main { display: flex; flex-direction: column; padding: 8px 16px 48px; }
.auth__main > * { width: 100%; max-width: 440px; margin-inline: auto; }
.auth__bar { display: flex; align-items: center; height: 56px; }
.auth__form { display: flex; flex-direction: column; padding-top: 16px; }
.auth__form > .ldu-alert, [data-testid="app-download"] > .ldu-alert { margin-bottom: 24px; }

.auth__title { margin: 0; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 32px; line-height: 40px; letter-spacing: -0.02em; text-wrap: balance; }
.auth__lede { margin: 8px 0 0; color: var(--ink-2); font-size: 16px; line-height: 24px; text-wrap: pretty; }
.auth__links { margin: 24px 0 0; color: var(--ink-2); font-size: 16px; line-height: 24px; }

/* Email | QR code (Guard): the landing's two-way toggle (.mk-seg), the picked option in ink; the ink thumb slides across with the landing's spring.
   Two radios, so arrows and Tab work natively. CSS :has shows the picked tab's half; the QR half asks for its code only while it shows. */
.auth-switch { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-self: flex-start; margin: 24px 0 0; padding: 4px; min-width: 0;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg-2); }
.auth-switch__opt { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 120px; min-height: 36px; padding: 0 16px;
  border-radius: 999px; color: var(--ink-2); font-size: 16px; line-height: 24px; cursor: pointer; transition: color 280ms var(--mk-ease); }
.auth-switch__opt:hover { color: var(--ink); }
.auth-switch__opt:has(:checked) { color: var(--bg); }
.auth-switch__opt:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.auth-switch__opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.auth-switch__thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--ink);
  transition: translate 520ms var(--mk-spring); }
.auth-switch:has(.auth-switch__opt:last-of-type :checked) .auth-switch__thumb { translate: 100% 0; }
.auth-with { display: flex; flex-direction: column; }
.auth-with:has([value=qr]:checked) .auth-with__email, .auth-with:not(:has([value=qr]:checked)) .auth-with__qr { display: none; }
.auth-with__qr { margin-top: 32px; }
.auth-qr { width: 240px; aspect-ratio: 1; padding: 14px; border: 1px solid var(--line-2); border-radius: 16px; background: #fff; }
.auth-qr svg { display: block; width: 100%; height: auto; }

/* the form: DS fields at the CTA's height, 16 px so a phone does not zoom in */
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 32px; }
.auth-form .field__label { font-size: 14px; line-height: 20px; color: var(--ink); }
.auth-form .input { height: 44px; padding: 0 12px; font-size: 16px; }
.auth-form__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-size: 16px; line-height: 24px; }
.auth-form__remember { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.auth-form__remember label { cursor: pointer; }
.auth-form__remember .check { cursor: pointer; }
.auth__go { width: 100%; margin-top: 8px; }
.auth__or { margin: 12px 0 0; }
.auth__or .auth__go { margin-top: 0; }

/* sign-up, no side chosen: the two accounts as cards. Hover is the site's card hover (the fill shades, the border goes ink; Milan, 13 Nov:
   never an accent edge), then the icon fills and the arrow nudges */
.auth__pick { display: grid; gap: 12px; margin-top: 32px; }
.auth__card { display: flex; align-items: center; gap: 16px; min-height: 88px; padding: 16px 20px; border: 1px solid var(--line-2); border-radius: 16px;
  background: var(--bg-2); color: var(--ink); text-decoration: none; cursor: pointer;
  transition: border-color 280ms var(--mk-ease), background-color 280ms var(--mk-ease); }
.auth__card:hover, .auth__card:focus-visible { background: var(--ldu-raise); border-color: var(--ink-2); text-decoration: none; } /* the card hover (components.css): no accent edge or glow */
.auth__card:focus-visible { outline: var(--ring-w) solid var(--ring); outline-offset: var(--ring-offset); }
.auth__card-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent);
  transition: background-color 280ms var(--mk-ease), color 280ms var(--mk-ease); }
.auth__card:hover .auth__card-icon, .auth__card:focus-visible .auth__card-icon { background: var(--accent); color: var(--accent-ink); }
.auth__card-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; color: var(--ink-2); font-size: 16px; line-height: 24px; }
.auth__card-text strong { color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 24px; }
.auth__card-arrow { display: grid; flex: none; color: var(--ink-2); transition: translate 280ms var(--mk-ease), color 280ms var(--mk-ease); }
.auth__card:hover .auth__card-arrow, .auth__card:focus-visible .auth__card-arrow { translate: 4px 0; color: var(--accent); }

/* ── the slides side, ink ────────────────────────────────────── */
.auth__show { --mk-grey: color-mix(in oklab, var(--bg) 74%, var(--ink)); --auth-plate: color-mix(in oklab, var(--bg) 95%, var(--ink));
  position: relative; isolation: isolate; overflow: hidden; display: none; place-items: center; padding: 56px 16px 112px; color: var(--ink);
  background:
    radial-gradient(50% 40% at 50% 100%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg) 20%, color-mix(in oklab, var(--bg) 90%, var(--ink))); }
/* the landing's fibres, in the empty band under the slides, never behind the text */
.auth__fibres { inset: auto 0 0 0; width: 100%; height: 88px; z-index: -1; color: var(--accent); opacity: 0.2; }
.auth__show-in { width: 100%; max-width: 480px; }

.auth__slides { display: grid; touch-action: pan-y; }
.auth__slide { grid-area: 1 / 1; display: flex; flex-direction: column; min-width: 0; opacity: 0; visibility: hidden; translate: var(--auth-from, 32px) 0;
  transition: opacity 360ms var(--mk-ease), translate 640ms var(--mk-ease), visibility 0s linear 640ms; }
.auth__slide.is-on { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 120ms, 120ms, 0s; }
.auth__slide.is-leaving { translate: calc(var(--auth-from, 32px) * -1) 0; }

/* the pictures (devise/shared/_auth_art): each is drawn straight on its plate, which is the one frame (Milan, 11 Nov: "inside a container like how we
   had it before"; no card inside it: one frame only). The parts are the landing hero's own (.mk-hand__head, its messages, input and inset row, in
   pages-marketing.css), so only what the landing does not have is drawn here: the stage rows, the draft's lines, the score. The accent is spent on
   one thing a picture: where the work is now, or the person who signed. One plate height and the picture fills it, so the title never moves.
   .auth__show in front: .mk-page figure (the landing's reset) outranks a single class */
.auth__show .auth__art { display: grid; height: 320px; margin: 0 0 32px; padding: 24px; border: 1px solid var(--line-2); border-radius: 16px; background: color-mix(in oklab, var(--bg-2) 82%, transparent); }
.auth-pic { --auth-rail: color-mix(in oklab, var(--ink) 14%, transparent); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* :where, so the landing's own margins and paddings on these parts still win */
:where(.auth-pic) :where(p, ul) { margin: 0; padding: 0; list-style: none; }
/* the talk sits on the input, as in a chat: what is left over is above it */
.auth-pic .mk-hand__msgs { flex: 1; justify-content: flex-end; }
.auth-pic .mk-face img { object-position: 50% 16%; }
.auth-pic .mk-hand__job { border-radius: 12px; }
.auth-pic__ok { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 14px; line-height: 20px; font-weight: 600; }
.auth-pic__eg { margin-left: auto; color: var(--ink-2); font-size: 12px; line-height: 16px; }
/* settling in: a part rises into place a beat after its slide comes on, in order (--d) */
.auth-pic .auth-pic__pop { transition: opacity 480ms var(--mk-ease) calc(320ms + var(--d, 0) * 200ms), translate 560ms var(--mk-spring) calc(320ms + var(--d, 0) * 200ms); }
.auth__slide:not(.is-on) .auth-pic .auth-pic__pop { opacity: 0; translate: 0 12px; }

/* your work: a row a piece, its name, its stage, and a rail filled as far as it has come, one piece at each of the four stages. The one in review carries the accent
   and the face of who has it */
.auth-board { display: flex; flex-direction: column; flex: 1; justify-content: space-between; }
.auth-board__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink-2);
  font-size: 14px; line-height: 20px; }
.auth-board__row:last-child { padding-bottom: 0; }
.auth-board__row strong { overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.auth-board__stage { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.auth-board__row.is-now .auth-board__stage { color: var(--accent); font-weight: 600; }
.auth-board__track { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.auth-board__track i { height: 4px; border-radius: 4px; background: var(--auth-rail); }
.auth-board__track .is-on::after { content: ""; display: block; height: 100%; border-radius: inherit; background: var(--ink); transform-origin: 0 50%;
  transition: scale 480ms var(--mk-ease) calc(400ms + var(--i) * 160ms + var(--n) * 120ms); }
.auth-board__row.is-now .is-at::after { background: var(--accent); }
.auth__slide:not(.is-on) .auth-board__track .is-on::after { scale: 0 1; }

/* the AI's draft: its lines write themselves, then the person signs */
.auth-draft { display: grid; flex: 1; align-content: space-between; }
.auth-draft i { width: var(--w); height: 8px; border-radius: 999px; background: var(--auth-rail); transform-origin: 0 50%; transition: scale 480ms var(--mk-ease) calc(320ms + var(--i) * 100ms); }
.auth__slide:not(.is-on) .auth-draft i { scale: 0 1; }

/* a checked document: the score out of 100 in the display face, what it means, and a gauge that fills as far as the score */
.auth-check { display: grid; flex: 1; align-content: center; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 16px; }
.auth-check__n { display: flex; align-items: baseline; gap: 4px; color: var(--ink-2); font-size: 14px; line-height: 20px; }
.auth-check__n strong { color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 40px; line-height: 48px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.auth-check__v { display: flex; flex-direction: column; min-width: 0; color: var(--ink-2); font-size: 14px; line-height: 20px; }
.auth-check__v strong { color: var(--ink); font-size: 16px; line-height: 24px; font-weight: 600; }
.auth-check__gauge { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 4px; }
.auth-check__gauge i { height: 8px; border-radius: 2px; background: var(--auth-rail); transition: background-color 240ms var(--mk-ease) calc(400ms + var(--i) * 32ms); }
.auth-check__gauge .is-on { background: var(--ink); }
.auth__slide:not(.is-on) .auth-check__gauge .is-on { background: var(--auth-rail); }
.auth-check__fix { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }

.auth__slide-title { margin: 0; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 36px; letter-spacing: -0.01em; text-wrap: balance; }
.auth__slide-text { margin: 8px 0 0; color: var(--ink-2); font-size: 16px; line-height: 24px; max-width: 44ch; text-wrap: pretty; }

/* the dots (the active one fills over 6 s, then the next slide comes) and the pause button */
.auth__nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; }
.auth__dots { display: flex; gap: 8px; }
.auth__dot { position: relative; width: 24px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; transition: width 360ms var(--mk-ease); }
.auth__dot::before, .auth__dot-fill { content: ""; position: absolute; left: 0; right: 0; top: 20px; height: 4px; border-radius: 4px; }
.auth__dot::before { background: var(--ink-3); transition: background-color 200ms var(--mk-ease); }
.auth__dot:hover::before { background: var(--ink-2); }
.auth__dot.is-on { width: 48px; }
.auth__dot-fill { background: var(--ink); scale: 0 1; transform-origin: 0 50%; }
.auth__dot.is-on .auth__dot-fill { animation: auth-fill 6s linear forwards; }
.auth__show:is(.is-held, .is-stopped, .is-hidden) .auth__dot.is-on .auth__dot-fill { animation-play-state: paused; }
.auth__dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@keyframes auth-fill { from { scale: 0 1; } to { scale: 1 1; } }

.auth__pause { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line-2); border-radius: 999px; background: transparent;
  color: var(--ink-2); cursor: pointer; transition: background-color 200ms var(--mk-ease), color 200ms var(--mk-ease), border-color 200ms var(--mk-ease); }
.auth__pause:hover { background: var(--auth-plate); border-color: var(--ink-3); color: var(--ink); }
.auth__pause-off, .is-stopped .auth__pause-on { display: none; }
.is-stopped .auth__pause-off { display: block; }

/* reduced motion: nothing moves by itself, so there is nothing to pause; the dots still change the slide, without the slide-in */
.auth__show.is-still .auth__pause { display: none; }
.auth__show.is-still .auth__dot.is-on .auth__dot-fill { animation: none; scale: 1 1; }
@media (prefers-reduced-motion: reduce) {
  .auth__slide, .auth__slide.is-on, .auth__dot, .auth__card, .auth__card-icon, .auth__card-arrow, .auth-switch__thumb, .auth-pic .auth-pic__pop, .auth-board__track .is-on::after, .auth-draft i, .auth-check__gauge i { transition: none; }
  .auth__slide, .auth__slide.is-leaving { translate: 0 0; }
  .auth__dot.is-on .auth__dot-fill { animation: none; scale: 1 1; }
}

/* ── wide: the form on the left half, the slides pinned on the right half ── */
@media (min-width: 1024px) {
  .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: none; }
  .auth--solo { grid-template-columns: minmax(0, 1fr); }
  .auth__main { padding: 16px 48px 48px; }
  .auth__bar { height: 64px; }
  .auth__form { flex: 1; justify-content: center; padding-top: 0; padding-bottom: 64px; }
  .auth__title { font-size: 40px; line-height: 48px; }
  .auth__fibres { height: 22%; }
  .auth__show { display: grid; position: sticky; top: 0; height: 100vh; height: 100dvh; min-height: 640px; padding: 48px; }
}

/* a one-question page ("Stop these emails", its Done and its dead link): the title at one fixed height, so it does not jump after the button */
@media (min-width: 1024px) { .auth--one .auth__form { justify-content: flex-start; padding-top: 18vh; } }

/* Set your password (devise/passwords/edit): Show / Hide inside the password field, the field padded so typing never runs under it */
.auth-reveal { position: relative; }
.auth-reveal .input { width: 100%; padding-right: 76px; }
.auth-reveal__toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); height: 36px; min-width: 64px; }
.auth-form .input[readonly] { color: var(--ink-2); }
