/*
  HealthPassport design tokens.
  See docs/design/DesignSystem.md for the rationale behind these values.
  Every component under Components/Ui and Components/Forms must consume these
  custom properties rather than hardcoding colors, spacing, or type sizes.
*/

:root {
  /* Color — indigo/violet primary + teal secondary + gold accent + neutral surfaces.
     Names are kept from the previous "harbor/foil" palette so components that already
     consume these tokens pick up the new look without any markup changes. */
  --color-harbor: #4338ca;          /* Primary — indigo, replaces the old deep-teal harbor */
  --color-harbor-ink: #1e1b4b;      /* Primary text / deepest gradient stop */
  --color-harbor-hover: #372e9c;
  --color-foil: #eab308;            /* Accent — gold, primary CTA color */
  --color-foil-hover: #ca9a06;
  --color-paper: #f8f9fb;           /* Page background */
  --color-surface: #ffffff;
  --color-mist: #e5e7eb;            /* Borders/dividers */
  --color-slate: #6b7280;           /* Secondary text */

  /* Gradients — hero/cover cards */
  --gradient-primary: linear-gradient(135deg, #1e1b4b 0%, #4338ca 55%, #4f46e5 100%);
  --gradient-secondary: linear-gradient(135deg, #0f766e 0%, #155e75 100%);

  /* Semantic */
  --color-success: #15803d;
  --color-success-bg: #dcfce7;
  --color-warning: #b45309;
  --color-warning-bg: #fef3c7;
  --color-error: #b91c1c;
  --color-error-bg: #fee2e2;

  /* Blood pressure category status pills (AHA-style) — background/text pairs, each
     checked for AA contrast at the small pill text size these render at. */
  --color-status-normal-bg: #dcfce7;
  --color-status-normal-text: #166534;
  --color-status-elevated-bg: #fef9c3;
  --color-status-elevated-text: #854d0e;
  --color-status-stage1-bg: #ffedd5;
  --color-status-stage1-text: #9a3412;
  --color-status-stage2-bg: #fee2e2;
  --color-status-stage2-text: #991b1b;
  --color-status-crisis-bg: #1c1917;
  --color-status-crisis-text: #ffffff;

  /* Typography */
  --font-family-base: "Public Sans", system-ui, -apple-system, sans-serif;
  --font-family-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.75rem;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  --line-height-base: 1.5;

  /* Eyebrow micro-label — small uppercase tracked label used above nearly every section */
  --eyebrow-font-size: 0.7rem;
  --eyebrow-font-weight: 700;
  --eyebrow-letter-spacing: 0.08em;
  --eyebrow-color: var(--color-slate);

  /* Spacing (8px scale) */
  --space-1: 0.25rem; /* 4px  */
  --space-2: 0.5rem; /* 8px  */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.5rem; /* 24px */
  --space-6: 2rem; /* 32px */
  --space-7: 3rem; /* 48px */
  --space-8: 4rem; /* 64px */

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 16px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(30, 27, 75, 0.06);
  --shadow-md: 0 8px 24px rgba(30, 27, 75, 0.10);

  /* Focus ring — must remain visible on every interactive element */
  --focus-ring: 2px solid var(--color-foil);
  --focus-ring-offset: 2px;

  /* Layout — single source of truth for page width, consumed by TopNav's .top-nav__bar,
     MainLayout's .app-shell__content, PageHero, and any full-width section (feature grids,
     LoggedOutHero) via the .layout-container utility below. Nothing should hardcode 72rem or
     its horizontal padding directly — read from these two instead. */
  --layout-max-width: 72rem;
  --layout-gutter: var(--space-5);
}

/*
  Shared box model for anything that needs to line up with the page width: TopNav's
  .top-nav__bar, MainLayout's .app-shell__content, PageHero, and feature/marketing grids all
  apply this alongside their own class. BEM modifiers on those classes should only ever add
  non-width styling from here on.
*/
.layout-container {
  width: 100%;
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
  box-sizing: border-box;
}

/* Respect reduced-motion preferences everywhere */
@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;
  }
}

body {
  background-color: var(--color-paper);
  color: var(--color-harbor-ink);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  margin: 0;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

/* Screen-reader-only content — visually hidden but still announced by assistive tech */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Uppercase micro-label used above section headings ("NEW READING", "CLINICAL GUIDE", etc.) */
.eyebrow {
  display: block;
  font-size: var(--eyebrow-font-size);
  font-weight: var(--eyebrow-font-weight);
  letter-spacing: var(--eyebrow-letter-spacing);
  text-transform: uppercase;
  color: var(--eyebrow-color);
  margin: 0 0 var(--space-2) 0;
}
