/* The sign-in card: Sign in, Create an account, and the not-found and administrators-only pages - the
   cinematic backdrop, the card, its form and the form's answers. Loads after tokens.css and site.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--bone); font-family: var(--f-body); font-size: var(--t-body); line-height: 1.7; min-height: 100vh; }
h1 { margin: 0; font-weight: 400; line-height: 1.08; }
p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 4px; }
/* ============ Cinematic background ============ */
.auth-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.auth-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; filter: var(--grade); }
.auth-bg::after { content: ""; position: absolute; inset: 0; background: var(--grain-dark), radial-gradient(ellipse 90% 80% at 50% 36%, rgba(11,10,9,.5), rgba(11,10,9,.84) 100%); }
/* ============ Auth card ============ */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: calc(var(--header-h) + var(--s3)) var(--gutter) var(--s5); }
.auth-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border-hi); border-radius: 16px; padding: var(--s4) clamp(24px, 5vw, 40px); box-shadow: 0 40px 90px -30px rgba(0,0,0,.7); text-align: center; }
.auth-crest { width: 54px; height: 54px; margin: 0 auto 18px; }
.auth-card h1 { font-family: var(--f-hero); font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem); color: var(--bone); }
.auth-sub { margin-top: 10px; color: var(--muted); font-size: 1.0625rem; line-height: 1.5; }
/* ============ Form ============ */
.auth-form { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s4); text-align: left; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-family: var(--f-title); font-size: var(--t-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.input-wrap { position: relative; display: flex; }
.input { width: 100%; min-height: 50px; padding: 0 14px; font-family: var(--f-body); font-size: 1.0625rem; color: var(--bone); background-color: var(--field); background-image: var(--field-grain); background-size: 180px 180px; background-repeat: repeat; border: 1px solid var(--border-hi); border-radius: 3px; box-shadow: inset 0 2px 4px rgba(74,54,22,.16); transition: border-color var(--dur-s) var(--ease-out), box-shadow var(--dur-s) var(--ease-out); }
.input::placeholder { color: var(--faint); font-style: italic; }
.input:focus { outline: none; border-color: var(--gilt); box-shadow: inset 0 2px 4px rgba(74,54,22,.16), inset 0 0 0 1px var(--gilt); }
.input.has-toggle { padding-right: 50px; }
.pw-toggle { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer; }
@media (hover: hover) {
  .pw-toggle:hover { color: var(--bone); }
}
.pw-toggle svg { width: 20px; height: 20px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.remember { display: flex; align-items: center; gap: 10px; font-size: var(--t-sm); color: var(--muted); cursor: pointer; }
.remember input { width: 17px; height: 17px; accent-color: var(--btn-red); flex: none; }
/* Create an account: the password strength bar, the confirm match and the rules box */
/* password strength bar */
.pw-strength { margin-top: 10px; display: flex; align-items: center; gap: 12px; }
.pw-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-raised); border: 1px solid var(--border); overflow: hidden; }
.pw-bar span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width var(--dur-m) var(--ease-out), background var(--dur-s) var(--ease-out); }
.pw-label { font-family: var(--f-title); font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); min-width: 56px; text-align: right; }
.pw-hint { margin-top: 7px; font-size: var(--t-xs); color: var(--faint); min-height: 1em; }
.mismatch { font-size: var(--t-xs); color: var(--btn-red); min-height: 1em; }
[data-theme="dark"] .mismatch { color: #e0897f; }
/* agree checkbox */
.agree { display: flex; align-items: flex-start; gap: 11px; font-size: var(--t-sm); color: var(--muted); line-height: 1.45; cursor: pointer; }
.agree input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--btn-red); flex: none; }
.agree a { color: var(--bone); text-decoration: underline; text-underline-offset: 2px; }
.textlink { font-family: var(--f-title); font-size: var(--t-sm); font-weight: 600; letter-spacing: .02em; color: var(--bone); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-hi); transition: text-decoration-color var(--dur-s) var(--ease-out); }
@media (hover: hover) {
  .textlink:hover { text-decoration-color: var(--gold-hi); }
}
.auth-alt { margin-top: var(--s3); color: var(--muted); font-size: var(--t-sm); }
.auth-note { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--border); color: var(--faint); font-size: var(--t-xs); line-height: 1.5; }
.auth-note a { color: var(--bone); text-decoration: underline; text-underline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
}
/* ---------- the form talking back: a refusal, a field's problem, the wait ---------- */
.form-error {
  margin: 0 0 4px; padding: 12px 14px; text-align: left; font-size: var(--t-sm); line-height: 1.45; color: var(--bone);
  background: color-mix(in oklab, var(--btn-red) 10%, var(--surface)); border: 1px solid color-mix(in oklab, var(--btn-red) 45%, transparent); border-left-width: 3px; border-radius: 4px;
}
.form-error[hidden] { display: none; }
.field-err { margin: 6px 0 0; font-size: var(--t-xs); line-height: 1.4; color: var(--btn-red); text-align: left; }
.field-err:empty { display: none; }
[data-theme="dark"] .field-err { color: #e0897f; }
.input[aria-invalid="true"] { border-color: color-mix(in oklab, var(--btn-red) 70%, transparent); }
/* the card's button: the site's red-cloth button (site.css), full width and a little taller */
.auth-card .btn-primary { width: 100%; min-height: 50px; padding-inline: 28px; }
.auth-form .btn-primary { margin-top: 6px; }
.auth-form .btn-primary[aria-busy="true"] { filter: saturate(.7) brightness(.9); cursor: progress; }
.auth-form .btn-primary:disabled { cursor: progress; }
.auth-note { margin-top: 10px; font-size: var(--t-xs); color: var(--faint); text-align: left; }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.auth-note[hidden] { display: none; }
