/* ==========================================================================
   Beirut Diagnostic Center — base: tokens, type, layout, shared components
   Palette taken from the BDC flyer: navy ink, royal blue, teal, blue-white ground.
   ========================================================================== */

:root {
  --ink: #101a4e;
  --ink-2: #34416c;
  --muted: #5d6a8d;
  --blue: #1947c4;
  --blue-strong: #1336a0;
  --blue-soft: #e8eefc;
  --teal: #14a3b5;
  --teal-ink: #0a7584;
  --teal-soft: #e1f5f7;
  --ground: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --line: #dce3f0;
  --line-strong: #c3cee3;
  --on-accent: #ffffff;
  --wa: #0d7a41;
  --wa-strong: #0a6334;
  --ok: #1b7f57;
  --ok-soft: #e2f3ea;
  --danger: #a8452a;
  --footer: #0c1440;
  --footer-ink: #d9e1fb;
  --footer-muted: #93a0cb;
  --shadow-1: 0 1px 2px rgb(16 26 78 / 0.06);
  --shadow-2: 0 1px 2px rgb(16 26 78 / 0.05), 0 14px 32px -18px rgb(16 26 78 / 0.28);
  --shadow-3: 0 24px 60px -24px rgb(16 26 78 / 0.38);
  --grad-word: linear-gradient(180deg, #2f7fe6 0%, #1947c4 55%, #122f93 100%);

  --font-display: "Urbanist", "Segoe UI", system-ui, sans-serif;
  --font-body: "Urbanist", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Urbanist", "Segoe UI", system-ui, sans-serif; /* numbers use tabular figures */

  --step--1: 0.875rem;
  --step-0: 1.0625rem; /* Urbanist runs small */
  --step-1: 1.1875rem;
  --step-2: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem);
  --step-4: clamp(2.5rem, 1.6rem + 3.9vw, 4.6rem);

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1200px;
  --header-h: 72px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8edff; --ink-2: #c4cdec; --muted: #9aa6ca;
    --blue: #7aa0ff; --blue-strong: #9ab7ff; --blue-soft: #18234f;
    --teal: #3fcbdb; --teal-ink: #6fdbe7; --teal-soft: #0e2d3a;
    --ground: #0a1030; --surface: #111a41; --surface-2: #151f4b;
    --line: #26325f; --line-strong: #36447a; --on-accent: #07102e;
    --wa: #37c77a; --wa-strong: #5bd894; --ok: #57d39b; --ok-soft: #10392b; --danger: #ff9a7a;
    --footer: #060b24; --footer-ink: #d9e1fb; --footer-muted: #8c98c4;
    --shadow-2: 0 14px 32px -18px rgb(0 0 0 / 0.7); --shadow-3: 0 24px 60px -24px rgb(0 0 0 / 0.8);
    --grad-word: linear-gradient(180deg, #8fc0ff 0%, #6f98ff 60%, #5a7df0 100%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e8edff; --ink-2: #c4cdec; --muted: #9aa6ca;
  --blue: #7aa0ff; --blue-strong: #9ab7ff; --blue-soft: #18234f;
  --teal: #3fcbdb; --teal-ink: #6fdbe7; --teal-soft: #0e2d3a;
  --ground: #0a1030; --surface: #111a41; --surface-2: #151f4b;
  --line: #26325f; --line-strong: #36447a; --on-accent: #07102e;
  --wa: #37c77a; --wa-strong: #5bd894; --ok: #57d39b; --ok-soft: #10392b; --danger: #ff9a7a;
  --footer: #060b24; --footer-ink: #d9e1fb; --footer-muted: #8c98c4;
  --shadow-2: 0 14px 32px -18px rgb(0 0 0 / 0.7); --shadow-3: 0 24px 60px -24px rgb(0 0 0 / 0.8);
  --grad-word: linear-gradient(180deg, #8fc0ff 0%, #6f98ff 60%, #5a7df0 100%);
  color-scheme: dark;
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  font-weight: 500; /* Urbanist regular is light for body copy */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
svg { flex-shrink: 0; }
a { color: var(--blue); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.01em;
}
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0; }
.lede { color: var(--ink-2); font-size: var(--step-1); max-width: 62ch; text-wrap: pretty; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: var(--r-s);
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { display: grid; gap: 12px; margin-block-end: clamp(28px, 4vw, 44px); max-width: 760px; }
.section-head--flush { margin-block-end: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 0.8125rem; font-weight: 700;
  color: var(--teal-ink); letter-spacing: 0.08em; text-transform: uppercase;
}
.eyebrow::before { content: ""; inline-size: 22px; block-size: 2px; background: currentColor; border-radius: 2px; }

/* ---------- icons ---------- */
.i { inline-size: 1.25em; block-size: 1.25em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.25em; }
.i--fill { fill: currentColor; stroke: none; }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-block-size: 46px; padding: 10px 20px;
  border: 1px solid var(--btn-line); border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn:hover { --btn-line: var(--blue); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn--primary { --btn-bg: var(--blue); --btn-fg: var(--on-accent); --btn-line: var(--blue); }
.btn--primary:hover { --btn-bg: var(--blue-strong); --btn-line: var(--blue-strong); }
.btn--wa { --btn-bg: var(--wa); --btn-fg: #fff; --btn-line: var(--wa); }
:root[data-theme="dark"] .btn--wa { --btn-fg: #05210f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn--wa { --btn-fg: #05210f; } }
.btn--wa:hover { --btn-bg: var(--wa-strong); --btn-line: var(--wa-strong); }
.btn--ghost { --btn-bg: transparent; --btn-line: transparent; padding-inline: 12px; }
.btn--ghost:hover { --btn-bg: var(--blue-soft); --btn-line: transparent; }
.btn--sm { min-block-size: 38px; padding: 6px 14px; font-size: 0.9rem; }
.btn .num { font-family: var(--font-mono); font-weight: 400; direction: ltr; unicode-bidi: isolate; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); font-size: 0.8125rem; line-height: 1.5; white-space: nowrap;
}
.code {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted);
  direction: ltr; unicode-bidi: isolate; letter-spacing: 0.01em;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-block-end: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-block-end-color: var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-block-size: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-inline-size: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { inline-size: 46px; block-size: 46px; object-fit: contain; }
.brand-text { display: grid; line-height: 1.25; min-inline-size: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; white-space: nowrap; }
.brand-tag { font-size: 0.78rem; color: var(--teal-ink); white-space: nowrap; }

.nav { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative; padding: 8px 12px; border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-family: var(--font-display); font-size: 0.95rem;
}
.nav a:hover { color: var(--ink); background: var(--blue-soft); }
.nav a[aria-current="page"] { color: var(--blue); font-weight: 700; }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; inset-inline: 12px; bottom: 2px; block-size: 2px; border-radius: 2px;
  background: radial-gradient(circle, var(--teal) 1.2px, transparent 1.6px) 0 0 / 6px 2px repeat-x;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }

@media (max-width: 760px) { .header-actions .btn--wa { display: none; } }
@media (max-width: 1180px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .header-actions { margin-inline-start: auto; }
  .nav.is-open {
    display: grid; position: absolute; inset-inline: 0; top: 100%; gap: 2px;
    padding: 12px var(--gutter) 20px; background: var(--surface); border-block-end: 1px solid var(--line);
    box-shadow: var(--shadow-2);
  }
  .nav.is-open a { padding: 14px 12px; font-size: 1.05rem; border-radius: var(--r-s); }
  .nav.is-open a[aria-current="page"]::after { display: none; }
  .nav.is-open a[aria-current="page"] { background: var(--blue-soft); }
}
@media (max-width: 560px) {
  .brand { gap: 8px; }
  .brand-tag { display: none; }
  .brand-name { font-size: 0.95rem; }
  .brand-mark { inline-size: 40px; block-size: 40px; }
  .header-row { gap: 8px; }
  .header-actions { gap: 6px; }
  .menu-btn { padding-inline: 8px; }
  .brand-name { white-space: normal; line-height: 1.15; }
}

/* ---------- mobile action bar ---------- */
.action-bar { display: none; }
@media (max-width: 760px) {
  body { padding-block-end: 76px; }
  .action-bar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    padding: 10px max(12px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-block-start: 1px solid var(--line);
  }
  .action-bar a {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-block-size: 48px;
    border-radius: 12px; text-decoration: none; font-family: var(--font-display); font-weight: 500; font-size: 0.95rem;
    color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
  }
  .action-bar a.is-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
}

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field label, .field .label { font-family: var(--font-display); font-weight: 500; font-size: 0.95rem; }
.field .hint { font-size: 0.82rem; color: var(--muted); font-weight: 400; }
.input, .textarea {
  inline-size: 100%; min-block-size: 48px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink);
}
.textarea { min-block-size: 96px; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 0.85; }
.field-error { color: var(--danger); font-size: 0.86rem; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 6px 14px; border-radius: 999px; cursor: pointer; font-family: var(--font-display); font-size: 0.9rem; color: var(--ink-2); }
.seg input:checked + label { background: var(--ink); color: var(--ground); }
.seg input:focus-visible + label { outline: 3px solid var(--teal); outline-offset: 1px; }

/* ---------- footer ---------- */
.site-footer { background: var(--footer); color: var(--footer-ink); padding-block: 64px 28px; }
.site-footer a { color: var(--footer-ink); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 0.8fr; gap: 36px; }
.footer-brand { display: grid; gap: 14px; align-content: start; max-width: 36ch; }
/* official logo is designed for light backgrounds, so it sits on a white card */
.footer-logo { justify-self: start; display: block; padding: 14px 18px; background: #fff; border-radius: var(--r-m); }
.footer-logo img { display: block; inline-size: 200px; block-size: auto; }
.footer-brand p { color: var(--footer-muted); }
.site-footer h2 { font-size: 0.8rem; color: var(--footer-muted); font-weight: 500; letter-spacing: 0.08em; margin-block-end: 14px; }
.site-footer h2 { text-transform: uppercase; }
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-list li { display: flex; gap: 10px; align-items: flex-start; }
.footer-list .i { color: #7fdbe6; margin-block-start: 3px; }
.footer-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  margin-block-start: 48px; padding-block-start: 22px; border-block-start: 1px solid rgb(255 255 255 / 0.12);
  color: var(--footer-muted); font-size: 0.86rem;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- page head (inner pages) ---------- */
.page-head { padding-block: clamp(36px, 6vw, 64px) clamp(20px, 3vw, 32px); }
.page-head h1 { font-size: var(--step-3); font-weight: 700; }
.page-head .lede { margin-block-start: 10px; }

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