/* How It Works Page — Evident ICU
   Copyright (c) 2026 Evident Technologies LLC. All rights reserved. */

/* ── Page Surface ─────────────────────────────────────────────────────── */

.how-it-works-page {
  --hiw-radius: 0.875rem;
  --hiw-gap: clamp(2rem, 4vw, 3.5rem);
  --hiw-panel-bg: var(--color-surface, #fff);
  --hiw-panel-border: var(--color-border, #e5e7eb);
  --hiw-alt-bg: color-mix(in srgb, var(--color-primary, #1f3a99) 4%, white);
  --hiw-text: var(--color-text-primary, #1f2937);
  --hiw-text-muted: var(--color-text-secondary, #6b7280);
  --hiw-accent: var(--color-primary, #1f3a99);
  --hiw-gold: var(--color-accent, #f7b32b);
}

@media (prefers-color-scheme: dark) {
  .how-it-works-page {
    --hiw-panel-bg: var(--color-surface-dark, #0f172a);
    --hiw-panel-border: var(--color-border-dark, #1e293b);
    --hiw-alt-bg: color-mix(in srgb, var(--color-primary, #1f3a99) 8%, #0f172a);
    --hiw-text: var(--color-text-light, #e2e8f0);
    --hiw-text-muted: var(--color-text-secondary-dark, #94a3b8);
    --hiw-accent: var(--color-primary-light, #4a65d9);
  }
}

/* ── Header ───────────────────────────────────────────────────────────── */

.hiw-header {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3rem);
  text-align: center;
}

.hiw-header__inner {
  width: min(calc(100% - 2rem), 72ch);
  margin: 0 auto;
}

.hiw-header__title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--hiw-text);
  margin: 0 0 1rem;
}

.hiw-header__sub {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.65;
  color: var(--hiw-text-muted);
  margin: 0;
}

/* ── Sections ─────────────────────────────────────────────────────────── */

.hiw-section {
  padding: var(--hiw-gap) 0;
}

.hiw-section--alt {
  background: var(--hiw-alt-bg);
}

.hiw-section__inner {
  width: min(calc(100% - 2rem), 960px);
  margin: 0 auto;
}

.hiw-section__heading {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  color: var(--hiw-text);
  margin: 0 0 0.5rem;
}

.hiw-section__lead {
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  line-height: 1.65;
  color: var(--hiw-text-muted);
  margin: 0 0 2rem;
  max-width: 68ch;
}

/* ── Pillars (3-column grid) ──────────────────────────────────────────── */

.hiw-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.25rem, 2vw, 2rem);
}

@media (width >= 900px) {
  .hiw-pillars {
    grid-template-columns: repeat(3, 1fr);
  }
}

.hiw-pillar {
  padding: 1.5rem;
  border: 1px solid var(--hiw-panel-border);
  border-radius: var(--hiw-radius);
  background: var(--hiw-panel-bg);
}

.hiw-pillar__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hiw-accent);
  margin: 0 0 0.75rem;
}

.hiw-pillar__body {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--hiw-text-muted);
  margin: 0;
}

/* ── Pipeline Steps (numbered timeline) ───────────────────────────────── */

.hiw-pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  counter-reset: hiw-step;
}

.hiw-pipeline__step {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--hiw-panel-border);
  border-radius: var(--hiw-radius);
  background: var(--hiw-panel-bg);
  transition: border-color 200ms ease;
}

.hiw-pipeline__step:hover {
  border-color: var(--hiw-accent);
}

.hiw-pipeline__num {
  flex: 0 0 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--hiw-accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hiw-pipeline__content {
  flex: 1 1 auto;
  min-width: 0;
}

.hiw-pipeline__content strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--hiw-text);
  margin-bottom: 0.35rem;
}

.hiw-pipeline__content span {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--hiw-text-muted);
}

/* ── Chain of Custody Table ───────────────────────────────────────────── */

.hiw-coc-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--hiw-panel-border);
  border-radius: var(--hiw-radius);
  background: var(--hiw-panel-bg);
}

.hiw-coc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.hiw-coc-table__caption {
  padding: 1rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--hiw-text-muted);
  text-align: left;
  border-bottom: 1px solid var(--hiw-panel-border);
}

.hiw-coc-table th,
.hiw-coc-table td {
  padding: 0.75rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--hiw-panel-border);
}

.hiw-coc-table th {
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hiw-text-muted);
  background: color-mix(in srgb, var(--hiw-accent) 4%, var(--hiw-panel-bg));
}

.hiw-coc-table td {
  color: var(--hiw-text);
}

.hiw-coc-table td code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  color: var(--hiw-accent);
}

.hiw-coc-table tr:last-child td {
  border-bottom: none;
}

.hiw-coc-note {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--hiw-text-muted);
  margin: 1.25rem 0 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--hiw-gold);
  background: color-mix(in srgb, var(--hiw-gold) 6%, var(--hiw-panel-bg));
  border-radius: 0 var(--hiw-radius) var(--hiw-radius) 0;
}

/* ── Export Contents List ─────────────────────────────────────────────── */

.hiw-export-contents {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.hiw-export-contents li {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--hiw-panel-border);
  border-radius: var(--hiw-radius);
  background: var(--hiw-panel-bg);
}

.hiw-export-contents li strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--hiw-text);
  margin-bottom: 0.35rem;
}

.hiw-export-contents li span {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--hiw-text-muted);
}

.hiw-export-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (width <= 640px) {
  .hiw-header {
    padding: 2rem 0 1.5rem;
  }

  .hiw-section {
    padding: 2rem 0;
  }

  .hiw-pillars {
    grid-template-columns: 1fr;
  }

  .hiw-pipeline__step {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hiw-coc-table th,
  .hiw-coc-table td {
    padding: 0.6rem 0.85rem;
    font-size: 0.8125rem;
  }

  .hiw-export-cta {
    flex-direction: column;
  }
}