/* ═══════════════════════════════════════════════════════
   KURANYX · styles.css
   Shared stylesheet for index.html and portal.html
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500;600&family=Sora:wght@600;700&display=swap');

/* ── Design tokens ─────────────────────────────────────── */
:root {
  --night:      #0A1130;
  --night-2:    #0E1840;
  --panel:      #131E4D;
  --ink:        #F3F6FF;
  --muted:      #98A4CB;
  --faint:      #6C78A3;
  --teal:       #35D2C3;
  --teal-deep:  #1FB3A6;
  --violet:     #8B7BF5;
  --dawn:       #F0C27A;

  --radius-card: 16px;
  --radius-btn:  8px;

  /* Fluid type scale */
  --text-xs:   clamp(0.68rem,  1.4vw, 0.75rem);
  --text-sm:   clamp(0.82rem,  1.8vw, 0.875rem);
  --text-base: clamp(0.92rem,  2vw,   1rem);
  --text-lg:   clamp(1rem,     2.2vw, 1.125rem);
  --text-xl:   clamp(1.1rem,   2.5vw, 1.25rem);
  --text-2xl:  clamp(1.25rem,  3vw,   1.5rem);
  --text-3xl:  clamp(1.5rem,   4vw,   2rem);
  --text-4xl:  clamp(1.9rem,   5vw,   2.75rem);
  --text-5xl:  clamp(2.4rem,   6.5vw, 3.75rem);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--night);
  min-height: 100vh;
}

img, canvas, svg { display: block; max-width: 100%; }

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-deep); text-decoration: underline; }

/* Accessible focus rings */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Typography helpers ─────────────────────────────────── */
.font-display { font-family: 'Sora', sans-serif; }
.font-mono    { font-family: 'IBM Plex Mono', monospace; }

h1, h2, h3, h4 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--teal);
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 2.5rem);
}

section { padding: clamp(3.5rem, 8vw, 6rem) 0; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.7em 1.45em;
  border-radius: var(--radius-btn);
  font-family: 'Inter', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.12s;
  line-height: 1.3;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: none; }

.btn-primary { background: var(--teal); color: var(--night); }
.btn-primary:hover {
  background: var(--teal-deep);
  color: var(--night);
  box-shadow: 0 4px 24px rgba(53, 210, 195, 0.38);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(139, 123, 245, 0.4);
}
.btn-outline:hover {
  border-color: var(--violet);
  background: rgba(139, 123, 245, 0.08);
  color: var(--ink);
}

.btn-violet {
  background: rgba(139, 123, 245, 0.12);
  color: var(--violet);
  border: 1px solid rgba(139, 123, 245, 0.35);
}
.btn-violet:hover {
  background: rgba(139, 123, 245, 0.2);
  color: var(--violet);
  border-color: var(--violet);
}

/* ── Site header ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10, 17, 48, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(139, 123, 245, 0.14);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 2rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Sora', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.wordmark:hover { color: var(--ink); text-decoration: none; }
.wordmark-icon { width: 28px; height: 28px; flex-shrink: 0; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.site-nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.nav-portal-btn { margin-left: 0.25rem; }

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--ink);
  border-radius: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -15%;
  right: -8%;
  width: 55%;
  height: 85%;
  background: radial-gradient(ellipse at center, rgba(53, 210, 195, 0.07) 0%, transparent 68%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 5%;
  width: 45%;
  height: 55%;
  background: radial-gradient(ellipse at center, rgba(139, 123, 245, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}

.hero-text .eyebrow { margin-bottom: 1.25rem; }

.hero-headline {
  font-size: var(--text-5xl);
  color: var(--ink);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}
.hero-headline em {
  font-style: normal;
  color: var(--teal);
}

.hero-lead {
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 44ch;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.25rem;
}

.hero-tagline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  color: var(--faint);
}
.hero-tagline-heal { color: var(--dawn); }
.hero-tagline-sep {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: rgba(139, 123, 245, 0.3);
}

/* ── Monitor card ────────────────────────────────────────── */
.monitor-card {
  background: var(--panel);
  border: 1px solid rgba(139, 123, 245, 0.22);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  box-shadow:
    0 0 60px rgba(53, 210, 195, 0.05),
    0 24px 64px rgba(0, 0, 0, 0.45);
}

.monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.monitor-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.monitor-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: var(--teal);
}
.monitor-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

