/* Integra — sign-in page. Layout only; primitives come from tokens.css + base.css. */

::selection { background: var(--blurple); color: var(--accent-ink); }

/* Primary CTA — see the note in landing.css. base.css fills .btn-accent with
   --blurple, on which the Paper label measures 4.42:1, under the 4.5:1 AA
   floor for 15px/600 text. --blurple-strong is the light theme's own
   --blurple-text, so no new colour enters the palette: 5.23:1 for the label,
   3.33:1 as a fill on the dark page. Belongs in tokens.css + base.css. */
:root { --blurple-strong: #4E5ADF; }
.btn-accent { background: var(--blurple-strong); border-color: var(--blurple-strong); }

/* Subtle page-load fade — opacity only, gated on motion preference. */
@media (prefers-reduced-motion: no-preference) {
  body { animation: login-page-in 150ms var(--ease); }
  @keyframes login-page-in { from { opacity: 0; } }
}

.login-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
}

/* ---- Left: form column ---- */

.login-pane {
  display: flex;
  flex-direction: column;
  padding: var(--s6) var(--page-pad) var(--s7);
}

/* Mark left, theme toggle at the top right of the form pane. */
.login-pane-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}

.login-brand {
  align-self: flex-start;
  display: inline-block;
  line-height: 0;
}
/* Both themes wear the badged lockup at the same 30px (spec §1: 28–32px), so
   the brand block does not change size or shape when the theme toggles. */
.login-brand img {
  display: block;
  height: 30px;
  width: auto;
}

.login-form-wrap {
  width: 100%;
  max-width: 400px;
  margin: auto 0;
  padding: var(--s8) 0;
}

.login-title {
  font-size: 32px;
  margin-bottom: var(--s6);
}

.field { margin-bottom: var(--s5); }

/* Resting field boundary. base.css leaves inputs on --rule — 1.21:1 on light,
   1.26:1 on dark — and only lifts them to --graphite on :hover, so at rest the
   password box has no boundary that clears the 3:1 minimum for a UI component,
   and on touch, where there is no hover, it never gets one. The resting state
   adopts the value hover already uses: --graphite measures 4.87:1 against
   Paper and 6.63:1 against the dark page. :not(:focus) leaves base.css's
   Blurple focus border and focus-visible ring untouched. */
.login-form-wrap input:not(:focus) { border-color: var(--graphite); }

/* Inline messages — never alert() */
.form-msg {
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 var(--s4);
}
.form-error {
  color: var(--fault-text);
  font-weight: 500;
}
.form-note { color: var(--graphite); }
.form-note .data {
  color: var(--ink);
  font-size: 12px;
}

#submit-btn { width: 100%; }

.mode-toggle {
  display: flex;
  align-items: center;
  min-height: 40px; /* touch-target minimum */
  margin-top: calc(var(--s4) - 10px); /* offset flex centering to keep the 16px optical gap */
  padding: 0;
  border: 0;
  background: none;
  color: var(--blurple-text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}
.mode-toggle:hover { color: var(--blurple-text-hover); }

.login-form-wrap .rule-line { margin: var(--s7) 0 var(--s5); }

.demo-line {
  margin: 0;
  font-size: 14px;
}

/* ---- Right: Ink panel, mark in isolation (centering permitted) ---- */

/* The same dark band the landing page uses, so the Paper mark stays correct in
   both themes. On dark the panel would sit a hair off the form pane, so
   --band-edge puts a --rule hairline on the seam; on light it is transparent
   and the 1px is simply reserved, keeping both columns identical between
   themes. */
.login-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--band-surface);
  border-left: 1px solid var(--band-edge);
}
.login-panel img {
  display: block;
  width: 96px;
  height: 96px;
}

/* Tagline as a closing line — permitted placement (spec §brand). Muted band
   copy rather than --graphite: graphite on Ink reads only 3.36:1 at 12px,
   while band ink at 0.65 gives 7.54:1 light / 6.88:1 dark. */
.panel-tagline {
  position: absolute;
  left: var(--page-pad);
  bottom: var(--s7);
  margin: 0;
  color: var(--band-ink);
  opacity: 0.65;
}

/* Under 900px the split collapses to one column. The Ink panel cannot survive
   as a panel there, but dropping it wholesale left the phone layout ending in
   ~200px of dead space and lost the tagline — the brand's closing line — from
   mobile entirely. It becomes what it is on the landing page: a closing line
   under a hairline. The 96px mark stays hidden (it is a poster at 390px wide);
   `1fr auto` pins the strip to the bottom of short viewports and lets it flow
   after the form on tall content. */
@media (max-width: 899px) {
  .login-split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto;
  }
  .login-panel {
    display: block;
    background: none;
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding: var(--s5) var(--page-pad) var(--s6);
  }
  .login-panel img { display: none; }
  /* Off the band, so it takes the page's own secondary-text colour:
     4.87:1 on Paper, 6.63:1 on the dark page. */
  .panel-tagline {
    position: static;
    color: var(--graphite);
    opacity: 1;
  }
}
