:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --ink: #111827;
  --muted: #5a6575;
  --soft: #eef3f8;
  --line: #d8e2ee;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --blue: #235bd8;
  --teal: #0f9f8f;
  --green: #14824b;
  --amber: #b36b00;
  --red: #c4322b;
  --shadow: 0 24px 70px rgba(34, 45, 70, 0.14);
  background: #f6f8fb;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(35, 91, 216, 0.12), transparent 28%),
    radial-gradient(circle at 88% 6%, rgba(15, 159, 143, 0.13), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #eef3f8 100%);
}

button,
input,
select {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.page-glow {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(8px);
  opacity: 0.6;
  pointer-events: none;
}

.glow-one {
  top: 120px;
  left: -120px;
  width: 260px;
  height: 260px;
  background: rgba(35, 91, 216, 0.12);
  animation: drift 10s ease-in-out infinite alternate;
}

.glow-two {
  right: -130px;
  bottom: 180px;
  width: 300px;
  height: 300px;
  background: rgba(15, 159, 143, 0.14);
  animation: drift 12s ease-in-out infinite alternate-reverse;
}

.app-shell {
  width: min(1200px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(35, 91, 216, 0.2);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(35, 91, 216, 0.13);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  border-radius: 999px;
}

.brand-mark::before {
  inset: 8px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
}

.brand-mark::after {
  top: 15px;
  left: 7px;
  width: 20px;
  height: 3px;
  background: #ffffff;
  transform: rotate(-24deg);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: min(560px, 58vw);
  padding: 9px 12px;
  border: 1px solid rgba(216, 226, 238, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.9rem;
  box-shadow: 0 10px 28px rgba(34, 45, 70, 0.06);
  backdrop-filter: blur(16px);
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #98a2b3;
  box-shadow: 0 0 0 5px rgba(152, 162, 179, 0.16);
}

.status-dot.ready {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(20, 130, 75, 0.15);
}

.status-dot.demo {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(179, 107, 0, 0.14);
}

.status-dot.missing {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(196, 50, 43, 0.14);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 42px;
  align-items: center;
  min-height: 360px;
  margin-bottom: 34px;
}

.hero-copy {
  animation: rise-in 700ms ease both;
}

.eyebrow {
  margin-bottom: 10px;
  color: #607087;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: 5rem;
  letter-spacing: 0;
  line-height: 0.94;
}

.hero-copy > p {
  max-width: 680px;
  color: #415064;
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 150px));
  gap: 12px;
  margin-top: 28px;
}

.hero-metrics div {
  padding: 14px;
  border: 1px solid rgba(216, 226, 238, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 14px 34px rgba(34, 45, 70, 0.07);
}

.hero-metrics strong {
  display: block;
  margin-bottom: 3px;
  font-size: 1.45rem;
}

.hero-metrics span {
  color: var(--muted);
  font-size: 0.84rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
  animation: rise-in 850ms 120ms ease both;
}

.pulse-card {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 1;
  border: 1px solid rgba(216, 226, 238, 0.85);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.62)),
    radial-gradient(circle at 50% 30%, rgba(35, 91, 216, 0.14), transparent 42%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pulse-card::before {
  position: absolute;
  inset: 24px;
  content: "";
  border: 1px solid rgba(35, 91, 216, 0.08);
  border-radius: 999px;
}

.orbital {
  position: absolute;
  inset: 46px;
  border: 1px solid rgba(35, 91, 216, 0.12);
  border-radius: 999px;
  animation: slow-spin 18s linear infinite;
}

.orbital span {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 9px rgba(15, 159, 143, 0.12);
}

.orbital span:nth-child(1) {
  top: 8px;
  left: 52%;
}

.orbital span:nth-child(2) {
  right: 20px;
  bottom: 52px;
  background: var(--blue);
  box-shadow: 0 0 0 9px rgba(35, 91, 216, 0.12);
}

.orbital span:nth-child(3) {
  bottom: 28px;
  left: 38px;
  background: var(--red);
  box-shadow: 0 0 0 9px rgba(196, 50, 43, 0.1);
}

.heart-core {
  position: absolute;
  inset: 58px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #111827;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: soft-pulse 2.8s ease-in-out infinite;
}

.ecg-line {
  width: 132px;
  height: 52px;
  background:
    linear-gradient(90deg, transparent 0 8%, #6ee7db 8% 20%, transparent 20% 100%),
    linear-gradient(135deg, transparent 0 44%, #6ee7db 44% 48%, transparent 48%),
    linear-gradient(45deg, transparent 0 48%, #6ee7db 48% 52%, transparent 52%),
    linear-gradient(90deg, transparent 0 54%, #6ee7db 54% 100%);
  clip-path: polygon(0 56%, 18% 56%, 25% 42%, 33% 72%, 43% 22%, 52% 56%, 100% 56%, 100% 64%, 0 64%);
  animation: ecg 1.8s ease-in-out infinite;
}

.mini-readout {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 3px;
  min-width: 145px;
  padding: 13px;
  border: 1px solid rgba(216, 226, 238, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(34, 45, 70, 0.1);
  backdrop-filter: blur(14px);
}

.mini-readout span {
  color: var(--muted);
  font-size: 0.78rem;
}

.mini-readout strong {
  font-size: 1.25rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 24px;
  align-items: start;
}

.prediction-form,
.result-shell,
.trust-panel,
.disclaimer {
  border: 1px solid rgba(216, 226, 238, 0.92);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 45px rgba(34, 45, 70, 0.08);
  backdrop-filter: blur(18px);
}

.prediction-form {
  padding: 24px;
  animation: rise-in 700ms 180ms ease both;
}

.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.form-header h2,
.result-shell h2,
.trust-panel h3 {
  margin-bottom: 0;
}

.progress-pill,
.model-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(35, 91, 216, 0.14);
  border-radius: 999px;
  background: rgba(35, 91, 216, 0.08);
  color: #1d4fb8;
  font-size: 0.78rem;
  font-weight: 800;
}

.field-section {
  padding: 18px 0;
  border-top: 1px solid rgba(216, 226, 238, 0.8);
}

.section-title {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.section-title > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
}

.section-title h3 {
  margin-bottom: 2px;
  font-size: 1rem;
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wide-field {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: #344154;
  font-size: 0.9rem;
  font-weight: 780;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid #cbd7e5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

input:hover,
select:hover {
  border-color: #aebfd3;
  background: #ffffff;
}

input:focus,
select:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 4px rgba(35, 91, 216, 0.13);
  transform: translateY(-1px);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(17, 24, 39, 0.2);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(17, 24, 39, 0.24);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-arrow {
  transition: transform 180ms ease;
}

button:hover .button-arrow {
  transform: translateX(3px);
}

.result-panel {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 14px;
  animation: rise-in 700ms 260ms ease both;
}

.result-shell,
.trust-panel {
  padding: 22px;
}

#result {
  display: grid;
  gap: 16px;
  justify-items: start;
  min-height: 360px;
  align-content: center;
}

.risk-meter {
  --meter-color: var(--blue);
  display: grid;
  place-items: center;
  width: 176px;
  height: 176px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #ffffff 0 57%, transparent 58%),
    conic-gradient(var(--meter-color) calc(var(--risk) * 1%), #e3eaf3 0);
  box-shadow:
    inset 0 0 0 1px rgba(216, 226, 238, 0.95),
    0 20px 45px rgba(34, 45, 70, 0.12);
  transition: background 700ms ease;
  animation: meter-in 550ms ease both;
}

.risk-meter > div {
  display: grid;
  place-items: center;
  gap: 2px;
}

.risk-meter strong {
  font-size: 2.1rem;
  letter-spacing: 0;
}

.risk-meter span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.loading .risk-meter {
  animation: meter-in 550ms ease both, breathe 1.5s ease-in-out infinite;
}

.positive .risk-meter {
  --meter-color: var(--green);
}

.warning .risk-meter {
  --meter-color: var(--amber);
}

.critical .risk-meter,
.error .risk-meter {
  --meter-color: var(--red);
}

.result-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.model-badge {
  min-height: 26px;
  color: #835300;
  background: rgba(179, 107, 0, 0.09);
  border-color: rgba(179, 107, 0, 0.18);
  text-transform: none;
}

.model-badge.trained {
  color: #17683a;
  background: rgba(20, 130, 75, 0.09);
  border-color: rgba(20, 130, 75, 0.18);
}

#result h2 {
  margin-bottom: 8px;
  font-size: 1.65rem;
  letter-spacing: 0;
}

#result p {
  color: #445165;
  line-height: 1.55;
}

.small {
  margin-bottom: 0;
  color: #677386;
  font-size: 0.9rem;
}

.error-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: rgba(196, 50, 43, 0.1);
  color: var(--red);
  font-weight: 900;
}

.error h2 {
  color: var(--red);
}

.error-list {
  margin: 0;
  padding-left: 18px;
  color: #5a2630;
  line-height: 1.55;
}

.trust-panel h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.trust-panel p,
.disclaimer {
  color: var(--muted);
  line-height: 1.6;
}

.disclaimer {
  margin-top: 24px;
  padding: 16px 18px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(26px, -22px, 0);
  }
}

@keyframes slow-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes soft-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.025);
  }
}

@keyframes ecg {
  0%,
  100% {
    opacity: 0.62;
    transform: translateX(-4px);
  }

  48% {
    opacity: 1;
    transform: translateX(4px);
  }
}

@keyframes meter-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes breathe {
  50% {
    transform: scale(1.035);
  }
}

@media (max-width: 960px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 4rem;
  }

  .hero {
    gap: 28px;
  }

  .hero-visual {
    justify-content: start;
  }

  .pulse-card {
    max-width: 360px;
  }

  .result-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 22px, 1200px);
    padding-top: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    max-width: 100%;
    border-radius: 8px;
  }

  h1 {
    font-size: 2.9rem;
  }

  .hero-metrics,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .prediction-form,
  .result-shell,
  .trust-panel {
    padding: 18px;
  }

  .form-header {
    align-items: flex-start;
    flex-direction: column;
  }

  #result {
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