.monitor-canvas-wrap {
  aspect-ratio: 800 / 280;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #090e26;
  border: 1px solid rgba(53, 210, 195, 0.07);
  margin-bottom: 0.875rem;
}
#ppg-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.monitor-readouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
.readout {
  text-align: center;
  padding: 0.5rem 0.6rem 0.4rem;
  background: rgba(9, 14, 38, 0.7);
  border-radius: 8px;
  border: 1px solid rgba(139, 123, 245, 0.12);
}
.readout-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-bottom: 2px;
}
.readout-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--teal);
  line-height: 1.1;
  transition: color 0.5s;
}
.readout-value.desat { color: var(--dawn); }
.readout-unit {
  font-size: 0.58rem;
  color: var(--faint);
  font-weight: 400;
}

/* ── Trust ribbon ────────────────────────────────────────── */
.trust-ribbon {
  background: var(--night-2);
  border-top: 1px solid rgba(139, 123, 245, 0.1);
  border-bottom: 1px solid rgba(139, 123, 245, 0.1);
  padding: 1rem 0;
}
.trust-ribbon-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
}
.trust-item {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
}
.trust-sep {
  width: 1px;
  height: 14px;
  background: rgba(139, 123, 245, 0.28);
  flex-shrink: 0;
}

/* ── Section shared ──────────────────────────────────────── */
.section-header { margin-bottom: 3rem; }
.section-header .eyebrow { margin-bottom: 0.75rem; }
.section-title { font-size: var(--text-4xl); margin-bottom: 1rem; }
.section-lead { font-size: var(--text-lg); color: var(--muted); max-width: 56ch; line-height: 1.7; }

/* ── Problem section ─────────────────────────────────────── */
.problem { background: var(--night-2); }

.problem-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.problem-card {
  background: var(--panel);
  border: 1px solid rgba(139, 123, 245, 0.15);
  border-radius: var(--radius-card);
  padding: 1.75rem;
}
.problem-card-icon {
  width: 40px;
  height: 40px;
  color: var(--violet);
  margin-bottom: 1.1rem;
}
.problem-card h3 { font-size: var(--text-xl); margin-bottom: 0.75rem; color: var(--ink); }
.problem-card p  { font-size: var(--text-sm); color: var(--muted); line-height: 1.75; }

/* ── How it works ────────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 2.5rem;
  position: relative;
}
.steps-grid::before {
  content: '';
  position: absolute;
  top: 1.1rem;
  left: calc(33.33% + 1.5rem);
  right: calc(33.33% + 1.5rem);
  height: 1px;
  background: linear-gradient(90deg, rgba(53, 210, 195, 0.15), rgba(53, 210, 195, 0.35), rgba(53, 210, 195, 0.15));
  pointer-events: none;
}

.step {}
.step-num {
  display: inline-flex;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--teal);
  letter-spacing: 0.12em;
  background: rgba(53, 210, 195, 0.08);
  border: 1px solid rgba(53, 210, 195, 0.22);
  border-radius: 20px;
  padding: 0.25em 0.85em;
  margin-bottom: 1.1rem;
}
.step-icon {
  width: 44px;
  height: 44px;
  color: var(--teal);
  margin-bottom: 1.1rem;
}
.step h3 { font-size: var(--text-xl); margin-bottom: 0.75rem; }
.step p  { font-size: var(--text-sm); color: var(--muted); line-height: 1.75; }

/* ── Built for our patients ──────────────────────────────── */
.patients { background: var(--night-2); }

.patients-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}

.patient-points { display: flex; flex-direction: column; gap: 1.75rem; }

.patient-point {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.patient-point-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--teal);
  margin-top: 2px;
}
.patient-point h4 {
  font-family: 'Inter', sans-serif;
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.patient-point p { font-size: var(--text-sm); color: var(--muted); }

.fitzpatrick-visual {
  background: var(--panel);
  border: 1px solid rgba(139, 123, 245, 0.15);
  border-radius: var(--radius-card);
  padding: 2.25rem 2rem;
  text-align: center;
}
.fitzpatrick-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-bottom: 1.75rem;
}
.fitzpatrick-swatches {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.swatch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: transform 0.15s;
  position: relative;
}
.swatch-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.55rem;
  color: var(--faint);
  text-align: center;
  margin-top: 0.3rem;
}
.swatch-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.swatch.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(53, 210, 195, 0.25), 0 0 14px rgba(53, 210, 195, 0.2);
  transform: scale(1.1);
}
.swatch-label.active { color: var(--teal); }
.fitzpatrick-caption {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  color: var(--teal);
  margin-top: 1.25rem;
}
.fitzpatrick-sub {
  font-size: var(--text-xs);
  color: var(--faint);
  margin-top: 0.4rem;
  line-height: 1.6;
}

