/* Waterloo slate + sky blue, coral for required marks; Manrope. Light + dark. */
:root {
  color-scheme: light dark;
  --bg: #f2f7fb;
  --ink: #14283c;
  --muted: #4d6478;
  --deep: #3b5878;
  --sky: #3c90c4;
  --foam: #dcebf5;
  --card: #ffffff;
  --line: #cbdeea;
  --accent: #d9534a;
  --bad-bg: #fdf1f0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08192a;
    --ink: #e4eff7;
    --muted: #9fb8cb;
    --deep: #22405e;
    --sky: #5fb0e2;
    --foam: #16324a;
    --card: #0f2538;
    --line: #24445f;
    --accent: #ff7d70;
    --bad-bg: #2a1a1f;
  }
}

* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 Manrope, system-ui, sans-serif; overflow-x: clip; -webkit-font-smoothing: antialiased; }
a { color: var(--sky); }

.band { padding: clamp(28px, 4vw, 56px) max(5vw, 16px); }
.wrap { max-width: 1180px; margin: 0 auto; }
.logobar { background: #fff; padding: 14px max(5vw, 16px); border-bottom: 1px solid #dbe7ef; }
.logobar img { height: 54px; width: auto; display: block; }

.hero { background: var(--deep); color: #fff; position: relative; padding-bottom: clamp(70px, 9vw, 110px); }
.hero .wrap { position: relative; z-index: 1; }
h1 { font-size: clamp(32px, 5vw, 50px); line-height: 1.05; margin: 0 0 14px; text-wrap: balance; font-weight: 800; max-width: 820px; }
.hero p { max-width: 660px; margin: 0 0 10px; font-size: 17px; color: #dbeaf4; }
.policy { display: inline-block; margin-top: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 10px; padding: 10px 14px; font-size: 15px; color: #fff; }
.waves { position: absolute; left: 0; right: 0; bottom: -1px; height: clamp(60px, 8vw, 100px); width: 100%; }

.main { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 36px); align-items: start; margin-top: clamp(-70px, -6vw, -40px); position: relative; z-index: 2; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 3vw, 32px); box-shadow: 0 18px 40px -26px rgba(10,40,70,.45); }
h2 { font-size: 26px; line-height: 1.15; margin: 0 0 6px; }
h3 { font-size: 18px; line-height: 1.25; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 20px; }

/* ---------- Form ---------- */
form { display: grid; gap: 18px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
label, legend { font-weight: 600; font-size: 15px; display: block; margin-bottom: 6px; }
.req { color: var(--accent); }
input[type=text], input[type=email], input[type=tel], input[type=password], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; min-height: 46px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, .opt input:focus-visible + span {
  outline: 3px solid var(--sky); outline-offset: 2px;
}
fieldset { border: 0; margin: 0; padding: 0; }
.opts { display: flex; flex-wrap: wrap; gap: 10px; }
.opt { position: relative; margin: 0; font-weight: 400; }
.opt input { position: absolute; opacity: 0; inset: 0; }
.opt span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 15px; background: var(--bg); }
.opt input:checked + span { background: var(--deep); border-color: var(--deep); color: #fff; }
.hint { font-size: 13.5px; color: var(--muted); margin: 6px 0 0; }

.is-bad input, .is-bad select, .is-bad textarea, .is-bad .opt span { border-color: var(--accent); }
.is-bad input[type=text], .is-bad input[type=email], .is-bad input[type=tel] { background: var(--bad-bg); }
.ferr { color: var(--accent); font-weight: 600; font-size: 13.5px; margin: 6px 0 0; }
.alert { border: 1.5px solid var(--accent); background: var(--bad-bg); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 15px; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

button, .btnlink { font: inherit; font-weight: 700; font-size: 16px; border: 0; border-radius: 12px; min-height: 48px; padding: 12px 22px; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.primary { background: var(--sky); color: #fff; }
.primary:hover { filter: brightness(1.08); }
.primary:disabled { opacity: .7; cursor: progress; }
.ghost { background: transparent; color: var(--sky); border: 1.5px solid var(--sky); }
.err { color: var(--accent); font-weight: 600; font-size: 14px; margin: 0; }
.note { font-size: 13px; color: var(--muted); margin: 0; }

/* Role blocks: JS hides the inactive one; without JS both show, each with a note. */
html.js .block.off { display: none; }
.nojs-note { display: none; font-weight: 700; margin: 0 0 10px; }
html:not(.js) .nojs-note { display: block; }

.advcard { border: 1.5px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; display: grid; gap: 14px; background: var(--bg); }
.advhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.advhead b { font-size: 15px; }
.rm { background: none; border: 0; color: var(--accent); font-weight: 600; font-size: 14px; min-height: 44px; padding: 0 6px; }
[hidden] { display: none !important; }

.hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Done state ---------- */
.check { width: 56px; height: 56px; border-radius: 50%; background: var(--foam); color: var(--sky); display: grid; place-items: center; margin-bottom: 14px; }

/* ---------- Quick facts ---------- */
.facts { list-style: none; margin: 0; padding: 0; display: grid; }
.facts li { display: grid; gap: 2px; padding: 14px 0; border-top: 1px solid var(--line); }
.facts li:first-child { border-top: 0; padding-top: 4px; }
.facts b { font-size: 13px; color: var(--muted); font-weight: 700; }
.facts .big { font-size: 22px; font-weight: 800; color: var(--deep); line-height: 1.2; }
.facts span { font-size: 15px; overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) { .facts .big, .ico { color: var(--sky) !important; } }

/* ---------- How it works ---------- */
.sec h2 { margin-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.ico { width: 40px; height: 40px; border-radius: 11px; background: var(--foam); display: grid; place-items: center; color: var(--deep); margin-bottom: 12px; }
.grid p { margin: 0; color: var(--muted); font-size: 15px; }
.grid ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.grid li { margin-bottom: 4px; }
.tip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(18px, 3vw, 36px); align-items: center; background: var(--foam); border-radius: 18px; padding: clamp(20px, 3vw, 34px); margin-top: 22px; }
.tip ol { margin: 0; padding-left: 22px; }
.tip ol li { margin-bottom: 8px; }
.bubble { background: var(--card); border-radius: 16px 16px 16px 4px; padding: 12px 14px; font-size: 15px; box-shadow: 0 8px 20px -14px rgba(0,0,0,.4); max-width: 420px; }
.bubble small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
details { border-top: 1px solid var(--line); margin-top: 22px; }
summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
details ol { padding-left: 22px; margin: 4px 0 10px; }
details ol li { margin-bottom: 6px; }

footer { text-align: center; color: var(--muted); font-size: 14px; padding: 30px 16px 40px; }
footer b { color: var(--ink); }

/* ---------- Gate ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--deep); }
.gate-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 18px; padding: 36px 32px; box-shadow: 0 18px 40px -20px rgba(0,0,0,.5); display: grid; gap: 12px; }
.gate-logo { height: 54px; width: auto; background: #fff; border-radius: 8px; padding: 4px; justify-self: start; }
.gate-title { font-size: 28px; margin: 8px 0 0; }
.gate-sub { color: var(--muted); margin: 0 0 6px; }
.gate-card label { margin: 0; }
.gate-code { font-size: 64px; font-weight: 800; color: var(--sky); line-height: 1; }

/* ---------- Admin ---------- */
.adminhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.adminactions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.count { font-size: 40px; font-weight: 800; color: var(--sky); line-height: 1; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tip { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .row, .grid { grid-template-columns: minmax(0, 1fr); }
  .logobar img { height: 44px; }
  table { font-size: 13px; }
  .stack thead { display: none; }
  .stack tr { display: grid; padding-block: 10px; border-bottom: 1px solid var(--line); }
  .stack td { display: flow-root; border: 0; padding: 3px 0 3px 8em; }
  .stack td::before { content: attr(data-l); float: left; width: 7.5em; margin-left: -8em; color: var(--muted); }
  .stack td:empty { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .w1 { animation: drift 9s ease-in-out infinite alternate; }
  @keyframes drift { to { transform: translateX(-40px); } }
}
