/* ============================================================================
   05 · Auth (desktop) and 06 · Auth (mobile) — one stylesheet, one layout.
   ============================================================================

   Section 05 is a 520px brand panel beside a form column; section 06 is the
   same form under a top bar. They are the same screens at two widths, so the
   brand panel and the top bar are two renderings of one element: whichever
   fits is shown.
   ========================================================================== */

.auth-body { min-height: 100vh; }

.auth { display: grid; grid-template-columns: 520px 1fr; min-height: 100vh; }

/* ------------------------------------------------------------ brand panel */

.auth__brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-2xl);
  padding: 48px;
  color: #fff;
  background: linear-gradient(128deg, var(--wash-top) 0%, var(--wash-deep) 71%);
}

.auth__logo {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #fff;
  text-decoration: none;
}

.auth__quote { margin: 0; }
.auth__quote-text { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.auth__quote-by { margin-top: var(--space-md); font-size: var(--text-body-md); color: var(--on-media-dim); }
.auth__where { margin: 0; font-size: var(--text-body-sm); color: var(--on-media-dim); }

/* The phone's version of the same thing. */
.auth__top { display: none; align-items: center; gap: var(--space-sm); height: 56px; padding-inline: var(--space-md); border-bottom: 1px solid var(--stroke); }
.auth__back { font-size: 28px; line-height: 1; color: var(--ink); text-decoration: none; }
.auth__top-name { font-size: var(--text-body-md); font-weight: 600; }

/* ------------------------------------------------------------ form column */

.auth__side { display: grid; place-items: center; padding: var(--space-2xl); }
.auth__form { width: min(400px, 100%); }
.auth__pane { display: flex; flex-direction: column; gap: var(--space-md); }
.auth__pane--wide { width: min(520px, 100%); }
.auth__form:has(.auth__pane--wide:not([hidden])) { width: min(520px, 100%); }

.auth__head { display: flex; flex-direction: column; gap: 4px; }
.auth__title { margin: 0; font-size: clamp(26px, 4vw, 32px); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.auth__sub { margin: 0; font-size: var(--text-body-md); line-height: 1.6; color: var(--ink-mute); }

.auth__btn { width: 100%; }
.auth__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.auth__link { font-size: var(--text-label-md); font-weight: 600; color: var(--ink); text-decoration: none; }
.auth__link:hover { text-decoration: underline; }

.auth__or { display: flex; align-items: center; gap: var(--space-sm); }
.auth__or::before, .auth__or::after { content: ""; flex: 1 1 0; height: 1px; background: var(--stroke); }
.auth__or span { font-size: 12px; font-weight: 500; letter-spacing: 0.1em; color: var(--ink-faint); }

.auth__foot { margin: 0; text-align: center; font-size: var(--text-body-sm); color: var(--ink-mute); }
.auth__foot a { margin-left: 4px; font-size: var(--text-label-md); font-weight: 600; color: var(--ink); text-decoration: none; }
.auth__foot a:hover { text-decoration: underline; }

.auth__timer { display: flex; justify-content: space-between; margin: 0; font-size: var(--text-body-sm); color: var(--ink-mute); }
.mono { font-family: var(--font-mono); font-size: var(--text-mono-sm); color: var(--ink); }

/* The 64px status disc A7, A10, A12 and A13 open with. */
.auth__mark { display: block; width: 64px; height: 64px; border-radius: 50%; }
.auth__mark--info   { background: var(--status-info-bg); }
.auth__mark--ok     { background: var(--status-ok-bg); }
.auth__mark--warn   { background: var(--status-warn-bg); }
.auth__mark--danger { background: var(--status-danger-bg); }

/* One line, not in the Figma, that keeps the screen from passing for a lock. */
.auth__demo {
  margin: var(--space-xl) 0 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-body-sm);
  line-height: 1.55;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------------ parts */

.field__err { font-size: var(--text-body-sm); line-height: 1.55; color: var(--status-danger-fg); }
.field__input.is-bad { border-color: var(--border-error); border-width: 2px; }
.field__input.is-bad + .field__hint { display: none; }

.check { display: flex; align-items: center; gap: var(--space-sm); min-height: var(--control-md); font-size: var(--text-body-md); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.check--block { align-items: flex-start; line-height: 1.6; }
.check--block input { margin-top: 2px; }
.check a { color: var(--accent); }

/* A5 and A11 are the same control: a bordered row that is entirely clickable. */
.pick {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.pick:hover { border-color: var(--stroke-strong); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick__ring { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; background: var(--control); border: 1px solid var(--stroke-strong); border-radius: 50%; }
.pick input:checked ~ .pick__ring { background: radial-gradient(circle, var(--ink-inverse) 0 3.5px, transparent 4px), var(--accent); border-color: var(--accent); }
.pick:has(input:checked) { background: var(--accent-subtle); border-color: var(--accent); border-width: 2px; padding: calc(var(--space-md) - 1px); }
.pick:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.pick__text { display: flex; flex-direction: column; gap: 2px; }
.pick__title { font-size: var(--text-body-md); font-weight: 600; }
.pick__sub { font-size: var(--text-body-sm); color: var(--ink-mute); }

/* OTP: six boxes drawn over one real input, so password managers and the
   Android SMS autofill still see a single field to fill. */
.otp { position: relative; }
.otp__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 60px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 34px;
  letter-spacing: 42px;
  text-indent: 18px;
  color: transparent;
  background: none;
  border: 0;
  caret-color: transparent;
  outline: none;
}
.otp__boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-xs); max-width: 352px; pointer-events: none; }
.otp__box {
  display: grid;
  place-items: center;
  height: 60px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.015em;
  background: var(--control);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
}
.otp__input:focus ~ .otp__boxes .otp__box.is-next {
  border-color: var(--focus-ring);
  border-width: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 55%, transparent);
}
/* The component's note: error colours the digits too, because a red outline
   alone is easy to miss on a cracked or sunlit phone. */
.otp--bad .otp__box { color: var(--status-danger-fg); border-color: var(--border-error); border-width: 2px; }

.strength { display: flex; gap: 4px; }
.strength span { flex: 1 1 0; height: 4px; background: var(--stroke); border-radius: 2px; }
.strength span.is-on { background: var(--status-ok-fg); }

.rules { margin: 0; padding: 0; list-style: none; }
.rules li { display: flex; gap: var(--space-xs); padding: 2px 0; font-size: var(--text-body-sm); color: var(--ink-mute); }
.rules li::before { content: "✓"; color: var(--stroke-strong); font-weight: 700; }
.rules li.is-met { color: var(--ink-dim); }
.rules li.is-met::before { color: var(--status-ok-fg); }

.who { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-sm); background: var(--control-subtle); border-radius: var(--radius-md); }
.who__name { margin: 0; font-size: var(--text-body-md); font-weight: 600; }
.who__sub { margin: 2px 0 0; font-size: var(--text-body-sm); color: var(--ink-mute); }