/* ── Institutions ────────────────────────────────────────── */
.institutions-panel {
  background: var(--night-2);
  border: 1px solid rgba(139, 123, 245, 0.14);
  border-radius: var(--radius-card);
  padding: clamp(2rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}
.inst-eyebrow { margin-bottom: 0.75rem; }
.inst-title { font-size: var(--text-3xl); margin-bottom: 1rem; }
.inst-lead  { font-size: var(--text-base); color: var(--muted); margin-bottom: 1.75rem; line-height: 1.7; }

.inst-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.inst-feature { display: flex; gap: 0.75rem; align-items: flex-start; }
.inst-feature-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--teal);
  margin-top: 2px;
}
.inst-feature p { font-size: var(--text-sm); color: var(--muted); line-height: 1.6; }

/* ── Evidence ─────────────────────────────────────────────── */
.evidence { background: var(--night-2); }

.evidence-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.evidence-card {
  background: var(--panel);
  border: 1px solid rgba(139, 123, 245, 0.15);
  border-radius: var(--radius-card);
  padding: 1.75rem;
}
.evidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3em 0.8em;
  border-radius: 20px;
  margin-bottom: 1rem;
}
.badge-progress {
  background: rgba(240, 194, 122, 0.1);
  color: var(--dawn);
  border: 1px solid rgba(240, 194, 122, 0.28);
}
.badge-inplace {
  background: rgba(53, 210, 195, 0.1);
  color: var(--teal);
  border: 1px solid rgba(53, 210, 195, 0.28);
}
.evidence-card h3 { font-size: var(--text-xl); margin-bottom: 0.75rem; }
.evidence-card p  { font-size: var(--text-sm); color: var(--muted); line-height: 1.75; }

.evidence-disclaimer {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(240, 194, 122, 0.05);
  border: 1px solid rgba(240, 194, 122, 0.22);
  border-radius: var(--radius-card);
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.75;
}
.evidence-disclaimer strong { color: var(--dawn); font-weight: 600; }

/* ── Portal CTA band ─────────────────────────────────────── */
.portal-band {
  text-align: center;
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
  background: linear-gradient(160deg, var(--night-2) 0%, var(--night) 100%);
  border-top: 1px solid rgba(139, 123, 245, 0.12);
  border-bottom: 1px solid rgba(139, 123, 245, 0.12);
  position: relative;
  overflow: hidden;
}
.portal-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(53, 210, 195, 0.06) 0%, transparent 68%);
  pointer-events: none;
}
.portal-band-title {
  font-size: var(--text-4xl);
  margin-bottom: 0.75rem;
  position: relative;
}
.portal-band-sub {
  font-size: var(--text-lg);
  color: var(--muted);
  margin-bottom: 2.25rem;
  position: relative;
}
.portal-band-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}
.btn-band-physician { font-size: var(--text-base); padding: 0.8em 1.75em; }
.btn-band-institution { font-size: var(--text-base); padding: 0.8em 1.75em; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--night-2);
  border-top: 1px solid rgba(139, 123, 245, 0.1);
  padding: clamp(3rem, 7vw, 5rem) 0 2.5rem;
}
.footer-main {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
.footer-brand .wordmark { margin-bottom: 0.75rem; }
.footer-brand-desc {
  font-size: var(--text-sm);
  color: var(--muted);
  max-width: 30ch;
  line-height: 1.7;
}
.footer-brand-tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  color: var(--dawn);
  margin-top: 0.6rem;
}
.footer-col h4 {
  font-family: 'Sora', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.1rem;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.footer-col a {
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--teal); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(139, 123, 245, 0.1);
  padding-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer-copyright {
  font-size: var(--text-xs);
  color: var(--faint);
}
.footer-legal {
  font-size: var(--text-xs);
  color: var(--faint);
  line-height: 1.7;
  max-width: 80ch;
}

/* ══════════════════════════════════════════════════════════
   PORTAL PAGE  (portal.html specific)
   ══════════════════════════════════════════════════════════ */
.portal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--night);
}

.portal-header {
  border-bottom: 1px solid rgba(139, 123, 245, 0.12);
  padding: 1rem 0;
}
.portal-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.portal-back:hover { color: var(--teal); text-decoration: none; }
.portal-back svg { width: 14px; height: 14px; display: inline; }

