:root {
  --navy: #1C2A39;
  --navy-hover: #2C3E50;
  --light-navy: #DDE6F0;
  --steel-blue: #8BA5C2;
  --cream: #F9F8F4;
  --cream-variant: #EBE8E1;
  --white: #FFFFFF;
  --body-text: #3A4552;
  --muted: #56606B;
  --terracotta: #A84B2F;
  --badge: #F6E2DA;
  --line: #E4E0D7;
  --success: #2E7D4F;
  --success-surface: #DDEEE3;
  --error: #B3261E;
  --field-line: #D6D2C7;
  --field-line-hover: #B9B4A8;
}

@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("fonts/nunito-regular.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url("fonts/nunito-semibold.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url("fonts/nunito-bold.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("fonts/nunito-extrabold.ttf") format("truetype"); }

/* The colors come first in the stylesheet, written from shared's Palette by the build. */
:root {
  --radius-pill: 999px;
  --radius-field: 14px;
  --radius-card: 24px;
  --radius-panel: 28px;
  --field-border: 1.5px solid var(--field-line);
  --focus-ring: 3px solid var(--steel-blue);
  --quick: 150ms ease;
  --fade: 180ms ease;

  --gutter: 20px;
  --page-width: 1200px;
}

/* Every file switches layout at 860px; a media query cannot read a custom property. */
@media (min-width: 860px) {
  :root { --gutter: 48px; }
}

*, *::before, *::after { box-sizing: border-box; }

/* Going between pages crossfades them, where the browser can, instead of drawing the next one from blank. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--navy);
  font: 400 1.0625rem/1.6 "Nunito", system-ui, sans-serif;
}

main { flex: 1; }

h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.125rem, 1.2rem + 3vw, 3.75rem); line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem); }
h3 { font-size: 1.0625rem; }
p { margin: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

[hidden] { display: none !important; }

.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }
.muted { color: var(--muted); }

.eyebrow {
  margin-bottom: 16px;
  color: var(--terracotta);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead { margin-top: 20px; color: var(--muted); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.7; max-width: 40em; }

@media (max-width: 859px) {
  .wide-only { display: none !important; }
}

@media (min-width: 860px) {
  .narrow-only { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.container { width: 100%; max-width: calc(var(--page-width) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.site-header { padding-block: 22px; }
.site-header-ruled { border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.01em; }

.badge {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--badge);
  color: var(--terracotta);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-footer { border-top: 1px solid var(--line); padding-block: 36px; }
.site-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.footer-email { color: var(--muted); text-decoration: none; }

.band { padding-block: 64px; }
.band-white { background: var(--white); border-block: 1px solid var(--line); }
.band-compact { padding-block: 40px; }

@media (max-width: 859px) {
  .site-footer .footer-links { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
}

@media (min-width: 860px) {
  .site-header { padding-block: 28px; }
  .band { padding-block: 88px; }
  .band-compact { padding-block: 56px; }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 32px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--quick), transform var(--quick);
}
.button:active { transform: scale(0.98); }
.button-primary { background: var(--navy); color: var(--white); }
.button-primary:hover { background: var(--navy-hover); }
.button-secondary { background: var(--white); border: var(--field-border); color: var(--navy); }
.button-secondary:hover { background: var(--cream); }
.button-small { min-height: 44px; padding: 0 22px; font-size: 0.9375rem; }
.button-block { width: 100%; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 28px 30px; }
.card h2 { font-size: 1.25rem; }
.card h2 + p { margin-top: 10px; }
.card-dark { background: var(--navy); border-color: var(--navy); color: var(--white); }
.card-dark p { color: color-mix(in srgb, var(--white) 82%, transparent); }
.card-dark a { color: var(--white); }

.field { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
.field-label { display: block; margin-bottom: 8px; padding: 0; font-size: 0.9375rem; font-weight: 700; }
.field-hint { color: var(--muted); font-size: 0.9375rem; font-weight: 400; }

input:not([type="radio"]), textarea {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: var(--field-border);
  border-radius: var(--radius-field);
  background: var(--white);
  color: var(--navy);
  font: inherit;
  box-shadow: 0 0 0 0 var(--light-navy);
  transition: border-color var(--fade), box-shadow var(--fade);
}
textarea { min-height: 120px; padding-block: 14px; resize: vertical; }
/* The ring is a shadow because an outline cannot fade in; the transparent outline is what high
   contrast mode, which drops shadows, draws instead. */
input:not([type="radio"]):focus, textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--light-navy);
  outline: 2px solid transparent;
}

.segments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.segment { position: relative; cursor: pointer; }
.segment input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 8px;
  border: var(--field-border);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-weight: 700;
  white-space: nowrap;
  transition: background-color var(--quick), border-color var(--quick), color var(--quick);
}
.segment input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.segment input:focus-visible + span { outline: var(--focus-ring); outline-offset: 2px; }

@media (hover: hover) {
  .segment:hover input:not(:checked) + span { background: var(--cream); border-color: var(--field-line-hover); }
  .segment:hover input:checked + span { background: var(--navy-hover); border-color: var(--navy-hover); }
}

@media (min-width: 860px) {
  .segments { display: flex; flex-wrap: wrap; }
  .segment span { padding: 0 24px; }
}

.hero { padding-top: 40px; }
.hero-grid { display: grid; gap: 32px; align-items: center; }
.hero .button { margin-top: 32px; }

.hero-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-panel);
  background: var(--cream-variant);
}

.contact-grid { display: grid; gap: 32px; }
.contact-intro h2 { max-width: 12em; }
.contact-intro p { margin-top: 20px; max-width: 30em; }
.contact-intro .button { margin-top: 28px; }
.contact-email { margin-top: 32px; display: flex; flex-direction: column; gap: 4px; }
.contact-email a { font-size: 1.25rem; font-weight: 800; text-decoration: none; }

