/* Sovereign Savage web app. Tokens, fields and buttons follow prototype.html's
   "ui-redesign-2026-10-14" layer; the sign-in layout follows the mobile login screen. */
:root {
  --bg: #080A0D; --s1: #0E1116; --s2: #14191E; --s3: #181E25;
  --hair: #46535E33; --hair-2: #46535E55;
  --text: #F3F5F7; --text-2: #AAB5C0; --text-3: #8E969E; --platinum: #E8EDF2;
  --gold: #EDC343; --gold-2: #F7D362; --gold-deep: #BD9026;
  --danger: #FF8A80;
  --r-md: 16px; --pill: 999px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at top, #11110E 0%, #080A0D 65%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; color: inherit; border: 0; background: none; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.auth-card { width: 100%; max-width: 420px; }

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; }
.auth-brand img { width: 57px; height: 68px; object-fit: contain; }
.brand-label { font-size: 15px; font-weight: 700; letter-spacing: 3px; line-height: 1.25; color: var(--text); }
.brand-label small { display: block; margin-top: 4px; font-size: 10px; letter-spacing: 3px; color: var(--gold); }

.auth-view { display: flex; flex-direction: column; }
.auth-view[data-state="starting"], .auth-view[data-state="checking_gate"], .auth-view[data-state="signing_out"] { align-items: center; text-align: center; }

.view-title { margin: 0 0 12px; font-size: 28px; font-weight: 300; letter-spacing: -.02em; line-height: 1.2; color: var(--platinum); }
.view-title:focus { outline: none; }
.view-sub { margin: 0 0 24px; color: var(--text-2); }
.view-body { margin: 0 0 12px; font-size: 17px; line-height: 1.45; color: var(--platinum); white-space: pre-line; overflow-wrap: anywhere; }
.view-note { margin: 0 0 12px; font-size: 15px; color: var(--text-2); }
.needs { margin: 4px 0 16px; padding-left: 20px; font-size: 17px; color: var(--platinum); }
.needs li { margin: 4px 0; }

/* Fields (prototype .field) */
.field { display: block; margin: 0 0 18px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.field input {
  display: block; width: 100%; min-height: 50px; margin-top: 8px; padding: 14px 16px;
  background: var(--s1); border: 1px solid var(--hair-2); border-radius: var(--r-md);
  color: var(--text); font-size: 16px; transition: border-color .15s;
}
.field input:focus { border-color: var(--gold); outline: none; }
.field input[aria-invalid] { border-color: var(--danger); }
.field input[readonly] { opacity: .7; }
.password-row { position: relative; display: block; }
.password-row input { padding-right: 76px; }
.reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(calc(-50% + 4px));
  min-width: 60px; min-height: 40px; padding: 0 12px; border-radius: var(--pill);
  color: var(--text-2); font-size: 13px; font-weight: 600;
}
.reveal:hover { color: var(--gold); }
.field-error { display: block; min-height: 0; margin-top: 6px; color: var(--danger); font-size: 13px; }
.field-error:empty { display: none; }
.form-error { margin: 2px 0 18px; color: var(--danger); font-size: 15px; }
.form-error:empty { display: none; }

/* Buttons (prototype .primary / .secondary) */
.primary, .secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 14px 22px; border-radius: var(--pill);
  font-size: 15px; font-weight: 600; letter-spacing: -.005em;
}
.primary { background: var(--gold); color: #080A0D; box-shadow: 0 8px 24px #EDC34326, inset 0 1px 0 #F7D36280; }
.primary:disabled { opacity: .6; }
.secondary { background: var(--s3); color: var(--platinum); border: 1px solid var(--hair); }
.secondary:hover { border-color: var(--hair-2); }
.wide { width: 100%; }
.auth-view > .primary, .auth-view > .secondary { margin-top: 12px; }
.auth-view > .view-title + .primary, .auth-view > .view-body + .secondary,
.auth-view > .view-note + .secondary, .auth-view > .needs + .secondary { margin-top: 16px; }

.spinner {
  width: 32px; height: 32px; margin: 8px auto 24px; border-radius: 50%;
  border: 3px solid #EDC34333; border-top-color: var(--gold);
  animation: spin .8s linear infinite;
}
.primary .spinner { width: 22px; height: 22px; margin: 0; border-width: 2.5px; border-color: #080A0D33; border-top-color: #080A0D; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

@media (max-width: 380px) {
  .auth-brand { margin-bottom: 36px; }
  .view-title { font-size: 25px; }
}

/* Layouts: the sign-in card, the wider covenant, Home. */
main[data-layout="wide"] .auth-card { max-width: 560px; }
.auth-view[data-state="checking_onboarding"] { align-items: center; text-align: center; }

button.quiet { align-self: center; margin-top: 14px; min-height: 44px; padding: 8px 16px; color: var(--text-2); font-size: 14px; }
button.quiet:hover { color: var(--gold); }
button.ghost { border: 1px solid var(--hair-2); border-radius: var(--pill); color: var(--gold); }
button.ghost.small { min-height: 36px; padding: 4px 12px; font-size: 13px; }

/* Covenant (web shell .panel with the gold left edge, WEB:2504) */
.covenant {
  display: flex; flex-direction: column;
  padding: 20px 18px; border-radius: var(--r-md); background: var(--s1); border-left: 3px solid var(--gold);
}
.cov-text, .cov-points { margin: 0 0 12px; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.cov-text b, .cov-points b { color: var(--platinum); }
.cov-more { margin: 0 0 18px; }
.cov-more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--gold); font-size: 14px; }
.cov-more summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cov-points { padding-left: 22px; }
.cov-points li { margin: 0 0 10px; }
.cov-phone-field > span { display: block; }
.cov-phone-row { display: flex !important; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.cov-phone { font-size: 17px; color: var(--text); }
.cov-consent { margin-top: 6px; font-size: 12px; font-weight: 400; color: var(--text-3); }
.covenant .primary { margin-top: 4px; }
.covenant .form-error { margin: 12px 0 0; }

/* Recognition */
.recognition { display: flex; flex-direction: column; }
.field .select {
  display: block; width: 100%; min-height: 50px; margin-top: 8px; padding: 12px 14px;
  background: var(--s1); border: 1px solid var(--hair-2); border-radius: var(--r-md); color: var(--text); font: inherit; font-size: 16px;
}
.field .select:focus { border-color: var(--gold); outline: none; }
.rec-busy .spinner { margin: 16px auto 0; }
.rec-status { margin-top: 14px; }
.rec-status:empty { display: none; }

/* Dialogs (dialog.js): the recognition confirm and the member area's dialogs. */
.dialog {
  position: relative; max-width: 520px; width: calc(100% - 32px); padding: 28px 24px 24px;
  border: 1px solid #46535E55; border-radius: 24px; background: var(--s2); color: var(--text);
}
.dialog::backdrop { background: #000000B0; }
.dialog-title { margin: 0 44px 16px 0; font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--platinum); }
.dialog-close {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; color: var(--text-2);
}
.dialog-close:hover { color: var(--platinum); background: var(--s3); }
.dialog-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.dialog.confirm { max-width: 420px; border-color: var(--gold); }
.dialog.confirm .dialog-title { font-size: 17px; font-weight: 400; line-height: 1.45; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.confirm-actions button { min-height: 44px; padding: 10px 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
