:root {
  --blue: #0071bc;
  --blue-deep: #03537f;
  --blue-soft: #e8f3fb;
  --ink: #0f2a3d;
  --muted: #5b7488;
  --bg: #ffffff;
  --bg-tint: #f6fafd;
  --line: #e2edf5;
  --radius: 16px;
  --maxw: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 20;
  font-size: 14px;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */
.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 40px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--bg-tint) 0%, var(--bg) 55%);
}

/* Subtle medical grid */
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 50% 34%, #000 0%, transparent 62%);
  mask-image: radial-gradient(circle at 50% 34%, #000 0%, transparent 62%);
  opacity: 0.5;
  pointer-events: none;
}

.bg-glow {
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(0, 113, 188, 0.14), transparent 68%);
  pointer-events: none;
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  justify-content: center;
  padding: 8px 0 12px;
}
.logo {
  height: 46px;
  width: auto;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue-deep);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 4px 18px rgba(3, 83, 127, 0.06);
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(0, 113, 188, 0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 113, 188, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(0, 113, 188, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 113, 188, 0); }
}

.headline {
  margin-top: 26px;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.subhead {
  margin-top: 20px;
  max-width: 540px;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: var(--muted);
}
.subhead strong { color: var(--blue-deep); font-weight: 700; }

/* Accessible-only labels */
.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;
}

/* ---------- Early-access CTA panel ---------- */
.cta-panel {
  width: 100%;
  max-width: 560px;
  margin-top: 48px;
  padding: 40px 36px;
  border-radius: 22px;
  background: var(--blue-soft);
  border: 1px solid #d4e6f4;
  box-shadow: 0 16px 40px rgba(3, 83, 127, 0.10);
  text-align: center;
}
.cta-head { margin-bottom: 26px; }
.cta-title {
  font-size: clamp(1.3rem, 3.6vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cta-sub {
  margin-top: 10px;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- Signup form ---------- */
.signup {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.cta-panel .signup { margin-top: 0; }
.field-row {
  display: flex;
  gap: 10px;
}
.input,
.select {
  flex: 1 1 0;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  font-size: 16px; /* 16px avoids iOS zoom-on-focus */
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder { color: #97abbc; }
.select {
  cursor: pointer;
  color: var(--ink);
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b7488' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.select:required:invalid { color: #97abbc; } /* placeholder colour until a role is chosen */
.select option { color: var(--ink); }
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 188, 0.14);
}
.btn {
  width: 100%;
  height: 52px;
  margin-top: 10px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
  box-shadow: 0 8px 20px rgba(0, 113, 188, 0.22);
}
.btn:hover { background: var(--blue-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.65; cursor: default; box-shadow: none; }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 113, 188, 0.28);
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-msg {
  min-height: 20px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
.form-msg.is-error { color: #c0392b; }

/* Confirmation state */
.success {
  width: 100%;
  max-width: 520px;
  margin-top: 28px;
  padding: 30px 24px;
  text-align: center;
  background: var(--blue-soft);
  border: 1px solid #cfe3f2;
  border-radius: var(--radius);
}
.success-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  margin-bottom: 12px;
  box-shadow: 0 6px 16px rgba(0, 113, 188, 0.3);
}
.success-icon svg { width: 26px; height: 26px; }
.success-title { font-size: 1.25rem; font-weight: 800; color: var(--ink); }
.success-text { margin-top: 6px; font-size: 0.95rem; color: var(--muted); }

.credibility {
  margin-top: 24px;
  max-width: 460px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Field/button treatment inside the light CTA panel ---------- */
.cta-panel .field-row { gap: 12px; }
.cta-panel .input,
.cta-panel .select {
  background: #fff;
  border-color: #cfe3f2;
}
.cta-panel .btn { margin-top: 14px; }
.cta-panel .form-msg { margin-top: 12px; }

/* Confirmation state on the light panel */
.cta-panel .success {
  margin-top: 0;
  padding: 6px 0 2px;
  background: transparent;
  border: none;
}

/* ECG line */
.ecg {
  width: 100%;
  max-width: 460px;
  height: 66px;
  margin: 30px 0 6px;
}
.ecg svg { width: 100%; height: 100%; display: block; }
.ecg-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: trace 3.4s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(0, 113, 188, 0.25));
}
@keyframes trace {
  0% { stroke-dashoffset: 1200; }
  55% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}

/* Pillars */
.pillars {
  margin-top: 30px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}
.pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pillar:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(3, 83, 127, 0.09);
  border-color: #cfe3f2;
}
.pillar-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  margin-bottom: 2px;
}
.pillar-icon svg { width: 22px; height: 22px; }
.pillar-title { font-weight: 700; font-size: 0.98rem; color: var(--ink); }
.pillar-text { font-size: 0.85rem; color: var(--muted); line-height: 1.4; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  text-align: center;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.footer-copy {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .pillars { grid-template-columns: 1fr; gap: 12px; }
  .pillar { flex-direction: row; text-align: left; align-items: center; gap: 14px; padding: 16px 18px; }
  .pillar-icon { flex: 0 0 auto; margin-bottom: 0; }
  .pillar-title, .pillar-text { align-self: flex-start; }
  .pillar > span:not(.pillar-icon) { text-align: left; }
}

@media (max-width: 520px) {
  .field-row { flex-direction: column; }
  /* In a column flex row, flex-basis governs height and would collapse the
     controls; reset it so the 52px tap-target height applies. */
  .input, .select { flex: 0 0 auto; width: 100%; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .ecg-line { animation: none; stroke-dashoffset: 0; }
  .badge-dot { animation: none; }
  .pillar { transition: none; }
}
