/* ==========================================================================
   Bankmed — base.css
   Reset, design tokens, typography and utilities.
   Palette sourced from specifications/Color-Palette.png + Visual Identity book.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand / primary */
  --color-primary: #1769DF;
  --color-primary-light: #E7F1FF;
  --color-primary-dark: #023470;
  --color-secondary: #01A1FF;
  --color-secondary-light: #E6F5FF;
  --color-secondary-dark: #004CC6;
  --color-brand-navy: #19468D; /* logo Pantone 286C */

  /* Surfaces */
  --surface: #FFFFFF;
  --bg: #F4F6F9;
  --bg-alt: #EEF3FA;

  /* Text */
  --text-primary: #1C1F26;
  --text-secondary: #6B7280;
  --text-contrast: #FFFFFF;

  /* Status */
  --success: #2AEB45;
  --success-light: #E6FDEB;
  --success-dark: #1BBE35;
  --warning: #D9A441;
  --warning-light: #F7E4B8;
  --warning-dark: #9B6B18;
  --error: #D2232A;
  --error-light: #F3D5D1;
  --error-dark: #8A3E35;

  /* Accents (secondary brand palette) */
  --accent-green: #48B862;
  --accent-purple: #832887;
  --accent-grey: #878787;

  /* Typography */
  --font-heading: "Montserrat", "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3rem;
  --fs-4xl: 3.75rem;

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.65;

  /* Spacing scale (8px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(16, 33, 64, 0.06);
  --shadow-sm: 0 2px 8px rgba(16, 33, 64, 0.08);
  --shadow-md: 0 8px 24px rgba(16, 33, 64, 0.10);
  --shadow-lg: 0 18px 48px rgba(16, 33, 64, 0.16);

  /* Layout */
  --container: 1200px;
  --container-wide: 1320px;
  --header-h: 112px;
  --header-h-scrolled: 72px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.28s;

  --focus-ring: 0 0 0 3px rgba(23, 105, 223, 0.35);
}

@media (max-width: 760px) {
  :root {
    --container: calc(100% - 40px);
    --container-wide: 100%;
  }
}

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

* { margin: 0; }

html {
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h-scrolled) + 16px);
}

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

ul, ol { list-style: none; padding: 0; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, var(--fs-4xl)); }
h2 { font-size: clamp(1.6rem, 3.4vw, var(--fs-2xl)); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }

p { color: var(--text-secondary); }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: 820px; }

.section { padding-block: var(--space-8); }
.section--tight { padding-block: var(--space-7); }
.section--alt { background: var(--surface); }
.section--brand { background: var(--color-primary-light); }
.section--navy {
  background: linear-gradient(135deg, var(--color-brand-navy), var(--color-primary-dark));
  color: var(--text-contrast);
}
.section--navy h1,
.section--navy h2,
.section--navy h3,
.section--navy h4 { color: var(--text-contrast); }
.section--navy p { color: rgba(255, 255, 255, 0.82); }

/* ---------- Section header ---------- */
.section-head { max-width: 720px; margin-bottom: var(--space-6); }
.section-head--center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.section--navy .eyebrow { color: var(--color-secondary); }
.section-head p { margin-top: var(--space-3); font-size: var(--fs-md); }

/* ---------- Utilities ---------- */
.lead { font-size: var(--fs-md); color: var(--text-secondary); line-height: var(--lh-normal); }
.text-center { text-align: center; }
.muted { color: var(--text-secondary); }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.flow > * + * { margin-top: var(--space-4); }

.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-link {
  position: absolute;
  left: var(--space-4);
  top: -60px;
  z-index: 1200;
  background: var(--color-primary-dark);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--space-4); color: #fff; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35em 0.8em;
  border-radius: var(--radius-pill);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.badge--success { background: var(--success-light); color: var(--success-dark); }
.badge--warning { background: var(--warning-light); color: var(--warning-dark); }
.badge--accent { background: #F1E4F2; color: var(--accent-purple); }

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
