/* Modernist — design-system tokens and component classes. This file is the source of truth for the system's look; retune it here and see readme.md. */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;600;800&display=swap');

:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  --color-accent: #0d3b66;
  --color-accent-2: #14528c;
  --color-divider: color-mix(in srgb, #201e1d 40%, transparent);
  --color-topbar-bg: #0d3b66;
  --color-topbar-text: #f3f2f2;
  --logo-filter: none;

  /* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f8f4f4;
  --color-neutral-200: #eae7e7;
  --color-neutral-300: #d7d3d3;
  --color-neutral-400: #bab6b6;
  --color-neutral-500: #9b9797;
  --color-neutral-600: #7d7979;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;
  --color-neutral-900: #2d2b2b;

  --color-accent-100: #eaf1f8;
  --color-accent-200: #cfe0ef;
  --color-accent-300: #a3c4e0;
  --color-accent-400: #6ea3cc;
  --color-accent-500: #14528c;
  --color-accent-600: #0d3b66;
  --color-accent-700: #092b4a;
  --color-accent-800: #061d33;
  --color-accent-900: #04121f;

  --color-accent-2-100: #eaf1f8;
  --color-accent-2-200: #cfe0ef;
  --color-accent-2-300: #a3c4e0;
  --color-accent-2-400: #6ea3cc;
  --color-accent-2-500: #2e6ba3;
  --color-accent-2-600: #1e527f;
  --color-accent-2-700: #163d5f;
  --color-accent-2-800: #0f2b42;
  --color-accent-2-900: #0a1c2c;

  --font-heading: "Archivo", system-ui, sans-serif;
  --font-heading-weight: 800;
  --font-body: "Archivo", system-ui, sans-serif;

  --space-1: 4.0px;
  --space-2: 8.0px;
  --space-3: 12.0px;
  --space-4: 16.0px;
  --space-6: 24.0px;
  --space-8: 32.0px;

  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;

  /* Elevation — derived from the ground: soft ink-tinted shadows on a
     light theme, a hairline edge + ambient darkness on a dark one. */
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);
}

/* — dark theme — same roles, inverted ground, brightened accent for contrast — */
[data-theme="dark"] {
  --color-bg: #12181f;
  --color-surface: #1c242e;
  --color-text: #eef1f5;
  --color-accent: #4d9ae0;
  --color-accent-2: #7cb8ec;
  --color-divider: color-mix(in srgb, #eef1f5 22%, transparent);
  --color-topbar-bg: #0a1420;
  --color-topbar-text: #eef1f5;
  --logo-filter: brightness(0) invert(1);

  --color-neutral-100: #0a1420;
  --color-neutral-200: #141d28;
  --color-neutral-300: #202a37;
  --color-neutral-400: #303c4b;
  --color-neutral-500: #48566a;
  --color-neutral-600: #647385;
  --color-neutral-700: #8b97a6;
  --color-neutral-800: #bcc4cd;
  --color-neutral-900: #e7eaee;

  --color-accent-100: #0a1c2c;
  --color-accent-200: #0f2b42;
  --color-accent-300: #163d5f;
  --color-accent-400: #1e527f;
  --color-accent-500: #2e6ba3;
  --color-accent-600: #4d9ae0;
  --color-accent-700: #7cb8ec;
  --color-accent-800: #b3d6f5;
  --color-accent-900: #e3f0fb;

  --color-accent-2-100: #0a1c2c;
  --color-accent-2-200: #0f2b42;
  --color-accent-2-300: #163d5f;
  --color-accent-2-400: #1e527f;
  --color-accent-2-500: #4d9ae0;
  --color-accent-2-600: #7cb8ec;
  --color-accent-2-700: #a9d1f2;
  --color-accent-2-800: #cfe6f8;
  --color-accent-2-900: #edf6fc;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #000 40%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #000 45%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #000 55%, transparent);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

.grayscale{filter:grayscale(1) contrast(1.08)}

/* ══════════════════════════════════════════════════════════════════════════
   Components — built with the tokens above. Plain CSS
   on plain HTML: no JavaScript, no build step. Each class is documented in
   readme.md and demonstrated in foundations/ and components/.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; }
h6 { letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px; margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — rules — */
.hr {
  height: 2px; border: 0; margin: var(--space-4) 0;
  background: var(--color-divider);
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text); /* matches the .input's 14px —
     the pair sits side by side in sign-up rows */
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); justify-content: flex-start; text-align: left; }