.portal-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.signin-card {
  background: var(--panel);
  border: 1px solid rgba(139, 123, 245, 0.2);
  border-radius: var(--radius-card);
  padding: clamp(1.75rem, 5vw, 2.75rem);
  width: 100%;
  max-width: 448px;
  box-shadow:
    0 0 80px rgba(139, 123, 245, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.45);
}

.signin-card-title {
  font-size: var(--text-2xl);
  text-align: center;
  margin-bottom: 1.75rem;
}

/* Segmented role toggle */
.role-toggle {
  display: flex;
  background: rgba(9, 14, 38, 0.7);
  border: 1px solid rgba(139, 123, 245, 0.18);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.75rem;
  role: tablist;
}
.role-btn {
  flex: 1;
  padding: 0.55em 1em;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}
.role-btn[aria-selected="true"] {
  background: var(--teal);
  color: var(--night);
  font-weight: 600;
}

/* Form panels */
.form-panel { display: none; }
.form-panel.is-active { display: block; }

.signin-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.form-group label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
}
.form-group input {
  background: rgba(9, 14, 38, 0.8);
  border: 1px solid rgba(139, 123, 245, 0.22);
  border-radius: 8px;
  padding: 0.72em 0.9em;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: var(--text-base);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.form-group input::placeholder { color: var(--faint); }
.form-group input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(53, 210, 195, 0.14);
}
.form-group input[aria-invalid="true"] {
  border-color: #e05c7c;
  box-shadow: 0 0 0 2px rgba(224, 92, 124, 0.1);
}
.field-error {
  font-size: var(--text-xs);
  color: #e05c7c;
  display: none;
}
.field-error.visible { display: block; }

.forgot-link {
  font-size: var(--text-xs);
  color: var(--muted);
  text-decoration: none;
  align-self: flex-end;
  margin-top: -0.25rem;
  transition: color 0.15s;
}
.forgot-link:hover { color: var(--teal); text-decoration: none; }

.form-note {
  font-size: var(--text-xs);
  color: var(--faint);
  line-height: 1.65;
  background: rgba(9, 14, 38, 0.45);
  border: 1px solid rgba(139, 123, 245, 0.1);
  border-radius: 8px;
  padding: 0.75rem;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--text-xs);
  color: var(--faint);
  margin: 0.15rem 0;
}
.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(139, 123, 245, 0.14);
}

.submit-btn { width: 100%; justify-content: center; padding: 0.8em; font-size: var(--text-base); }

.sso-btn { width: 100%; justify-content: center; }

/* Auth notice */
.auth-notice {
  display: none;
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: rgba(240, 194, 122, 0.07);
  border: 1px solid rgba(240, 194, 122, 0.28);
  border-radius: 8px;
  font-size: var(--text-sm);
  color: var(--dawn);
  line-height: 1.6;
  position: relative;
}
.auth-notice.visible { display: block; }
.auth-notice-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--faint);
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
}
.auth-notice-close:hover { color: var(--ink); }

/* Portal footer */
.portal-footer {
  border-top: 1px solid rgba(139, 123, 245, 0.1);
  padding: 1rem 0;
  text-align: center;
}
.portal-security {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  color: var(--faint);
}
.portal-security-sep {
  width: 1px;
  height: 10px;
  background: rgba(139, 123, 245, 0.25);
}
.lock-icon {
  display: inline;
  width: 11px;
  height: 11px;
  color: var(--teal);
  vertical-align: middle;
  margin-right: 3px;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════ */

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .monitor-card { max-width: 520px; }

  .patients-grid { grid-template-columns: 1fr; }
  .institutions-panel { grid-template-columns: 1fr; }

  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 17, 48, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 123, 245, 0.14);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem clamp(1rem, 5vw, 2.5rem) 1.5rem;
    gap: 1.1rem;
  }
  .site-nav.is-open { display: flex; }
  .nav-portal-btn { margin-left: 0; width: 100%; justify-content: center; }
}

@media (max-width: 640px) {
  .problem-cards,
  .steps-grid,
  .evidence-cards { grid-template-columns: 1fr; }
  .steps-grid::before { display: none; }
  .inst-features { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr; }
  .portal-band-btns { flex-direction: column; align-items: center; }
  .hero-ctas { flex-direction: column; }
  .trust-ribbon-inner { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .trust-sep { display: none; }
  .swatch { width: 40px; height: 40px; }
}

/* ══════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .monitor-status-dot { animation: none; opacity: 1; }
  .btn:hover { transform: none; }
}