/* Off screen rather than display: none, which a script filling in forms would skip. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-grid { display: grid; column-gap: 24px; }
.form-error { margin-bottom: 18px; color: var(--error); font-weight: 700; }
.form-actions { display: flex; flex-direction: column; gap: 16px; }
.form-actions .button { width: 100%; }
.form-actions .field-hint { font-size: 0.875rem; }

.receipt { padding-block: 16px; }
.receipt:focus { outline: none; }
.receipt-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success-surface);
  color: var(--success);
}
.receipt-icon .icon { width: 32px; height: 32px; }
.receipt h2 { margin-top: 28px; }
.receipt .lead { color: var(--body-text); }
.receipt .button { margin-top: 28px; }

.notice { padding: 24px 28px; border-radius: 20px; background: var(--light-navy); color: var(--body-text); line-height: 1.6; }
.notice strong { margin-right: 12px; color: var(--navy); }

@media (max-width: 859px) {
  .hero .button { width: 100%; }
  .form-card { padding: 0; border: 0; background: none; }
}

@media (min-width: 860px) {
  .hero { padding-top: 56px; }
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 64px; }
  .contact-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 64px; align-items: start; }
  .form-card { padding: 44px; border-radius: var(--radius-panel); background: var(--cream); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-actions { flex-direction: row; align-items: center; gap: 24px; }
  .form-actions .button { width: auto; flex-shrink: 0; }
}

.legal-layout { display: grid; gap: 48px; padding-block: 44px 72px; }
.legal-article { min-width: 0; max-width: 760px; }
.legal-article h1 { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3rem); }
.legal-meta { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 16px; color: var(--muted); font-size: 0.875rem; }

/* One column for the numbers across the whole list, as wide as the widest (Bilag D), so every title
   starts in line and none is pushed into its number. */
.toc { display: grid; grid-template-columns: auto 1fr; list-style: none; margin: 0; padding: 0; }
.toc li { display: contents; }
.toc a {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  column-gap: 14px;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
  text-decoration: none;
}
.toc a:hover { color: var(--navy); }
.toc a[aria-current="true"] { background: var(--cream-variant); color: var(--navy); font-weight: 700; }
.toc-number { min-width: 1.4em; font-weight: 400; color: var(--muted); white-space: nowrap; }
.toc-label { margin: 0 0 12px 10px; color: var(--muted); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.legal-toc { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; }

/* On a narrow screen: a button that pushes the text down when opened, and hangs at the top showing the
   section being read once it has scrolled away. */
.legal-toc-collapsed {
  position: sticky;
  top: 12px;
  z-index: 5;
  margin-top: 32px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  transition: box-shadow var(--fade);
}
.legal-toc-collapsed.pinned { box-shadow: 0 10px 28px rgb(28 42 57 / 0.1); }
/* Pinned, the list drops down over the text instead of pushing it while it is being read. */
.legal-toc-collapsed.pinned .toc {
  position: absolute;
  top: calc(100% + 6px);
  left: -1.5px;
  right: -1.5px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 10px 28px rgb(28 42 57 / 0.1);
}
/* data-expanded changes at once, where [open] waits for the list to finish folding away. */
.toc-summary-hide, .toc-summary-current { display: none; }
.legal-toc-collapsed[data-expanded] .toc-summary-count,
.legal-toc-collapsed.pinned .toc-summary-count { display: none; }
.legal-toc-collapsed[data-expanded] .toc-summary-hide { display: block; }
.legal-toc-collapsed.pinned:not([data-expanded]) .toc-summary-current { display: flex; gap: 10px; }
.legal-toc-collapsed summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  font-size: 1.125rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.legal-toc-collapsed summary::-webkit-details-marker { display: none; }
.legal-toc-collapsed summary .icon { transition: transform var(--quick); }
/* It flips over rather than turning, so it never points sideways on the way. */
.legal-toc-collapsed[data-expanded] summary .icon { transform: rotateX(180deg); }
.legal-toc-collapsed .toc { padding: 0 12px 14px; }

.legal-body { margin-top: 8px; color: var(--body-text); }
.legal-body h2 { margin: 44px 0 12px; color: var(--navy); font-size: 1.375rem; scroll-margin-top: 24px; }
.legal-body p, .legal-body ul, .legal-body ol { margin: 0 0 14px; }
.legal-body table {
  width: 100%;
  margin: 8px 0 24px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: var(--white);
  font-size: 0.9375rem;
}
.legal-body th, .legal-body td { padding: 16px 20px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-body tr:last-child td { border-bottom: 0; }
.legal-body th, .legal-body td[data-label]::before {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.legal-body td:first-child { color: var(--navy); font-weight: 700; }

/* On a narrow screen each row is a card, every value under its column's header. */
@media (max-width: 859px) {
  .legal-body table, .legal-body tbody, .legal-body tr, .legal-body td { display: block; }
  .legal-body table { border: 0; border-radius: 0; overflow: visible; background: none; }
  .legal-body thead { display: none; }
  .legal-body tr { margin-bottom: 12px; padding: 20px 22px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--white); }
  .legal-body td { padding: 0; border: 0; }
  .legal-body td + td { margin-top: 14px; }
  .legal-body td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; }
  .legal-body td:first-child::before { content: none; }
}
.legal-superseded { margin-top: 24px; padding: 16px 20px; }
.legal-versions { margin-top: 44px; }
.legal-versions ul { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; }
.legal-question { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 56px; padding: 20px 24px; }

@media (min-width: 860px) {
  .legal-layout { grid-template-columns: 220px minmax(0, 1fr); gap: clamp(40px, 6vw, 80px); padding-block: 56px 96px; }
}
