/* InnoPair Health — shared design system
   One token set, type scale and component vocabulary for every page.
   Page files (landing.css, app.css, onboard.css, assistant.css) only add layout. */

:root {
  /* Neutrals (Tailwind slate) */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --white: #ffffff;

  /* Semantic colors */
  --bg: var(--slate-50);
  --surface: var(--white);
  --surface-muted: var(--slate-50);
  --text: var(--slate-900);
  --text-body: var(--slate-700);
  --text-muted: var(--slate-500);
  --border: var(--slate-200);
  --border-strong: var(--slate-300);

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;

  /* Status — used only for match results */
  --success: #0f766e;
  --success-soft: #f0fdfa;
  --success-border: #99f6e4;
  --warning: #92400e;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;
  --danger: #9f1239;
  --danger-soft: #fff1f2;
  --danger-border: #fecdd3;

  /* Type scale */
  --font-sans: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-xs: 0.75rem;    /* 12 */
  --text-sm: 0.875rem;   /* 14 */
  --text-base: 1rem;     /* 16 */
  --text-lg: 1.125rem;   /* 18 */
  --text-xl: 1.375rem;   /* 22 */
  --text-2xl: 1.75rem;   /* 28 */
  --text-3xl: 2.25rem;   /* 36 */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --tracking-tight: -0.02em;
  --tracking-wide: 0.06em;

  /* Spacing (4px grid) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 12px 32px rgb(15 23 42 / 0.12);
  --ring: 0 0 0 3px rgb(37 99 235 / 0.2);
  --control-height: 2.5rem; /* 40px */

  /* Landing-page language: sky gradients, frosted glass, dark pills, script accents */
  --sky-50: #f0f9ff;
  --sky-100: #e0f2fe;
  --sky-200: #bae6fd;
  --sky-400: #38bdf8;
  --ink-pill: #1e293b;
  --glass: rgb(255 255 255 / 0.72);
  --glass-border: rgb(255 255 255 / 0.9);
  --glass-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 12px 40px rgb(37 99 235 / 0.08);
  --gradient-brand: linear-gradient(90deg, var(--sky-400), var(--primary));
  --font-accent: "Instrument Serif", Georgia, serif;
  --radius-xl: 24px;
}

[hidden] { display: none !important; }

/* Script-italic accent word in headings, as on the landing page */
:is(h1, h2) em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  background: linear-gradient(120deg, var(--primary), #0891b2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}
p { margin: 0; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: var(--space-2);
  z-index: 100;
  transform: translateY(-200%);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { transform: none; color: var(--white); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Typography helpers ---------- */
.eyebrow {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  line-height: var(--leading-normal);
}
.lede {
  color: var(--text-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}
.muted { color: var(--text-muted); }

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-mark {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--primary);
}
.brand-bar { position: absolute; background: var(--white); }
.brand-bar-v { width: 4px; height: 16px; top: 8px; left: 14px; }
.brand-bar-h { width: 16px; height: 4px; top: 14px; left: 8px; }
.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
  font-size: var(--text-lg);
  line-height: 1;
}
.brand-name { font-weight: 700; letter-spacing: var(--tracking-tight); color: var(--text); }
.brand-qualifier { font-weight: 700; letter-spacing: var(--tracking-tight); color: var(--primary); }

/* ---------- Buttons ---------- */
.primary-button,
.outline-button,
.back-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.primary-button { background: var(--ink-pill); border-color: var(--ink-pill); color: var(--white); box-shadow: 0 6px 16px rgb(15 23 42 / 0.16); }
.primary-button:hover { background: var(--primary); border-color: var(--primary); color: var(--white); }
.outline-button,
.back-button { background: rgb(255 255 255 / 0.85); border-color: var(--border-strong); color: var(--text); }
.outline-button:hover,
.back-button:hover { background: var(--white); border-color: var(--primary-border); color: var(--primary-hover); }
.ghost-button { background: transparent; color: var(--text-body); }
.ghost-button:hover { background: var(--slate-100); color: var(--text); }
.primary-button:disabled,
.outline-button:disabled,
.back-button:disabled { opacity: 0.6; cursor: default; }
.button-lg { min-height: 3rem; padding: 0 var(--space-6); font-size: var(--text-base); }
.full-width { width: 100%; }

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.text-button:hover { color: var(--primary-hover); text-decoration: underline; }

.close-button {
  display: inline-grid;
  place-items: center;
  min-width: var(--control-height);
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.close-button:hover { background: var(--slate-100); color: var(--text); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ---------- Badges ---------- */
.result-badge,
.match-badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.125rem var(--space-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--slate-100);
  color: var(--text-body);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.match-badge,
.result-badge.shortlist { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }
.result-badge.missing { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning); }
.result-badge.no { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }

.status-dot,
.live-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

/* ---------- Forms ---------- */
label {
  display: block;
  margin: 0 0 var(--space-2);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  display: block;
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-base);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
input[type="checkbox"], input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  flex: none;
  accent-color: var(--primary);
}

/* ---------- Dialogs & overlays ---------- */
dialog {
  width: min(560px, calc(100% - 2rem));
  max-height: calc(100vh - 4rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-body);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgb(15 23 42 / 0.45); }
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}
.dialog-head h2 { margin-top: var(--space-1); font-size: var(--text-xl); }
.dialog-copy { margin: 0 0 var(--space-6); color: var(--text-body); font-size: var(--text-sm); }

.toast {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-6);
  z-index: 90;
  max-width: min(420px, calc(100vw - 2rem));
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--slate-900);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