.reason { padding: var(--space-sm) var(--space-md); background: var(--control-subtle); border-radius: var(--radius-md); }
.reason .overline { margin-bottom: 4px; font-size: var(--text-overline); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.reason__what { margin: 0; font-size: var(--text-body-md); line-height: 1.6; }
.reason__ref { margin: 4px 0 0; font-family: var(--font-mono); font-size: var(--text-mono-sm); color: var(--ink-faint); }

.alert { display: flex; gap: var(--space-sm); padding: var(--space-md); border: 1px solid; border-radius: var(--radius-md); }
.alert__dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; }
.alert__title { margin: 0; font-size: var(--text-body-md); font-weight: 600; line-height: 1.6; }
.alert__body { margin: 4px 0 0; font-size: var(--text-body-sm); line-height: 1.55; color: var(--ink-dim); }
.alert--info   { background: var(--status-info-bg);   border-color: var(--status-info-border); }
.alert--info   .alert__dot { background: var(--status-info-fg); }
.alert--info   .alert__title { color: var(--status-info-fg); }
.alert--ok     { background: var(--status-ok-bg);     border-color: var(--status-ok-border); }
.alert--ok     .alert__dot { background: var(--status-ok-fg); }
.alert--ok     .alert__title { color: var(--status-ok-fg); }
.alert--warn   { background: var(--status-warn-bg);   border-color: var(--status-warn-border); }
.alert--warn   .alert__dot { background: var(--status-warn-fg); }
.alert--warn   .alert__title { color: var(--status-warn-fg); }
.alert--danger { background: var(--status-danger-bg); border-color: var(--status-danger-border); }
.alert--danger .alert__dot { background: var(--status-danger-fg); }
.alert--danger .alert__title { color: var(--status-danger-fg); }

/* ------------------------------------------------------------ 06 · mobile */

/* Section 06 is this, narrow: the brand panel goes, the top bar arrives, and
   the form fills the width. Nothing else about the screens changes. */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .auth__top { display: flex; }
  .auth__side { place-items: start center; padding: var(--space-lg) var(--space-md) 48px; }
  .auth__form, .auth__pane--wide, .auth__form:has(.auth__pane--wide:not([hidden])) { width: 100%; }
  .auth__title { font-size: 26px; }
  /* Six 52px boxes plus their gaps come to 352px, which still fits a 390px
     screen with the 16px gutters — so the field is the same at both widths,
     as the component's note asks. */
  .otp__boxes { max-width: none; }
}

/* The form column is a centring grid, so the toggle is pinned to the corner
   rather than stacked above the form. */
.auth__side { position: relative; }
.auth__lang {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  background: var(--bg);
}
@media (max-width: 860px) {
  .auth__lang { top: var(--space-sm); right: var(--space-md); }
}
