:root {
  --page-bg: #09518b;
  --header-footer-bg: #c3edec;
  --ui-border: #000;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--page-bg);
  color: #0a0a0a;
  font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Shared inner container: gives 10% margins on each side */
.shell { margin-inline: 10%; }

/* Page layout (sticky footer) */
.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ================= HEADER ================= */
.site-header {
  height: 60px;
  display: block;                 /* allows inner .shell to be 80% (10% margins) */
}

.site-header .shell {
  background: var(--header-footer-bg);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: 15px;

  border-left: 0.5px solid var(--ui-border);
  border-right: 0.5px solid var(--ui-border);
  border-bottom: 0.5px solid var(--ui-border);
}

/* Logo */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: 0;
  outline-offset: 2px;
}
.brand:focus-visible { outline: 2px dashed #333; }

.brand-img {
  height: 60px;
  width: 60px;
  display: block;
  object-fit: contain;
}

/* Right-side auth links */
.auth-link {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  text-decoration-color: transparent;
  text-shadow: 0 0 1px #000, 0 0 1px #000, 0 0 1px #000;
  cursor: pointer;
}
.auth-link:hover,
.auth-link:focus,
.auth-link:visited {
  color: #fff;
  text-decoration: none;
}
.auth-link:focus-visible {
  outline: 1px dashed #333;
  outline-offset: 2px;
}

/* ================= MAIN ================= */
.site-main {
  flex: 1 1 auto;
  padding-block: 24px 32px;
}
.content { max-width: 72ch; padding-block: 8px; }

/* ================= FOOTER ================= */
.site-footer {
  height: 30px;
  display: block;                 /* allows inner .shell to be 80% (10% margins) */
}

.site-footer .shell {
  background: var(--header-footer-bg);
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 15px;

  border-left: 0.5px solid var(--ui-border);
  border-right: 0.5px solid var(--ui-border);
  border-top: 0.5px solid var(--ui-border);
}

/* ================ RESPONSIVE ================ */
@media (max-width: 640px) {
  .shell { margin-inline: 6%; }
  .auth { gap: 8px; }
  .brand-img { height: 56px; width: 56px; }
}

/* ================= REGISTER MODAL ================= */
:root {
  --reg-overlay: rgba(0,0,0,.55);
  --reg-surface: #fff;
  --reg-shadow: 0 20px 50px rgba(0,0,0,.35);
  --reg-radius: 16px;
  --reg-accent: #09518b; /* site blue */
  --reg-error: #b00020;
}

/* Backdrop & centering */
.reg-backdrop {
  position: fixed; inset: 0;
  background: var(--reg-overlay);
  display: grid; place-items: center;
  z-index: 1000;
}
.reg-backdrop.is-hidden { display: none; }

/* Modal card */
.reg-modal {
  background: var(--reg-surface);
  width: min(720px, 92vw);
  max-height: 90vh;
  border-radius: var(--reg-radius);
  box-shadow: var(--reg-shadow);
  padding: 20px 24px 24px;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden; /* frame for step switching */
}

/* Close (X) */
.reg-close {
  position: absolute; top: 8px; right: 10px;
  border: 0; background: transparent;
  font-size: 28px; line-height: 1; cursor: pointer;
  color: #444;
}
.reg-close:focus-visible { outline: 2px dashed #333; outline-offset: 2px; }

/* --- Wizard: show ONLY the active step --- */
.reg-wizard {
  height: 100%;
  display: block;                 /* no slider */
  transform: none !important;     /* ignore any --step-index translate */
}

/* Hide all steps by default */
.reg-step { display: none; }

/* Only the current step is visible */
.reg-step.is-active {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 8px 6px 6px;
}

/* Header area */
.reg-head { text-align: center; }
.reg-logo { width: 72px; height: 72px; margin: 6px auto 8px; display: block; }
.reg-head h2 { margin: 0 0 4px; font-size: 24px; }
.reg-sub { margin: 0; color: #444; }

/* Form */
.reg-form {
  display: grid; gap: 12px;
  align-content: start;
}
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 16px;
}
.field input:focus { outline: 2px solid #7eb3e0; border-color: #7eb3e0; }
.err { min-height: 18px; margin: 4px 2px 0; color: var(--reg-error); font-size: 13px; }

/* Username availability hint colors */
.hint { margin: 4px 2px 0; font-size: 13px; color: #555; min-height: 18px; }
.hint.ok { color: #0a7c2f; }                 /* green */
.hint.bad { color: var(--reg-error); }       /* red */

/* ---- Step 4 layout (age/newsletter) ---- */
.pref-group {
  display: grid;
  gap: 8px;
  margin: 8px 0 14px;
}
.group-title {
  margin: 0;
  color: #333;
}
.check {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 8px;
}
.check input {
  width: 18px;
  height: 18px;
}

/* Nav arrows area */
.reg-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  margin-top: 6px;
}
.nav-left { justify-self: end; margin-right: 5px; }
.nav-right { justify-self: start; margin-left: 5px; }

/* Arrow buttons (thick) */
.btn-arrow {
  width: 58px; height: 58px; border-radius: 999px;
  border: 3px solid var(--reg-accent);
  background: #fff; color: var(--reg-accent);
  display: inline-grid; place-items: center;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: 0 2px 0 rgba(0,0,0,.1);
}
.btn-arrow:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.btn-arrow:active { transform: translateY(0); box-shadow: 0 2px 0 rgba(0,0,0,.1); }
.btn-arrow svg { width: 34px; height: 34px; stroke: var(--reg-accent); stroke-width: 6; fill: none; }

/* Recap actions */
.reg-actions { text-align: center; margin-top: 8px; }
.reg-instruction { margin: 0 0 10px; color: #333; }
.reg-actions .small { margin-top: 8px; font-size: 13px; color: #444; }
.reg-actions .small a.disabled { pointer-events: none; opacity: .6; }

/* Pill-style primary button */
.btn-continue {
  appearance: none;
  border: 0;
  background: var(--reg-accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  padding: 14px 22px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.1);
  transition: transform .08s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn-continue:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.btn-continue:active { transform: translateY(0); box-shadow: 0 2px 0 rgba(0,0,0,.1); }
.btn-continue:focus-visible { outline: 2px dashed #333; outline-offset: 3px; }
.btn-continue[disabled] { opacity: .6; cursor: not-allowed; }

/* Mobile tweaks */
@media (max-width: 640px) {
  .reg-modal { width: 94vw; max-height: 92vh; padding: 16px 16px 18px; }
  .reg-logo { width: 60px; height: 60px; }
}

/* ================= ACCOUNT PAGE ================= */
/* Panel container for in-page modal-like panels (used on /account) */
.page-panel {
  background: #fff;
  border: 0.5px solid var(--ui-border);
  padding: 16px 18px 20px;
}
.page-panel h1 { margin: 0 0 12px; }
.page-panel hr {
  border: 0;
  border-top: 0.5px solid var(--ui-border);
  margin: 16px 0;
}

.account-title { margin: 0 0 12px; }
.account-section { margin-top: 12px; }

/* Temporary until we swap to a class in markup */
#tfa-heading { margin: 0 0 8px; }
