/* The signed-out pages (post-EXAM restyle R7c): sign-in, forgot / reset
   password, the console's sign-in and the 413 / 429 / CSRF pages, all on
   auth/standalone_base.html. They load ui.css for its tokens (the unit, the
   eight type roles, Atkinson, the colours; .logo-lockup's size)
   and this file, never main.css: a signed-out page must not lean on the app
   shell. Not body.ui either: ui.css's components sit on main.css's.
   No user, so no text size: Standard always. Sizes are multiples of --u and
   font sizes are the eight roles (tests/test_restyle_gate.py). */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: calc(1.2 * var(--u)) 16px; background: var(--bg); color: var(--text);
  font-family: var(--font-ui); font-size: var(--fs-ui); line-height: 1.4; -webkit-font-smoothing: antialiased; }

.auth-card { width: 100%; max-width: calc(27 * var(--u)); background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-md); padding: calc(2.4 * var(--u)) calc(2.2 * var(--u)); }

.auth-brand { display: flex; align-items: center; gap: calc(.6 * var(--u)); margin-bottom: calc(1.8 * var(--u)); }
.auth .logo-lockup { flex: none; }

.auth-head { margin-bottom: calc(1.4 * var(--u)); }
.auth-head h1 { font-size: var(--fs-page); font-weight: 600; line-height: 1.3; }
.auth-sub { margin-top: calc(.25 * var(--u)); font-size: var(--fs-small); color: var(--text-muted); }

.auth-flash { margin-bottom: calc(1 * var(--u)); padding: calc(.55 * var(--u)) calc(.8 * var(--u)); border-radius: 6px;
  border: 1px solid transparent; font-size: var(--fs-ui); }
.auth-flash.error   { background: var(--red-light);   border-color: var(--red-mid); color: var(--red); }
.auth-flash.info    { background: var(--blue-light);  border-color: var(--blue-mid);  color: var(--blue); }
.auth-flash.success { background: var(--green-light); border-color: var(--green-mid); color: var(--green-dark); }
.auth-flash.warning { background: var(--amber-light); border-color: var(--amber-mid); color: var(--amber); }

/* The sign-in page (Carson, Oct 17): the brand stacked and centred, larger,
   with what MyoTrend is under it; its h1 ("Sign in") for screen readers only,
   as the button says it. */
.auth-login .auth-brand { flex-direction: column; gap: calc(.5 * var(--u)); margin-bottom: calc(2 * var(--u)); text-align: center; }
.auth-login .logo-lockup { height: calc(3 * var(--u)); }
.auth-tagline { font-size: var(--fs-ui); color: var(--text-secondary); letter-spacing: .01em; }
.auth-login .auth-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; margin: 0; }

/* Fields: ui.css's .fl / .f look, a little taller for a page that is one form */
.auth-field { display: grid; gap: calc(.25 * var(--u)); margin-bottom: calc(1 * var(--u));
  font-size: var(--fs-small); color: var(--text-secondary); }
.auth-f { width: 100%; height: calc(2.4 * var(--u)); padding: 0 calc(.6 * var(--u)); border: 1px solid var(--border-mid);
  border-radius: 6px; background: #fff; font: inherit; font-size: var(--fs-input); color: var(--text); }
.auth-f:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.auth-hint { font-size: var(--fs-micro); color: var(--text-muted); }

/* The one button: the page's action, full width (inline on an error page) */
.auth-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%;
  height: calc(2.4 * var(--u)); margin-top: calc(.3 * var(--u)); padding: 0 calc(1.2 * var(--u));
  border: 1px solid var(--brand); border-radius: 6px; background: var(--brand); color: #fff; cursor: pointer;
  font: inherit; font-size: var(--fs-ui); font-weight: 600; text-decoration: none; }
.auth-btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.auth-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.auth-links { margin-top: calc(1.2 * var(--u)); text-align: center; font-size: var(--fs-small); }
.auth-links a { color: var(--brand); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* An error page: centred, its message and one way back */
.auth-center { text-align: center; }
.auth-center .auth-brand { justify-content: center; }
.auth-text { margin-bottom: calc(1.6 * var(--u)); color: var(--text-muted); line-height: 1.5; }
.auth-center .auth-btn { width: auto; }

/* Touch sizes, as ui.css's (screens only) */
@media screen and (pointer: coarse), screen and (max-width: 899.98px) {
  .auth-f, .auth-btn { min-height: 44px; }
}
@media (max-width: 479.98px) {
  .auth-card { padding: calc(1.6 * var(--u)) calc(1.2 * var(--u)); }
}

/* The public sources page (Phase 6 R2-3, reports/sources.html): a reading
   page in the signed-out shell, wider than a form. */
.auth-card.auth-wide { max-width: calc(46 * var(--u)); }
.auth-prose h2 { font-size: var(--fs-ui); margin: calc(1 * var(--u)) 0 calc(.3 * var(--u)); }
.auth-prose p, .auth-prose li { line-height: 1.5; }
.auth-prose ul { padding-left: calc(1.1 * var(--u)); margin: 0; }
.auth-prose li + li { margin-top: calc(.3 * var(--u)); }

/* Phase 7: the Request access form (auth/request_access.html). Two fields a
   row where there's room; the honeypot off screen for people and screen
   readers alike (a bot that fills it gets the thank-you page and no row). */
.auth-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 calc(1 * var(--u)); }
@media (max-width: 479.98px) { .auth-row2 { grid-template-columns: 1fr; } }
.auth-optional { color: var(--text-muted); }
.auth-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.auth-links-tight { margin-top: calc(.4 * var(--u)); }
.auth-text a { color: var(--brand); }
