/* EnoLight sign-in and account pages. Served from /assets/ under a CSP that
   allows no inline style, so every rule lives here. Tokens as console.css. */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #17202b;
  --muted: #5e6b79;
  --border: #e1e6ed;
  --accent: #1f4e79;
  --accent-text: #ffffff;
  --ok-bg: #e7f6ec;
  --ok-text: #1c6b38;
  --err-bg: #fdecec;
  --err-text: #a12626;
  --danger: #b42318;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a;
    --surface: #171e26;
    --surface-2: #1c242e;
    --text: #e6ebf1;
    --muted: #93a1b0;
    --border: #2a3440;
    --accent: #6aa7dc;
    --accent-text: #0b1520;
    --ok-bg: #12301d;
    --ok-text: #7fd59b;
    --err-bg: #3a1717;
    --err-text: #f29b9b;
    --danger: #f2766b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.frame { max-width: 420px; margin: 0 auto; padding: 2.5rem 1rem; }
.frame.wide { max-width: 1040px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 0.6rem; margin-bottom: 1.25rem; color: var(--text); font-weight: 600; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem 1.5rem; }

h1 { font-size: 1.35rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.02rem; margin: 0 0 0.75rem; }
p { margin: 0 0 0.75rem; }
section { border-top: 1px solid var(--border); padding-top: 1.25rem; margin-top: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.head-links { display: flex; align-items: baseline; gap: 1.25rem; }

.flash { padding: 0.65rem 0.85rem; border-radius: 8px; margin-bottom: 1rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok-text); }
.flash.err { background: var(--err-bg); color: var(--err-text); }

/* Author rules like `label { display: flex }` beat the browser's own [hidden] rule. */
[hidden] { display: none !important; }

.stack { display: flex; flex-direction: column; gap: 0.85rem; margin-bottom: 1rem; }
.stack.narrow { max-width: 320px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.inline { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.inline input[type="text"] { flex: 0 1 360px; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 500; font-size: 0.92rem; }
label.check { flex-direction: row; align-items: flex-start; gap: 0.5rem; font-weight: 400; }
label.check input { margin-top: 0.25rem; }
input[type="text"], input[type="email"], input[type="password"] {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.7rem; width: 100%;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.code-input { font-family: var(--mono); font-size: 1.6rem; letter-spacing: 0.35em; text-align: center; }

button, .button {
  font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
button.primary, .button { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.wide { width: 100%; }
button.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
button.link { background: none; border: none; padding: 0; color: var(--accent); font-weight: 500; }
button:disabled { opacity: 0.6; cursor: default; }
.button:hover { text-decoration: none; }

.status { min-height: 1.4em; color: var(--muted); font-size: 0.92rem; }
.passkey { margin-top: 1rem; }
.pill { display: inline-block; white-space: nowrap; font-size: 0.78rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.apps { margin: 0; padding-left: 1.2rem; }

table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }

@media (max-width: 520px) {
  .frame { padding: 1.25rem 0.75rem; }
  .card { padding: 1.25rem 1rem; }
  table, thead, tbody, tr, td, th { display: block; }
  thead { display: none; }
  td { border: none; padding: 0.15rem 0; }
  tr { border-bottom: 1px solid var(--border); padding: 0.5rem 0; }
}

.or { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.85rem; margin: 0.25rem 0 1rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.nudge { margin-top: 1.25rem; }
.danger-text { color: var(--danger); }
#passkey-add-row input { max-width: 260px; }
