/* ─── Sign-in and sign-up: the hand-off from the landing page into the
   product (docs/plan-public-landing.md, "The phone shell"). Plain CSS on
   the shared tokens in tokens.css; these pages do not load the app's
   Tailwind build (the Docker-time build scans templates only, and the
   public surface must render identically from the offline bundle).

   ≥900px: a two-pane composition — the story pane on ink (brand, the
   harvest still, three trust lines, a link to /welcome) and the form
   card. Below 900px the story pane collapses to a slim header band
   (mark, wordmark, the About link) and the form follows. Dark only.  */

*, *::before, *::after { box-sizing: border-box; }
html {
  height: 100%;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;   /* the controls carry their own press state */
}
::selection { background: rgba(34, 211, 238, 0.28); color: var(--whv-paper); }
body.whv-auth {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--whv-ink-0);
  color: var(--whv-paper);
  font-family: var(--whv-font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: var(--whv-safe-top) var(--whv-safe-right) var(--whv-safe-bottom) var(--whv-safe-left);
}
button, input { font: inherit; color: inherit; margin: 0; }
svg { display: block; max-width: 100%; }
h1, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

/* ─── Shell ─────────────────────────────────────────────────────── */
.whv-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);   /* the band stays slim; the form row takes the height */
  min-height: 100vh;
  min-height: 100dvh;
}
@media (min-width: 900px) {
  .whv-auth-shell {
    grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
    grid-template-rows: minmax(0, 1fr);
  }
}

/* ─── Story pane (desktop) / header band (phone) ────────────────── */
.whv-auth-story {
  position: relative;            /* .whv-grain::after and the glow are absolute */
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--whv-space-5);
  background-color: var(--whv-ink-1);   /* not the shorthand: .whv-ledger paints background-image */
  padding: var(--whv-space-6);
  min-width: 0;
}
.whv-auth-story::before {        /* soft cyan glow rising from the foot of the pane */
  content: '';
  position: absolute;
  left: -20%; right: -20%; bottom: -30%;
  height: 75%;
  background: radial-gradient(closest-side, var(--whv-cyan-glow), transparent 72%);
  opacity: 0.55;
  pointer-events: none;
  z-index: -1;
}
.whv-auth-brand {
  display: flex;
  align-items: center;
  gap: var(--whv-space-3);
  min-width: 0;
}
.whv-auth-mark { color: var(--whv-cyan); flex: none; width: 56px; height: 56px; }
.whv-auth-brand-text { display: grid; gap: 0.125rem; min-width: 0; }
.whv-auth-wordmark {
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: 0.12em;
  line-height: 1.2;
  color: var(--whv-paper);
}
.whv-auth-wordmark svg { display: block; width: auto; height: 1.625rem; }   /* the drawn name (_logo.html) */
.whv-auth-tagline { font-size: 0.75rem; color: var(--whv-paper-3); }
.whv-auth-art {
  width: 100%;
  height: auto;
  max-height: 46vh;
  flex: 1 1 auto;
  min-height: 0;
  margin-block: auto;
}
.whv-auth-headline {
  font-size: var(--whv-step-2);
  color: var(--whv-paper);
  max-width: 16ch;
}
.whv-auth-trust { display: grid; }
.whv-auth-trust li {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--whv-space-2);
  padding: 0.6rem 0;
  border-top: 1px solid var(--whv-line);
  font-size: 0.9375rem;
  color: var(--whv-paper-2);
  overflow-wrap: anywhere;
}
.whv-auth-trust li:last-child { border-bottom: 1px solid var(--whv-line); }
.whv-auth-trust strong { color: var(--whv-paper); font-weight: 600; }
.whv-auth-about {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--whv-tap);
  align-self: flex-start;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 899.98px) {
  .whv-auth-story {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--whv-space-3);
    min-height: var(--whv-nav-h);
    padding: var(--whv-space-2) var(--whv-space-4);
    border-bottom: 1px solid var(--whv-line);
    background-image: none;      /* no ledger rules through a 56px band */
  }
  .whv-auth-story::before,
  .whv-auth-art,
  .whv-auth-headline,
  .whv-auth-trust,
  .whv-auth-tagline { display: none; }
  .whv-auth-mark { width: 32px; height: 32px; }
  .whv-auth-wordmark { font-size: 0.9375rem; }
  .whv-auth-wordmark svg { height: 1.25rem; }
  .whv-auth-about { align-self: center; }
}

