/* Palette is built on the Curiosity brand blue (#209CEE, straight from the
   logo). The logo sets white on #209CEE, which works at logo size but only
   reaches ~3:1, under WCAG AA for UI text. So buttons use one step deeper
   (#1278c0, 4.7:1 against white) and #209CEE stays the accent on dark. */
:root {
  --bg: #0c0e10;
  --panel: #14171a;
  --line: #262b30;
  --text: #e7eaed;
  --muted: #8b949e;

  --accent: #209CEE;       /* links, focus, pills, on the dark background */
  --accent-btn: #1278c0;   /* solid button fill, carries white text at AA */
  --on-accent: #ffffff;
  --accent-dim: #0b2b40;   /* tinted surface */
  --accent-line: #1a567d;  /* border for a tinted surface */
  --accent-soft: #9ad4f8;  /* text on a tinted surface */

  --danger: #f87171;
  --warn: #fbbf24;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- layout ---------- */

.wrap { max-width: 920px; margin: 0 auto; padding: 32px 20px 72px; }

.center {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.card.narrow { width: 100%; max-width: 400px; }

/* Login, enrolment and the error page read as a single centred column. */
.card.narrow.centered { text-align: center; }
.card.narrow.centered label { text-align: center; }
.card.narrow.centered input[type=text] { text-align: center; }
.card.narrow.centered .check { text-align: left; }
.card.narrow.centered .check label { text-align: left; }
.card.narrow.centered .alert { text-align: left; }

/* ---------- brand ---------- */

/* Both assets are wide, white-on-transparent lockups, so they are sized by
   height and left to find their own width. No tile, no corner radius. */

/* Front door: the full lockup, centred above the form. */
.brand-logo {
  display: block;
  height: 62px; width: auto;
  margin: 2px auto 20px;
}

/* Header: the GATE mark alone. The full lockup's "curiosity technology" line
   blurs below ~40px, and the front door already carries the whole thing. */
.brand { display: flex; align-items: center; }
.brand-logo-sm { display: block; height: 21px; width: auto; }

.brand-sub { color: var(--muted); font-size: 13px; margin: 0 0 24px; }

/* ---------- header ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px; margin-bottom: 28px;
}
.topbar nav { display: flex; gap: 16px; font-size: 14px; }
.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--text); text-decoration: none; }
/* Lines up under the wordmark, not under the mark. */
.topbar .who { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---------- forms ---------- */

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

input[type=text], input[type=password] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
}
input[type=text]:focus, input[type=password]:focus {
  outline: none; border-color: var(--accent);
}

input.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 24px; letter-spacing: 0.3em; text-align: center; padding: 12px;
}

.field { margin-bottom: 18px; }

.check {
  display: flex; align-items: flex-start; gap: 9px;
  margin-bottom: 12px; font-size: 13.5px; color: var(--text);
}
.check input { margin: 3px 0 0; flex: none; accent-color: var(--accent); }
.check .hint { display: block; color: var(--muted); font-size: 12.5px; }

button, .btn {
  display: inline-block;
  background: var(--accent-btn); color: var(--on-accent);
  border: 0; border-radius: 8px;
  padding: 11px 18px;
  font: 600 14px/1 inherit;
  cursor: pointer;
}
button:hover, .btn:hover { filter: brightness(1.1); text-decoration: none; }
button.full { width: 100%; padding: 13px; font-size: 15px; }

/* Secondary: present but not competing with the page's real actions. */
.btn.quiet {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent-line); padding: 8px 15px;
}
.btn.quiet:hover { background: var(--accent-dim); filter: none; }

button.ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); padding: 6px 12px; font-size: 13px;
}
button.ghost:hover { color: var(--danger); border-color: var(--danger); filter: none; }
/* Irreversible, so it reads as such before you hover it. */
button.ghost.danger { color: #c86a6a; border-color: #4e2126; }

/* ---------- messages ---------- */

.alert {
  border-radius: 8px; padding: 11px 13px; font-size: 13.5px; margin-bottom: 18px;
  border: 1px solid;
}
.alert.error { background: #2a1416; border-color: #4e2126; color: #fca5a5; }
.alert.warn  { background: #2a2310; border-color: #4e4121; color: #fcd34d; }
.alert.ok    { background: var(--accent-dim); border-color: var(--accent-line);
               color: var(--accent-soft); }

/* ---------- sections ---------- */

section { margin-bottom: 34px; }
section h2 {
  font-size: 14px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 12px;
}
.section-note { color: var(--muted); font-size: 13px; margin: -6px 0 14px; }

/* ---------- lists ---------- */

.row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 15px; margin-bottom: 8px;
}
.row .main { min-width: 0; }
.row .title { font-size: 14px; font-weight: 500; }
.row .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; word-break: break-all; }
.row.empty { color: var(--muted); font-size: 13.5px; justify-content: flex-start; }

.pill {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px; vertical-align: middle;
  background: var(--accent-dim); color: var(--accent); margin-left: 7px;
}
.pill.grey { background: #22262a; color: var(--muted); }
.pill.warn { background: #33280f; color: var(--warn); }

/* ---------- secret reveal ---------- */

.reveal {
  background: var(--accent-dim); border: 1px solid var(--accent-line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 24px;
}
.reveal p { margin: 0 0 10px; font-size: 13.5px; color: var(--accent-soft); }
.reveal .value {
  display: block; background: #04161f; border: 1px solid var(--accent-line);
  border-radius: 7px; padding: 11px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; color: #dbf0ff; word-break: break-all; user-select: all;
}
.reveal code { color: #dbf0ff; }
.reveal .value-row { display: flex; align-items: stretch; gap: 8px; }
.reveal .value-row .value { flex: 1; min-width: 0; }

button.copy {
  flex: none; align-self: stretch;
  background: var(--accent-btn); color: #fff;
  padding: 0 14px; font-size: 13px; white-space: nowrap;
}
button.copy.copied { background: #1f7a4d; }

/* ---------- qr ---------- */

.qr {
  display: block; margin: 0 auto 16px;
  width: 196px; height: 196px;
  background: #fff; padding: 8px; border-radius: 8px;
}

/* ---------- table ---------- */

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: 11.5px;
     text-transform: uppercase; letter-spacing: 0.04em; }
td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- footer ---------- */

.foot { color: var(--muted); font-size: 12px; margin-top: 40px;
        border-top: 1px solid var(--line); padding-top: 14px;
        display: flex; align-items: center; gap: 8px; }
.foot img { height: 13px; width: auto; opacity: 0.55; }

@media (max-width: 520px) {
  .wrap { padding: 20px 16px 56px; }
  .card { padding: 22px 18px; }
  .row { flex-direction: column; align-items: stretch; }
}
