/*
  ShiftScribe (prototype) — login page styling.
  Self-contained: system fonts only, no web fonts, no CDN, no external assets.
  Palette mirrors the main SPA (styles.css) so login feels like the same app.
*/

:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2f3a;
  --text: #e7e9ee;
  --text-muted: #8b93a5;
  --accent: #3b82f6;
  --accent-dark: #1d4ed8;
  --danger: #ef4444;
  --radius: 8px;
  font-size: 15px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  margin-bottom: 2px;
}

.login-mark {
  display: block;
  margin-bottom: 8px;
}

.login-name {
  font-weight: 700;
  font-size: 1.4rem;
}

.login-tag {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.login-intro {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.login-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Inputs (username + password). #passcode kept for backward-compat with older
   markup; #username/#password are the current fields. */
#passcode,
#username,
#password {
  width: 100%;
  padding: 12px 12px;
  font-size: 1rem;
  color: var(--text);
  background: #0f1115;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

#passcode:focus,
#username:focus,
#password:focus {
  outline: none;
  border-color: var(--accent);
}

.login-btn {
  width: 100%;
  padding: 12px 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius);
  cursor: pointer;
}

.login-btn:hover {
  background: var(--accent-dark);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.login-error {
  margin: 0;
  min-height: 1.1em;
  color: var(--danger);
  font-size: 0.88rem;
}

/* --- Passkey (fingerprint / Face ID) sign-in --------------------------- */
.passkey-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* "or" divider between password and passkey sign-in. */
.login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.login-btn-secondary:hover {
  background: var(--panel);
  border-color: var(--accent);
}

/* --- Small-screen login ------------------------------------------------ */
@media (max-width: 640px) {
  :root { font-size: 16px; }

  .login-wrap {
    padding: 16px;
    align-items: flex-start;
  }
  .login-card {
    max-width: 100%;
    padding: 22px 18px 20px;
  }
  /* Full-width, thumb-friendly controls. */
  .login-btn {
    min-height: 50px;
    font-size: 1.05rem;
  }
  #passcode,
  #username,
  #password {
    min-height: 50px;
    font-size: 1.05rem;
  }
}

/* ==========================================================================
   AURAI IRIS THEME (2026-07-03) — sign-in face of the brand.
   Dark-teal glass card, champagne-gold action, split-color wordmark; mirrors
   styles.css so login feels like the same app.
   ========================================================================== */
:root {
  --bg: #041619;
  --panel: #0a272c;
  --border: #1e4750;
  --text: #edf4f2;
  --text-muted: #95b0ad;
  --accent: #dcaf52;
  --accent-dark: #c2963e;
  --danger: #e26854;
  --radius: 14px;
}