/* ─── Form pane ─────────────────────────────────────────────────── */
.whv-auth-pane {
  display: grid;
  justify-items: center;
  align-content: start;          /* phone: the form comes right after the band */
  padding: var(--whv-space-6) var(--whv-space-4) var(--whv-space-7);
  min-width: 0;
}
@media (min-width: 900px) {
  .whv-auth-pane {
    align-content: center;
    padding: var(--whv-space-7) var(--whv-space-6);
  }
}
.whv-auth-card {
  width: 100%;
  max-width: 26rem;
  min-width: 0;
  padding: clamp(1.25rem, 5vw, 2rem);
  display: grid;
  gap: var(--whv-space-4);
}
.whv-auth-title { font-size: var(--whv-step-2); color: var(--whv-paper); }
.whv-auth-form { display: grid; gap: var(--whv-space-4); }
.whv-auth-submit { width: 100%; margin-top: var(--whv-space-1); }
.whv-auth-sso { width: 100%; }
.whv-auth-divider {
  display: flex;
  align-items: center;
  gap: var(--whv-space-3);
  font-family: var(--whv-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--whv-paper-3);
}
.whv-auth-divider::before, .whv-auth-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--whv-line);
}
.whv-auth-alt { font-size: 0.875rem; color: var(--whv-paper-3); text-align: center; }
/* The interface language switch under the card's form
   (docs/plan-arabic-interface.md): a link-looking 44px button. */
.whv-auth-lang { display: flex; justify-content: center; margin-top: var(--whv-space-2); }
.whv-auth-lang-btn {
  min-height: var(--whv-tap); padding: 0 0.75rem; background: none; border: 0;
  font-size: 0.875rem; cursor: pointer; touch-action: manipulation;
}

/* Password field with the show / hide toggle sitting inside the input's
   box: a 44px target, label constant, state in aria-pressed. */
.whv-auth-secret { position: relative; display: grid; min-width: 0; }
.whv-auth-secret .whv-input { padding-right: 4.5rem; }
.whv-auth-reveal {
  position: absolute;
  top: 0; right: 0.25rem; bottom: 0;
  min-height: var(--whv-tap);
  min-width: var(--whv-tap);
  padding: 0 0.75rem;
  background: transparent;
  border: 0;
  border-radius: var(--whv-radius-s);
  color: var(--whv-paper-3);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: color var(--whv-dur-fast), transform var(--whv-dur-fast) var(--whv-ease-out);
}
@media (hover: hover) and (pointer: fine) {   /* a tap must not leave the label lit */
  .whv-auth-reveal:hover { color: var(--whv-paper); }
}
.whv-auth-reveal:active { color: var(--whv-paper); transform: scale(0.96); }
.whv-auth-reveal[aria-pressed="true"] { color: var(--whv-cyan); }
.whv-auth-reveal:focus-visible { outline: none; box-shadow: var(--whv-focus-ring); }
.whv-input:focus-visible { outline: none; }
.whv-auth-card .whv-input { caret-color: var(--whv-cyan); }
.whv-auth-card .whv-btn, .whv-auth-card .whv-link { touch-action: manipulation; }
.whv-auth-card .whv-btn { user-select: none; -webkit-user-select: none; }

/* Submitting: the button acknowledges the press and a second tap does
   nothing (auth.js sets aria-busy on the form; the button is NOT
   disabled, which would drop it from the submission). */
.whv-auth-form[aria-busy="true"] .whv-auth-submit { opacity: 0.7; cursor: progress; }
.whv-auth-form[aria-busy="true"] .whv-auth-submit:hover { box-shadow: none; }

/* The sign-out confirmation: the question in body type, the two actions
   side by side on a desktop and stacked on a phone, the primary first. */
.whv-auth-question { font-size: var(--whv-step-0); color: var(--whv-paper); line-height: 1.45; }
.whv-auth-who { color: var(--whv-paper); font-weight: 600; font-family: var(--whv-font-mono); font-size: 0.8125rem; }
.whv-auth-actions { display: grid; gap: var(--whv-space-3); margin-top: var(--whv-space-1); }
.whv-auth-actions .whv-auth-submit { margin-top: 0; }
@media (min-width: 480px) {
  .whv-auth-actions { grid-template-columns: 1fr 1fr; }
}

/* Chrome autofill paints a pale box over the ink input; keep it dark. */
.whv-input:-webkit-autofill,
.whv-input:-webkit-autofill:hover,
.whv-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--whv-ink-1) inset;
  -webkit-text-fill-color: var(--whv-paper);
  caret-color: var(--whv-paper);
  transition: background-color 9999s ease-out 0s;
}
