/* NPI EOS Platform — shared styles.
 *
 * External file, not a <style> block. The Content Security Policy allows
 * 'unsafe-inline' for styles today, but relying on that is a habit worth not
 * forming: it is the directive most likely to be tightened later, and an
 * external sheet costs nothing.
 */

:root {
  --navy: #1b365d;
  --navy-hover: #16294a;
  --orange: #e8833a;
  --ink: #1a1a1a;
  --muted: #5a6674;
  --rule: #d4dae1;
  --surface: #ffffff;
  --surface-muted: #f7f9fb;
  --danger: #c0392b;
  --danger-bg: #fdecec;
  --success: #16a34a;
  --warning: #b45309;
  --warning-bg: #fdf6ef;
  --focus: #2563eb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #93b4dd;
    --navy-hover: #adc6e8;
    --ink: #f1f5f9;
    --muted: #94a3b8;
    --rule: #334155;
    --surface: #0f172a;
    --surface-muted: #1e293b;
    --danger: #f87171;
    --danger-bg: #3b1414;
    --success: #4ade80;
    --warning: #fbbf24;
    --warning-bg: #3a2a12;
    --focus: #60a5fa;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-muted);
  color: var(--ink);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.centred {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.card {
  width: 100%;
  max-width: 26rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 2rem;
}

.card.wide { max-width: 34rem; }

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
}

h1 { margin: 0 0 0.3rem; font-size: 1.45rem; color: var(--navy); }

.sub { margin: 0 0 1.5rem; color: var(--muted); font-size: 0.92rem; }

.rule { border: 0; border-top: 3px solid var(--orange); width: 3rem; margin: 0 0 1.4rem; }

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  margin-bottom: 1rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* One-time codes: monospace and generously spaced, because these are typed
   from a phone screen or a printed sheet under time pressure. */
input.code {
  font: 1.35rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.3em;
  text-align: center;
}

button {
  width: 100%;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--navy);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

button:hover:not(:disabled) { background: var(--navy-hover); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

button.link {
  width: auto;
  padding: 0;
  margin-top: 0.9rem;
  color: var(--muted);
  background: none;
  font-weight: 400;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}
button.link:hover { color: var(--ink); background: none; }

.alert {
  padding: 0.7rem 0.85rem;
  margin-bottom: 1.1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  border-left: 3px solid;
}
.alert.error   { color: var(--danger);  background: var(--danger-bg);  border-color: var(--danger); }
.alert.warning { color: var(--warning); background: var(--warning-bg); border-color: var(--warning); }
.alert[hidden] { display: none; }

.hint { margin: 0.9rem 0 0; font-size: 0.8rem; color: var(--muted); }

.footer {
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.78rem;
  color: var(--muted);
}

dl { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1.2rem; margin: 0 0 1.4rem; font-size: 0.9rem; }
dt { color: var(--muted); }
dd { margin: 0; font-variant-numeric: tabular-nums; }
.ok { color: var(--success); font-weight: 600; }

code {
  font: 0.85em ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--surface-muted);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid var(--warning);
}

.spinner[hidden] { display: none; }

/* Screen-reader-only, for status messages that must be announced but not seen. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Single sign-on ------------------------------------------------------ */

.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem 1rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  text-decoration: none;
}
.btn-sso:hover { background: var(--surface-muted); }

.divider {
  position: relative;
  margin: 1.3rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}
.divider::before {
  content: "";
  position: absolute;
  top: 50%; left: 0; right: 0;
  border-top: 1px solid var(--rule);
}
.divider span {
  position: relative;
  padding: 0 0.7rem;
  background: var(--surface);
}

/* --- Setup wizard -------------------------------------------------------- */

.code-block {
  margin: 0.8rem 0;
  padding: 0.8rem 0.9rem;
  font: 0.82rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--navy);
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}
