:root{
  --bg: #f3f8fb;
  --nav-start: #04293a;
  --nav-end: #013946;
  --accent: #e63946;
  --teal: #2ca58d;
  --primary: #0077b6;
  --muted: #6b7280;
}

html,body{height:100%;font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; background:var(--bg);}
html{background:var(--bg);}

/* Top partner bar */
.top-partners{background:#0b1720;color:#fff;padding:6px 0;font-size:.9rem}
.top-partners img{height:20px;opacity:.9;margin-right:12px}

.navbar-medical{background: linear-gradient(90deg,var(--nav-start),var(--nav-end));box-shadow:0 2px 8px rgba(2,18,28,0.08)}
.navbar .brand-text{font-weight:600; color:#fff; letter-spacing:0.2px}
.navbar .cta-platform{background:#fff;color:var(--nav-start);border-radius:999px;padding:6px 12px;font-weight:600}

.logo-heart{transform-origin:60px 60px; transition:transform .18s ease-in-out;}
.logo-ecg{stroke-dasharray:200; stroke-dashoffset:200;}
#logo-svg .logo-ecg{animation: ecgMove 2s linear infinite;}
#logo-svg .logo-heart{animation: heartbeat 1.4s ease-in-out infinite;}
#logo-svg.pulse-once .logo-heart{animation: heartbeat-strong .8s ease-in-out 1;}
@keyframes heartbeat{0%,100%{transform:scale(1)}40%{transform:scale(1.12)}60%{transform:scale(0.96)}}
@keyframes heartbeat-strong{0%{transform:scale(1)}30%{transform:scale(1.22)}60%{transform:scale(.88)}100%{transform:scale(1)}}
@keyframes ecgMove{to{stroke-dashoffset:0}}

/* Hero immersive */
.hero-immersive{position:relative;overflow:hidden;border-radius:12px;background:linear-gradient(180deg, rgba(2,6,23,0.75), rgba(3,37,65,0.6));padding:40px;color:#fff}
.hero-media{position:absolute;inset:0;opacity:.14;background-size:cover;background-position:center}
.hero-svg{width:100%;height:100%;object-fit:cover}
.hero-content{position:relative;z-index:2}
.metrics-overlay{background:rgba(255,255,255,0.06);backdrop-filter: blur(4px);padding:10px;border-radius:8px}
.metric-value{font-size:1.1rem;color:#fff;margin-top:4px}

.card-feature{background:var(--surface);border-radius:10px;box-shadow:0 8px 26px rgba(9,20,24,0.06)}
.feature-img{height:56px;object-fit:contain}

.timeline{display:flex;flex-direction:column;gap:18px}
.timeline-step{background:var(--surface);padding:18px;border-radius:8px;box-shadow:0 6px 22px rgba(9,20,24,0.04)}

/* Demo widget */
.dropzone{background:linear-gradient(180deg,var(--surface),var(--bg));border:2px dashed rgba(3,37,65,0.06);padding:24px;border-radius:8px;text-align:center;color:var(--muted)}
.dropzone.dragover{background:#e6f7ff;border-color:var(--primary)}
#preview-plot{height:220px}
#probs-bar{height:200px}
.metrics{display:flex;gap:12px;justify-content:space-between}
.metrics-grid li{background:var(--surface);padding:12px;border-radius:6px;margin-bottom:8px;box-shadow:0 4px 12px rgba(2,18,28,0.04)}

.partners .partner-logo{height:44px;opacity:.95}

.footer-columns{display:grid;grid-template-columns:repeat(4,1fr);gap:20px}
.footer{background:#071422;color:#cfe8ef}
.footer a{color:#cfe8ef}

/* small helpers */
.text-muted{color:var(--muted) !important}

/* responsive tweaks */
@media (max-width:768px){
  .metrics-overlay{flex-wrap:wrap}
  .footer-columns{grid-template-columns:1fr}
}

/* ===== UI/UX Enhancements: Loader, Toaster, Theme, History ===== */
:root{
  --bg-light: #f3f8fb;
  --bg-dark: #06121a;
  --surface: #ffffff;
  --surface-2: #0b1720;
  --text: #041826;
  --muted: #6b7280;
}

/* Dark mode via .theme-dark on body */
body.theme-dark{
  background:var(--bg-dark);
  color:#dbeafe;
  --bg: var(--bg-dark);
  --surface: var(--surface-2);
  --text: #dbeafe;
  --muted: #9ca3af;
}
html.theme-dark{
  background:var(--bg-dark);
}
body.theme-dark .footer{background:var(--surface-2);color:#cfe8ef}
body.theme-dark .card-feature{background:#071827;color:#dbeafe}
body.theme-dark .bg-light,
body.theme-dark .bg-white{
  background-color:var(--surface-2) !important;
  color:var(--text);
}
body.theme-dark .card{
  background-color:var(--surface-2);
  color:var(--text);
}
body.theme-dark main{
  background-color:var(--bg-dark);
}
body.theme-dark .text-dark{
  color:var(--text) !important;
}
body.theme-dark .badge.bg-light{
  background:rgba(255,255,255,0.08) !important;
  color:var(--text) !important;
  border:1px solid rgba(255,255,255,0.12);
}
body.theme-dark .offcanvas{
  background:var(--surface-2);
  color:var(--text);
}
body.theme-dark .offcanvas .btn-close{
  filter:invert(1);
}
body.theme-dark .table{
  color:var(--text);
}
body.theme-dark .table-striped>tbody>tr:nth-of-type(odd){
  --bs-table-accent-bg: rgba(255,255,255,0.04);
}
body.theme-dark .dropzone{
  border-color:rgba(255,255,255,0.08);
}

/* Smooth transitions */
*{transition: background-color .28s ease, color .28s ease, border-color .2s ease}

/* Loader overlay */
.loader-overlay{position:fixed;inset:0;background:rgba(1,6,10,0.6);display:flex;align-items:center;justify-content:center;z-index:2000}
.loader-box{background:linear-gradient(180deg,#001f2b,#003b4b);padding:22px;border-radius:12px;display:flex;align-items:center;gap:14px;color:#fff;box-shadow:0 10px 40px rgba(2,12,20,0.6)}
.loader-ecg{width:120px;height:48px}
.loader-text{font-size:0.95rem}

/* heartbeat while loading */
#logo-svg.loading .logo-heart{animation: heartbeat-strong .8s ease-in-out infinite}

/* Toast container */
#toast-container{position:fixed;right:16px;bottom:16px;z-index:3000;display:flex;flex-direction:column;gap:8px}
.toast-card{min-width:260px;background:var(--surface);border-radius:8px;padding:10px 12px;box-shadow:0 8px 26px rgba(2,18,28,0.12);color:var(--text)}
.toast-card.success{border-left:4px solid #2ca58d}
.toast-card.error{border-left:4px solid #e63946}
.toast-card.info{border-left:4px solid #0077b6}

/* history offcanvas tweaks */
.offcanvas .history-item{padding:10px;border-radius:6px;border-bottom:1px solid rgba(4,24,38,0.08);display:flex;justify-content:space-between;align-items:center}
body.theme-dark .offcanvas .history-item{border-bottom:1px solid rgba(255,255,255,0.08)}
.offcanvas .history-item .meta{font-size:.85rem;color:var(--muted)}

/* accessibility focus */
button:focus, a:focus{outline:3px solid rgba(3,37,65,0.12);outline-offset:2px}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  *{transition:none}
  #logo-svg .logo-heart,#logo-svg .logo-ecg,.ecg-wave polyline{animation:none}
}