html, body {
  background:
    radial-gradient(900px 540px at 80% -10%, rgba(220, 175, 82, 0.10), transparent 60%),
    radial-gradient(700px 480px at -10% 12%, rgba(35, 179, 167, 0.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

.login-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 120px), var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.login-mark { border-radius: 11px; box-shadow: 0 6px 22px rgba(220, 175, 82, 0.30); }
.login-au { color: var(--accent); }
.login-ir { color: #4fc7ba; }

#passcode, #username, #password { background: #061e22; }
#passcode:focus, #username:focus, #password:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(220, 175, 82, 0.16);
}

.login-btn { color: #02282c; }
.login-btn:hover { background: #f5da99; border-color: var(--accent); }
.login-btn-secondary { color: var(--text); background: transparent; }
.login-btn-secondary:hover { background: var(--panel); border-color: var(--accent); }

/* --- Wordmark + symbol polish (2026-07-05 owner) ----------------------- */
/* "Iris" airy/light so it isn't as bold as "AuraI" — mirrors the app's
   .brand-ir (font-weight 300). "AuraI" stays the heavier half. */
.login-au { font-weight: 700; }
.login-ir { color: #4fc7ba; font-weight: 300; letter-spacing: 0.06em; }

/* Bigger brand symbol on the sign-in screen (owner: make the symbol larger). */
.login-mark { width: 64px; height: 64px; border-radius: 15px; }

/* --- App-download footer, inside the card below sign-in --------------- */
.login-appdl {
  margin: 4px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.login-appdl-link {
  color: #4fc7ba;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.login-appdl-link:hover { text-decoration: underline; }
.login-appdl-hint { color: var(--text-muted); font-size: 0.8rem; }
.login-appdl-title { color: #4fc7ba; font-weight: 600; font-size: 0.95rem; }
.login-share-icon { vertical-align: -2px; }

/* 2026-10-19 (lane IRISAPKLINK): login.js and login.html toggle class "hidden" (passkey row,
   phone sign-in panel, install hints), but this page never defined it, so the fingerprint
   button and an empty "Waiting for your phone" panel showed on every device. */
.hidden { display: none !important; }

/* 2026-09-22: phone-approved computer sign-in. The code is read off this screen
   and typed into the phone, so it has to be legible across a room at a hospital
   workstation, not a tidy little monospace hint. */
.handoff-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border, #2b3a44);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}
.handoff-help {
  margin: 0 0 10px;
  font-size: 0.88rem;
  line-height: 1.4;
  opacity: 0.85;
}
.handoff-code {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.15;
  margin: 4px 0 10px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.handoff-status {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.8;
}
.handoff-status-bad {
  opacity: 1;
  font-weight: 700;
  color: #e08484;
}

/* ==========================================================================
   LIGHT THEME (2026-09-29 owner) — follows the same html[data-theme="light"]
   attribute the app shell (styles.css) uses; login.js/index.html set it from
   the SAME localStorage key ("iris.theme") before this stylesheet paints, so
   the two pages never disagree. DEFAULT STAYS DARK -- this block only takes
   effect once that attribute is present.

   --accent stays the SAME gold in both themes deliberately: .login-btn pairs
   it with a hardcoded DARK label color (#02282c, unchanged below), and its
   hover state already swaps to a separate pale-gold literal (#f5da99) with
   that same dark label -- both pairs are self-contained and already pass
   contrast, in either theme, without touching --accent itself. The two
   places that were NOT self-contained -- gold and teal used as plain TEXT
   directly on the card background -- get their own overrides below instead.
   ========================================================================== */
html[data-theme="light"] {
  --bg: #f7f5f0;
  --panel: #ffffff;
  /* #8492a6, not slate-300 (2026-09-29 Codex round 1): #cbd5e1 measured only
     1.48:1 on white -- the card edge, the input boxes and the Face ID button
     outline all use --border, so this is a functional control boundary, not
     a quiet decorative line. */
  --border: #8492a6;
  --text: #12151a;
  --text-muted: #566072;
  --danger: #a8402e;
  color-scheme: light;
}
html[data-theme="light"],
html[data-theme="light"] body {
  background:
    radial-gradient(900px 540px at 80% -10%, rgba(220, 175, 82, 0.08), transparent 60%),
    radial-gradient(700px 480px at -10% 12%, rgba(35, 179, 167, 0.07), transparent 55%),
    var(--bg);
}
/* "AuraI" (gold) and "Iris" (teal) as plain text on the now-light card need a
   darker shade of their own hue to read at 4.5:1+ -- the pale hues above stay
   correct everywhere ELSE because they sit on solid fills with their own
   hardcoded dark label color, never on the page/card background directly. */
[data-theme="light"] .login-au { color: #7a5e14; }
[data-theme="light"] .login-ir,
[data-theme="light"] .login-appdl-link, [data-theme="light"] .login-appdl-title { color: #0f766e; }
[data-theme="light"] #passcode,
[data-theme="light"] #username,
[data-theme="light"] #password { background: #eef1f5; }

/* ==========================================================================
   D1 LOGIN (2026-10-16 owner: "revamp the app ... to be super sleek looking like [auraliris.com]").
   The same tokens as ui-sleek.css (teal ink, paper, one gold accent, 4/6 px radii, serif display wordmark, no glow,
   no gradient). VISUAL ONLY: every control, label, id and behavior of the sign-in page is unchanged. Appended last so
   it wins over the earlier AURAI IRIS THEME and LIGHT blocks; Light follows html[data-theme="light"] as before.
   ========================================================================== */
:root {
  --bg: #06323d;
  --panel: #0a3943;
  --panel-alt: #10434d;
  --line: #31535a;
  --border: #8da7a9; /* functional outline for inputs and outline buttons (>= 3:1) */
  --text: #fffdf8;
  --text-muted: #c1d0cf;
  --accent: #e6bd5c;
  --accent-dark: #e6bd5c;
  --danger: #ffab99;
  --radius: 4px;
}
html, body { background: var(--bg); background-attachment: scroll; }
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: none;
}
.login-mark { box-shadow: none; border-radius: 12px; }
.login-name {
  font-family: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.login-au { color: var(--text); font-weight: 400; }
.login-ir { color: var(--accent); font-weight: 400; letter-spacing: 0; }
.login-tag { color: #e6bd5c; font-size: 14px; letter-spacing: 0.04em; }
.login-intro, .login-label { color: var(--text-muted); }
#passcode, #username, #password {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  min-height: 48px;
}
#passcode:focus, #username:focus, #password:focus {
  border-color: var(--accent);
  box-shadow: none;
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.login-btn {
  min-height: 48px;
  color: #06323d;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  box-shadow: none;
  transition: background-color 180ms ease, border-color 180ms ease;
}
.login-btn:hover { background: #f1cc79; border-color: #f1cc79; }
.login-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.login-btn-secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}
.login-btn-secondary:hover { background: var(--panel-alt); border-color: #a4d3d0; }
.login-btn:disabled { color: var(--text-muted); background: var(--panel-alt); border-color: var(--line); opacity: 1; }
.login-or { color: var(--text-muted); }
.login-or::before, .login-or::after { background: var(--line); }
.login-appdl { border-top-color: var(--line); }
.login-appdl-link, .login-appdl-title { color: #a4d3d0; }
.login-appdl-hint { color: var(--text-muted); }
.handoff-panel { background: var(--panel-alt); border: 1px solid var(--line); border-radius: 6px; }
.login-error { color: var(--danger); }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
html[data-theme="light"] {
  --bg: #fffdf8;
  --panel: #fffdf8;
  --panel-alt: #eef2ed;
  --line: #cbd5ce;
  --border: #657e80;
  --text: #06323d;
  --text-muted: #486168;
  --danger: #a0392b;
}
html[data-theme="light"] .login-ir { color: #795410; }
html[data-theme="light"] .login-tag { color: #795410; }
html[data-variant="subtle"] .login-tag { color: var(--text-muted); }
html[data-theme="light"] .login-btn-secondary:hover { border-color: #0b4d5c; }
html[data-theme="light"] .login-appdl-link, html[data-theme="light"] .login-appdl-title { color: #0b4d5c; }
html[data-theme="light"] #passcode:focus, html[data-theme="light"] #username:focus, html[data-theme="light"] #password:focus,
html[data-theme="light"] .login-btn:focus-visible { outline-color: #956211; }
html[data-theme="light"] #passcode, html[data-theme="light"] #username, html[data-theme="light"] #password { background: #eef2ed; }
.handoff-status-bad { color: var(--danger); opacity: 1; }

/* 2026-10-18 (IRISICON) trademark marks: TM on the wordmark, the tagline and by the logo (first use on this screen). */
.tm { position: relative; top: -0.62em; margin-left: 0.06em; font-size: 0.5em; line-height: 0; font-weight: 400; letter-spacing: 0; text-transform: none; font-style: normal; }
.login-logo { position: relative; display: block; flex: none; margin-bottom: 8px; }
.login-logo .login-mark { margin-bottom: 0; }
.login-logo > .tm-logo { position: absolute; top: 3px; left: calc(100% + 3px); font-size: 9px; color: var(--text-muted); }
.login-name, .login-tag { white-space: nowrap; }
/* IRISPATENTTEXT 2026-10-19: the generic patent notice, small and quiet under the card. */
.login-legal { margin: 12px 0 0; text-align: center; color: var(--text-muted); font-size: 0.75rem; }
