/*
 * Institutional site stylesheet — the only one the tree loads.
 *
 * Palette: every colour below comes from the measured pairs in
 * core/internal/email/templates/style-guide.md §3, so the site and the
 * transactional e-mails read as one product and every text pair is already
 * scored against WCAG 2.2 AA (ADR-059 §4 "Color").
 *
 * No @import, no external font, no third-party request of any kind: the edge
 * ships a strict CSP (ADR-030 §4) and the pages carry no script and no inline
 * style.
 */

:root {
  --page: #f6f9fd;
  --surface: #ffffff;
  --text: #0d0e11;
  --muted: #3b414c;
  --link: #476088;
  --button-bg: #476088;
  --button-text: #ffffff;
  --border: #cdd5e2;
  --band-bg: #476088;
  --band-text: #ffffff;
  --badge-bg: #deebff;
  --badge-text: #2a4166;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/*
 * Dark scheme: the navy dark set of the apps' theme
 * (core frontend/libs/shared-theme/src/styles/palettes/_navy.scss), so a
 * visitor whose system is dark sees the same palette the apps give them.
 */
@media (prefers-color-scheme: dark) {
  :root {
    --page: #040406;
    --surface: #0d0e11;
    --text: #e7eaee;
    --muted: #cdd5e2;
    --link: #bdd6fc;
    --button-bg: #bdd6fc;
    --button-text: #102648;
    --border: #3b414c;
  }
}

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

html {
  font-family: var(--font);
  line-height: 1.55;
  background-color: var(--page);
  color: var(--text);
}

body {
  margin: 0;
  background-color: var(--page);
  color: var(--text);
  font-size: 17px;
}

/* Visible focus on every interactive element (ADR-059 §4 "Focus"). */
a:focus-visible,
button:focus-visible,
.table-scroll:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* Skip link — first focusable element on every page (ADR-059 §4). */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 16px;
  background-color: var(--surface);
  color: var(--link);
  border: 1px solid var(--border);
}

.skip-link:focus {
  left: 8px;
  top: 8px;
  z-index: 10;
}

.wrap {
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 4px;
  margin-right: auto;
}

.brand img {
  display: block;
  height: 40px;
  width: auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--link);
}

/* ---------- Links and buttons ---------- */

a {
  color: var(--link);
}

a:hover {
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 12px 20px;
  border: 1px solid var(--button-bg);
  background-color: var(--button-bg);
  color: var(--button-text);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  text-decoration: underline;
}

.button-secondary {
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--link);
  font-weight: 400;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0 0;
}

/* ---------- Main content ----------
 *
 * Every text pair on this site is a pair the style guide has already scored,
 * which means all text sits on --surface. --page keeps the role that guide
 * gives it: the ground behind the surfaces, with no text on it.
 */

main {
  display: block;
  max-width: 64rem;
  margin: 24px auto;
  background-color: var(--surface);
  border: 1px solid var(--border);
}

.hero {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
}

h1 {
  margin: 0 0 16px 0;
  font-size: 2rem;
  line-height: 1.25;
}

h2 {
  margin: 0 0 12px 0;
  font-size: 1.35rem;
  line-height: 1.3;
}

h3 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  line-height: 1.35;
}

p {
  margin: 0 0 16px 0;
  max-width: 44rem;
}

.lead {
  font-size: 1.1rem;
}

.muted {
  color: var(--muted);
}

section {
  background-color: var(--surface);
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: 0;
}

ul.features {
  margin: 0 0 16px 0;
  padding-left: 1.25rem;
  max-width: 44rem;
}

ul.features li {
  margin-bottom: 8px;
}

/* ---------- Pricing table ---------- */

.table-scroll {
  overflow-x: auto;
  background-color: var(--surface);
  border: 1px solid var(--border);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 40rem;
  background-color: var(--surface);
  color: var(--text);
}

caption {
  text-align: left;
  padding: 16px;
  color: var(--muted);
}

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

thead th {
  border-bottom: 2px solid var(--border);
}

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

/* ---------- Footer ---------- */

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

.site-footer p {
  margin: 0 0 8px 0;
}

.site-footer a {
  display: inline-block;
  min-height: 24px;
  padding: 2px 0;
  color: var(--link);
}

/* ---------- Coming soon ----------
 *
 * The pre-launch landing: one navy band (the apps' primary with its
 * on-primary text) carrying the badge, the heading and the lead. The band
 * keeps the light set's colours in the dark scheme too: white on #476088
 * clears 4.5:1 on either page ground.
 */

.coming-soon {
  background-color: var(--band-bg);
  color: var(--band-text);
  padding: 72px 0;
}

.coming-soon a {
  color: var(--band-text);
}

.badge {
  display: inline-block;
  margin: 0 0 20px 0;
  padding: 4px 12px;
  border-radius: 999px;
  background-color: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.coming-soon .lead {
  max-width: 40rem;
  color: var(--band-text);
}

@media (max-width: 40rem) {
  h1 {
    font-size: 1.6rem;
  }

  .hero {
    padding: 32px 0;
  }

  .brand {
    margin-right: 0;
  }

  main {
    margin: 0;
    border-left: 0;
    border-right: 0;
  }
}