/* — forms — */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.seg-check .seg-opt .dot {
  width: 16px; height: 16px; flex: none; border-radius: 3px; border: 1.5px solid currentColor;
  position: relative; opacity: 0.7;
}
.seg-check .seg-opt input:checked + .dot { opacity: 1; }
.seg-check .seg-opt input:checked + .dot::after {
  content: ""; position: absolute; left: 3px; top: 0px; width: 5px; height: 9px;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--color-divider);
}
@media (max-width: 860px) {
  .nav { gap: var(--space-3) var(--space-2); padding: var(--space-2) var(--space-3); }
  .nav a { font-size: 13px; }
}
@media (max-width: 560px) {
  .nav { justify-content: center; }
}
@media (max-width: 700px) {
  .svc-mega { grid-template-columns: 1fr !important; left: 0 !important; transform: none !important; min-width: 92vw !important; max-height: 70vh; overflow-y: auto; }
  .svc-mega > div { border-right: none !important; border-bottom: 1px solid var(--color-divider); }
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }

/* — mobile nav toggle (hamburger) — */
.nav-toggle {
  display: none;
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  padding: 6px; color: inherit;
  align-items: center; justify-content: center;
}
.nav-toggle svg { display: block; }
@media (max-width: 860px) {
  .nav { position: relative; justify-content: flex-start; }
  /* Explicit ordering keeps [logo][lang/theme][hamburger] together on row 1
     in both collapsed and open states. Everything else defaults to order:0
     with flex-basis:100%, so flex-wrap forces each onto its own full-width
     line below row 1 regardless of DOM position. */
  .nav > a:first-child { order: -2; }
  .nav > div[style*="border-right"] { order: -1; }
  .nav-toggle { display: inline-flex; order: 0; margin-left: 4px; }
  .nav > *:not(:first-child):not(.nav-toggle):not(div[style*="border-right"]) {
    flex-basis: 100%;
    display: none !important;
  }
  .nav.nav-open > *:not(:first-child):not(.nav-toggle):not(div[style*="border-right"]) {
    display: flex !important;
  }
  .nav.nav-open > a:not(:first-child) { padding: 10px 4px; border-bottom: 1px solid var(--color-divider); }
  /* phone icon link: dropped from the mobile menu itself (Check
     Availability / the floating call button already cover calling).
     The :not(:first-child) repeat matches the generic show-when-open
     rule's specificity so this override actually wins. */
  .nav.nav-open > a[href^="tel:"]:not(:first-child):not(.nav-toggle) {
    display: none !important;
  }
  /* the lang/theme toggle row: kept visible next to the hamburger at all
     times (open or collapsed) instead of being buried inside the dropdown
     — its desktop-only border-right divider is dropped since it no longer
     sits inline before another nav item. margin-left:auto pushes this pair
     (it + the toggle button) over to the right, past the logo, as a unit. */
  .nav > div[style*="border-right"] {
    display: flex !important;
    margin-left: auto !important;
    border-right: none !important;
    padding-right: 8px !important;
  }
  .nav.nav-open .svc-mega { position: static !important; margin-top: 0 !important; border: none !important; box-shadow: none !important; min-width: 0 !important; }
  /* nested Services flyout (provider-detail pages): the desktop version
     opens level 2 to the right of level 1 via left:100%, which pushes it
     off-screen on a narrow viewport — stack both levels in place instead. */
  .nav.nav-open .svc-flyout-l1 {
    position: static !important; margin-top: 8px !important;
    box-shadow: none !important; width: 100% !important;
  }
  .nav.nav-open .svc-flyout-l2 {
    position: static !important; left: auto !important; margin-left: 0 !important;
    box-shadow: none !important; width: 100% !important; max-height: none !important;
  }
}

/* — mobile section fixes: stack two-column layouts that otherwise overflow.
   Targeted via a class added at the same time as the inline style (rather
   than an attribute-substring selector) because the dc-runtime re-serializes
   inline styles it touches — "44px 1fr auto" can render back to the DOM as
   "44px 1fr auto" with different internal spacing, which breaks [style*=]
   matching unpredictably. A class is immune to that. — */
@media (max-width: 700px) {
  .mobile-stack-cols {
    grid-template-columns: 1fr !important;
  }
  .mobile-provider-row {
    grid-template-columns: 44px 1fr !important;
  }
  .mobile-provider-row > *:last-child {
    grid-column: 1 / -1 !important;
    margin-top: var(--space-3);
  }
  footer > div:last-child { padding-bottom: 76px; }
}

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 2px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body { font-size: 14px; opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

