/* Batch ACCT-3: shared signed-out account pages and admin console styling.
   Signed-out pages cannot load private /assets/system.css through the gate, so
   this small fallback contains only the tokens they use. */
@font-face {
  font-family: Cinzel;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/cinzel-600-latin.woff2') format('woff2');
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/inter-var-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-var-latin.woff2') format('woff2');
}

:root {
  color-scheme: dark;
}

body:not(.admin-page) {
  --abyss: #050A12;
  --ink: #0B1321;
  --hull: #132335;
  --brass: #B08D57;
  --brass-hi: #D0A850;
  --squall: #4FD1E0;
  --foam: #C6E1EA;
  --fog: #94A4B0;
  --line: rgba(176,141,87,0.18);
  --line-strong: rgba(176,141,87,0.30);
  --steel: #2A3F58;
  --danger: #E05A5A;
  --warn: #F0B84A;
  --ok: #6BD98A;
  --font-body: Inter,-apple-system,system-ui,sans-serif;
  --font-display: Cinzel,Georgia,serif;
  --font-mono: 'JetBrains Mono',monospace;
  --track-caps: .24em;
  --track-label: .18em;
  --track-mono: .04em;
  --r-sm: 3px;
  --r-md: 6px;
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--steel) transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--steel);
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-track { background: transparent; }

::selection {
  background: var(--squall-dim, #2B7F8A);
  color: var(--ice, #E6F0F4);
}

html {
  min-height: 100%;
  background: var(--abyss, #050A12);
}

body:not(.admin-page) {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: 24px 16px;
  display: grid;
  place-items: center;
  color: var(--foam);
  background: var(--abyss);
  font-family: var(--font-body);
}

:focus-visible {
  outline: 2px solid var(--squall);
  outline-offset: 3px;
}

.card {
  width: min(100%, 380px);
  padding: clamp(22px, 7vw, 34px);
  background: var(--ink);
  border: 1px solid var(--line-strong);
}

/* Batch WEBLOGIN-1: the marketing site's water column behind the signed-out
   pages (website/css/muirwave.css "Background z-stack", same values). The
   whole stack lives in one fixed .backdrop under the card rather than at
   negative z-index, because this sheet paints <body>'s own background and a
   negative layer would sit underneath it. /water-column.js animates the
   two canvases; without it the wash and grain alone still render. */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.backdrop > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.backdrop .stage { background: #050810; }
.backdrop .stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30, 48, 70, 0.38) 0%, rgba(30, 48, 70, 0.10) 45%, rgba(30, 48, 70, 0) 80%);
}
.backdrop #godrays { mix-blend-mode: screen; opacity: 0.85; }
.backdrop #abyss { mix-blend-mode: screen; }
.backdrop .grain {
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.7'/></svg>");
}
/* The card floats in the water: the marketing site's glass panel, opaque
   enough that the moving snow never crosses the form fields' contrast. */
body.signed-out .card {
  position: relative;
  z-index: 1;
  background: rgba(11, 19, 33, 0.86);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}

.brand-lockup img { width: auto; height: 22px; }
.wordmark { font: 600 21px/1 var(--font-display); letter-spacing: .045em; color: var(--brass-hi); }
.brand-sub { font-size: 9px; letter-spacing: var(--track-caps); color: var(--brass); text-transform: uppercase; }
body:not(.admin-page) h1 { margin: 0; color: var(--brass-hi); font: 600 clamp(22px, 7vw, 27px)/1.2 var(--font-display); }
.intro { margin: 14px 0 24px; color: var(--fog); font-size: 14px; line-height: 1.6; }
.card .brand-lockup { margin-bottom: 24px; }

body:not(.admin-page) form {
  display: grid;
  gap: 9px;
}

.card label {
  margin-top: 7px;
  color: var(--brass);
  font: 500 10px var(--font-mono);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

body:not(.admin-page) :is(input,select) {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--hull);
  color: var(--foam);
  font: 16px var(--font-body);
  caret-color: var(--squall);
  accent-color: var(--squall);
}

body:not(.admin-page) :is(input[type="checkbox"],input[type="radio"]) { width: auto; min-height: auto; accent-color: var(--squall); }
body:not(.admin-page) input[readonly] { background: transparent; border-color: var(--line); color: var(--fog); }
body:not(.admin-page) input[readonly]:focus { background: transparent; }

body:not(.admin-page) button {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--brass-hi);
  border-radius: var(--r-sm);
  background: var(--brass-hi);
  color: var(--abyss);
  font: 600 14px var(--font-body);
  cursor: pointer;
  transition: background-color .18s,color .18s,border-color .18s,opacity .18s;
}

body:not(.admin-page) button:hover { background: var(--brass); }
body:not(.admin-page) button:active { opacity: .8; }
body:not(.admin-page) button:disabled { opacity: .55; cursor: not-allowed; }
.error { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--danger); color: var(--foam); font-size: 13px; }

/* Batch ACCT-5: the admin page has its own sheet, /auth/admin.css (admin-gated).
   The element rules above are scoped to the signed-out pages so that sheet
   starts from a clean slate rather than overriding them. */
[hidden] { display: none !important; }

.sign-in-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: var(--foam); text-decoration: none; font: 600 14px var(--font-body); }
.sign-in-link:hover { background: transparent; border-color: var(--brass); color: var(--ice); }

/* Batch PWRESET-1: the quiet way to /forgot, under the sign-in form. */
.card .forgot-row { margin: 4px 0 -8px; }
.forgot-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--fog); font: 14px var(--font-body);
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.forgot-link:hover { color: var(--foam); text-decoration-color: var(--brass); }

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
