/* Cascade Gov, shared foundations for the landing page and the app.
   White, quiet, official. One civic blue does the work; status colours only ever mean status, and they always come
   with an icon and words. Token names follow the brand sprint's Figma variables (color/surface/page and so on), so a
   final colorway can be swapped in here without touching the components. Every text pair meets 4.5:1; every control
   edge meets 3:1. */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/public-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/public-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/public-sans-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  /* color/surface */
  --surface-page: #ffffff;
  --surface-well: #f5f7fa;
  --surface-selected: #edf2fd;
  --surface-brand: #1f55c9;
  /* color/action */
  --action-primary: #1f55c9;
  --action-primary-hover: #173f96;
  /* color/text */
  --text-primary: #1b2430;
  --text-secondary: #535d6e;
  --text-brand: #173f96;
  --text-link: #1f55c9;
  --text-link-hover: #173f96;
  --text-on-brand: #ffffff;
  /* color/border */
  --border-rule: #dfe4eb;
  --border-input: #6b7585;
  --border-brand: #1f55c9;
  /* color/focus */
  --focus-on-light: #1f55c9;
  --focus-on-brand: #ffffff;
  /* color/status: each has a strong colour for icons and words, and a tint for backgrounds */
  --status-ok: #17734a;
  --status-ok-tint: #e8f5ee;
  --status-attention: #8f4a00;
  --status-attention-tint: #fdf3e6;
  --status-error: #b42318;
  --status-error-tint: #fdeceb;
  --status-info: #173f96;
  --status-info-tint: #edf2fd;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-pop: 0 14px 36px rgba(27, 36, 48, .14);
  --shadow-card: 0 1px 2px rgba(27, 36, 48, .06);
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font: 400 1.0625rem/1.55 var(--font);
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
svg { flex: none; }
h1, h2, h3, h4, h5 { line-height: 1.25; margin: 0; color: var(--text-primary); text-wrap: balance; }
p, ul, ol { margin: 0; }
a { color: var(--text-link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--text-link-hover); text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
time { font-variant-numeric: tabular-nums; }

/* Focus is always visible: a thick blue ring that keeps its gap from the control. */
:focus-visible { outline: 3px solid var(--focus-on-light); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
[tabindex="-1"]:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: 10px; z-index: 100; transform: translateY(-200%);
  background: var(--surface-page); color: var(--text-link); font-weight: 600; padding: 10px 14px;
  border: 2px solid var(--border-brand); border-radius: var(--radius);
}
.skip:focus { transform: none; }

/* Brand */
.topline { height: 4px; background: var(--surface-brand); }
.brand {
  display: inline-flex; align-items: center; gap: 10px; color: var(--text-primary); text-decoration: none;
  font-weight: 700; font-size: 1.15rem; letter-spacing: -.005em; white-space: nowrap;
}
.brand:hover { color: var(--text-primary); }
.brand svg { width: 30px; height: 30px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius);
  border: 2px solid var(--action-primary); background: var(--action-primary); color: var(--text-on-brand);
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--action-primary-hover); border-color: var(--action-primary-hover); color: var(--text-on-brand); text-decoration: none; }
.btn svg { width: 18px; height: 18px; }
.btn-secondary { background: var(--surface-page); color: var(--text-link); }
.btn-secondary:hover { background: var(--surface-selected); color: var(--text-link-hover); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--text-link); text-decoration: underline; text-underline-offset: 3px; padding-inline: 8px; }
.btn-quiet:hover { background: var(--surface-selected); border-color: transparent; color: var(--text-link-hover); }
.btn-danger { background: var(--status-error); border-color: var(--status-error); }
.btn-danger:hover { background: #8f1c13; border-color: #8f1c13; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: .9375rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.btn:disabled:hover, .btn[aria-disabled="true"]:hover { background: var(--action-primary); border-color: var(--action-primary); }
.btn-secondary:disabled:hover, .btn-secondary[aria-disabled="true"]:hover { background: var(--surface-page); }

/* Form fields. Edges use the darker input border so the field itself meets 3:1. */
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 600; }
.optional { font-weight: 400; color: var(--text-secondary); }
.hint { color: var(--text-secondary); font-size: .9375rem; }
input[type="text"], input[type="search"], select, textarea {
  min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--border-input); border-radius: 6px;
  background: var(--surface-page); max-width: 100%;
}
select { padding-right: 32px; }
input[type="checkbox"], input[type="radio"] { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--action-primary); flex: none; }

/* Status words with an icon. Never colour alone. */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 99px;
  font-size: .875rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: var(--surface-well); color: var(--text-primary); border: 1px solid transparent;
}
.badge svg { width: 16px; height: 16px; }
.badge.ok { background: var(--status-ok-tint); color: var(--status-ok); }
.badge.attention { background: var(--status-attention-tint); color: var(--status-attention); }
.badge.error { background: var(--status-error-tint); color: var(--status-error); }
.badge.info { background: var(--status-info-tint); color: var(--status-info); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* Windows contrast themes: keep edges and focus visible when backgrounds are flattened. */
@media (forced-colors: active) {
  .btn, .badge, input, select, textarea { border: 2px solid ButtonText; }
  :focus-visible { outline-color: Highlight; }
  .topline { background: CanvasText; }
}
