/* Generic site + account pages (home.html, reset.html, account.html) */
@import url("https://fonts.bunny.net/css?family=montserrat:600,700,800|plus-jakarta-sans:400,500,600,700&display=swap");
/* Naledi brand: navy, teal and gold (see the brand board) */
:root {
  --bg: #f5f8fb;
  --surface: #ffffff;
  --text: #14284b;
  --muted: #5b6b82;
  --line: #e2e8f0;
  --brand: #14284b;
  --brand-ink: #ffffff;
  --brand-soft: #eef8f9;
  --accent: #1f8695;
  --gold: #c9a24d;
  --danger: #c0262d;
  --danger-soft: #fdecec;
  --ok: #10916b;
  --ok-soft: #e5f6ef;
  --radius: 18px;
  --shadow: 0 30px 60px -20px rgba(20, 40, 75, .3);
  --display: "Montserrat", "Plus Jakarta Sans", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1a33;
    --surface: #13254a;
    --text: #eef3fa;
    --muted: #a6b4c9;
    --line: #253b63;
    --brand: #6fcbd4;
    --brand-ink: #0c1a33;
    --brand-soft: #173058;
    --accent: #6fcbd4;
    --danger: #ff8a8f;
    --danger-soft: #3a1c26;
    --ok: #5fd6a4;
    --ok-soft: #12332b;
    --shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
img { max-width: 100%; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.logo-mark { width: 40px; height: 40px; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-word { font-family: var(--display); font-weight: 800; font-size: 1.4rem; letter-spacing: .01em; background: linear-gradient(100deg, #14284b, #22436f 45%, #1f8695); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-sub { font-family: var(--display); font-size: .5rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.logo-sub i { font-style: normal; color: var(--gold); padding: 0 .25em; }
@media (prefers-color-scheme: dark) { .logo-word { background: linear-gradient(100deg, #fff, #cfe6ea 60%, #6fcbd4); -webkit-background-clip: text; background-clip: text; } }
@media (max-width: 420px) { .logo-sub { display: none; } }
.nav { display: flex; gap: 22px; margin-right: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { color: var(--muted); font-size: .95rem; }
.user-chip strong { color: var(--text); }
@media (max-width: 720px) { .nav { display: none; } .header-actions { margin-left: auto; } .user-chip { display: none; } }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid transparent; border-radius: 999px;
  padding: 10px 20px; font: inherit; font-family: var(--display); font-weight: 700; font-size: .92rem; cursor: pointer;
  text-decoration: none; transition: transform .05s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.15); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .92rem; }
.field input {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); background: var(--surface); }
.field .hint { color: var(--muted); font-size: .85rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; padding: 6px; }
.meter { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s, background .2s; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; font-size: .92rem; }
.check { display: flex; align-items: center; gap: 8px; }

.alert { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .93rem; display: none; }
.alert.show { display: block; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert a { color: inherit; font-weight: 600; word-break: break-all; }

/* ---------- hero & sections ---------- */
.hero { padding: 96px 0 84px; text-align: center; background: radial-gradient(700px 380px at 85% 0%, rgba(42,155,168,.16), transparent 60%), radial-gradient(600px 360px at 10% 100%, rgba(201,162,77,.12), transparent 60%); }
.hero-mark { width: 88px; height: 88px; margin: 0 auto 22px; display: block; }
.eyebrow { display: inline-block; padding: 6px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--accent); font-family: var(--display); font-weight: 700; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 20px; }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1; margin: 0 auto 18px; max-width: 18ch; letter-spacing: -.03em; }
.hero h1 span { background: linear-gradient(100deg, #22436f, #1f8695); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (prefers-color-scheme: dark) { .hero h1 span { background: linear-gradient(100deg, #cfe6ea, #6fcbd4); -webkit-background-clip: text; background-clip: text; } }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 56ch; margin: 0 auto 30px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

section { padding: 64px 0; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-family: var(--display); font-weight: 800; font-size: 2rem; margin: 0 0 8px; letter-spacing: -.02em; }
.section-title p { color: var(--muted); margin: 0; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { font-family: var(--display); margin: 14px 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); }
.icon { width: 46px; height: 46px; border-radius: 14px; background: var(--brand-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.1rem; }
.icon svg { width: 22px; height: 22px; }
.cta { background: radial-gradient(500px 260px at 100% 0%, rgba(42,155,168,.3), transparent 60%), #14284b; color: #c4d0e2; border-radius: 28px; padding: 56px 24px; text-align: center; }
.cta h2 { color: #fff; font-family: var(--display); font-weight: 800; font-size: 1.9rem; }
.cta p { color: #c4d0e2 !important; }
.cta .btn-primary { background: linear-gradient(120deg, #1f8695, #2a9ba8); color: #fff; }
.cta h2 { margin: 0 0 10px; }
.cta p { color: var(--muted); margin: 0 0 24px; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 16px; background: rgba(10, 10, 20, .55); }
.modal.open { display: grid; }
.dialog { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 24px; border-top: 4px solid var(--gold); box-shadow: var(--shadow); padding: 28px; }
.dialog h2 { font-family: var(--display); margin: 0 0 4px; font-size: 1.45rem; letter-spacing: -.02em; }
.dialog .sub { margin: 0 0 20px; color: var(--muted); }
.close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.close:hover { background: var(--bg); color: var(--text); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border-radius: 11px; margin-bottom: 20px; }
.tabs button { border: 0; background: transparent; padding: 8px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.switch { text-align: center; margin: 16px 0 0; color: var(--muted); font-size: .92rem; }
[hidden] { display: none !important; }

/* ---------- standalone auth pages ---------- */
.page-center { min-height: calc(100vh - 64px - 80px); display: grid; place-items: center; padding: 40px 0; }
.panel { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.panel h1 { font-family: var(--display); margin: 0 0 4px; font-size: 1.55rem; letter-spacing: -.02em; }
.panel .sub { margin: 0 0 20px; color: var(--muted); }
.account-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); padding: 40px 0 64px; }
.account-grid h1 { grid-column: 1 / -1; margin: 0; font-family: var(--display); letter-spacing: -.02em; }
.card.danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
dl.meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; font-weight: 500; word-break: break-word; }

.site-footer .tag { font-family: var(--display); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .72rem; color: var(--gold); }
.btn-ghost { background: var(--surface); }

@media (max-width: 720px) { .header-actions .btn { padding: 8px 14px; font-size: .84rem; white-space: nowrap; } .site-header .wrap { gap: 12px; } }
@media (max-width: 380px) { .header-actions .btn-ghost { display: none; } }

/* ---------- account access card + admin page ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.wait { background: #fdf5e2; color: #8a6412; border-color: transparent; }
.badge.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.admin { background: var(--brand-soft); color: var(--accent); border-color: transparent; }
@media (prefers-color-scheme: dark) { .badge.wait { background: #3a2f12; color: #f0c86a; } }
.access { border-left: 4px solid var(--gold); }
.access-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.access-head h2 { margin: 0; font-size: 1.2rem; font-family: var(--display); }
.access p { margin: 10px 0 0; }
.access-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.access-actions:not(:has(a:not([hidden]))) { display: none; }

.admin-page { padding: 36px 0 64px; display: grid; gap: 22px; }
.admin-page h1 { margin: 0; font-family: var(--display); letter-spacing: -.02em; }
.admin-page .lead { margin: 4px 0 0; color: var(--muted); }
.admin-page h2 { font-family: var(--display); font-size: 1.15rem; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.admin-page .card > p.sub { margin: 0 0 16px; color: var(--muted); font-size: .93rem; }
.count-pill { background: var(--gold); color: #14284b; border-radius: 99px; font-size: .75rem; padding: 2px 9px; font-weight: 800; }
.pending-list { display: grid; gap: 12px; }
.pending-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.pending-item .who b { display: block; }
.pending-item .who small { color: var(--muted); word-break: break-all; }
.pending-item .act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) { .pending-item { grid-template-columns: 1fr; } .pending-item .act { justify-content: flex-start; } }
.select, .text-in { font: inherit; font-size: .92rem; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); min-width: 0; }
.select:focus, .text-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.btn-sm { padding: 8px 14px; font-size: .86rem; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.users { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.users th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.users td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.users tr:last-child td { border-bottom: 0; }
table.users td small { display: block; color: var(--muted); word-break: break-all; }
table.users code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .86rem; }
.empty-note { color: var(--muted); padding: 10px 0; margin: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: middle; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dialog .field select, .dialog .field input { width: 100%; }
.dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #14284b; color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transition: .2s; z-index: 60; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
