:root {
  color-scheme: light dark;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --primary: #0047ab;
  --primary-hover: #003b8f;
  --primary-soft: #e6eeff;
  --surface: #ffffff;
  --background: #f4f7fb;
  --text: #172033;
  --muted: #5c6679;
  --border: #dbe3ef;
  --danger: #a32828;
  --danger-soft: #fdecec;
  --shadow: 0 20px 54px rgb(0 71 171 / 14%);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 5%, rgb(0 71 171 / 10%), transparent 28rem),
    var(--background);
}

.auth-page {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  background: #172033;
  border-radius: 10px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 5;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner,
.footer-inner {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
}

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-link {
  flex: none;
  text-decoration: none;
}

.site-nav,
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.site-nav a,
.footer-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
  border-radius: 9px;
}

.site-nav a {
  padding: 9px 10px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.site-nav a:focus-visible,
.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--primary);
  background: var(--primary-soft);
  outline: none;
}

.site-nav a:focus-visible,
.footer-nav a:focus-visible,
.document-content a:focus-visible,
.table-of-contents a:focus-visible,
.site-footer a:focus-visible {
  box-shadow: 0 0 0 3px rgb(0 71 171 / 30%);
}

button,
a {
  font: inherit;
}

.page-shell {
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 64px) 24px;
}

.result-card {
  width: min(100%, 520px);
  padding: clamp(28px, 7vw, 48px);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
}

.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.status-icon {
  display: grid;
  width: 84px;
  height: 84px;
  margin: 36px auto 24px;
  place-items: center;
  color: var(--primary);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
  background: var(--primary-soft);
  border-radius: 50%;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.result-message {
  max-width: 38ch;
  margin: 18px auto 30px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.primary-action {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  color: #ffffff;
  font-weight: 750;
  text-decoration: none;
  background: var(--primary);
  border-radius: 15px;
  transition:
    background-color 160ms ease,
    transform 160ms ease;
}

.primary-action:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.primary-action:focus-visible {
  outline: 3px solid rgb(0 71 171 / 35%);
  outline-offset: 4px;
}

.primary-action:active {
  transform: translateY(0);
}

.supporting-copy {
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

body[data-state="expired"] .status-icon,
body[data-state="error"] .status-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

body[data-state="expired"] .eyebrow,
body[data-state="error"] .eyebrow {
  color: var(--danger);
}

.site-footer {
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: grid;
  gap: 12px;
  padding-block: 28px;
}

.footer-nav a {
  padding: 6px 8px;
}

.site-footer p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.6;
}

.site-footer a,
.document-content a,
.table-of-contents a {
  color: var(--primary);
  text-underline-offset: 0.16em;
}

.legal-shell {
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
  padding-block: clamp(36px, 7vw, 80px);
}

.legal-document {
  padding: clamp(24px, 6vw, 64px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.document-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.document-header h1 {
  max-width: 22ch;
}

.document-summary {
  max-width: 68ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.table-of-contents {
  margin: 30px 0 42px;
  padding: 22px 24px;
  background: var(--primary-soft);
  border-radius: 18px;
}

.table-of-contents p {
  margin: 0 0 10px;
  color: var(--text);
  font-weight: 800;
}

.table-of-contents ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 28px;
  margin: 0;
  padding-left: 22px;
}

.table-of-contents li {
  padding-left: 2px;
}

.table-of-contents a {
  line-height: 1.55;
}

.document-content {
  color: var(--text);
}

.document-content h2,
.document-content h3 {
  scroll-margin-top: 24px;
}

.document-content h2 {
  margin: 52px 0 18px;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.document-content h2:first-child {
  margin-top: 8px;
}

.document-content h3 {
  margin: 34px 0 14px;
  font-size: 1.2rem;
  line-height: 1.35;
}

.document-content p,
.document-content li {
  line-height: 1.75;
}

.document-content p {
  margin: 0 0 18px;
}

.document-content ul,
.document-content ol {
  margin: 0 0 22px;
  padding-left: 24px;
}

.document-content li + li {
  margin-top: 8px;
}

.document-meta {
  margin-bottom: 6px !important;
  color: var(--muted);
  font-size: 0.9rem;
}

.document-content code {
  padding: 0.12em 0.36em;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.92em;
  background: var(--primary-soft);
  border-radius: 5px;
}

.table-scroll {
  max-width: 100%;
  margin: 24px 0 30px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.table-scroll:focus-visible {
  outline: 3px solid rgb(0 71 171 / 30%);
  outline-offset: 3px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.55;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text);
  font-weight: 800;
  background: var(--primary-soft);
}

tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 480px) {
  .header-inner {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding-block: 16px;
  }

  .site-nav {
    margin-inline: -6px;
  }

  .page-shell {
    align-items: center;
    padding: 12px;
  }

  .result-card {
    padding: 30px 22px calc(24px + env(safe-area-inset-bottom));
    border-radius: 24px;
  }

  .status-icon {
    width: 76px;
    height: 76px;
    margin-top: 30px;
  }

  .legal-shell {
    width: min(100% - 20px, 1040px);
    padding-block: 18px;
  }

  .legal-document {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .table-of-contents ol {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #adc6ff;
    --primary-hover: #c8d9ff;
    --primary-soft: #18345f;
    --surface: #121a28;
    --background: #0b111c;
    --text: #f5f7fb;
    --muted: #b8c2d2;
    --border: #2b3749;
    --danger: #ffb4ab;
    --danger-soft: #4b2224;
    --shadow: 0 20px 54px rgb(0 0 0 / 28%);
  }

  body {
    background:
      radial-gradient(circle at 8% 5%, rgb(0 71 171 / 22%), transparent 28rem),
      var(--background);
  }

  .primary-action {
    color: #002e6d;
  }
}
