/* =========================================================
   VRACH-PEDIATR — design tokens
   ========================================================= */

:root{
  --bg:        #EAF6F3;
  --bg-soft:   #F5FBF9;
  --surface:   #FFFFFF;
  --text:      #10242B;
  --text-soft: #4B6763;
  --teal:      #0B4F4A;
  --teal-2:    #0E6B63;
  --accent:    #FF8B6B;
  --accent-2:  #FFC857;
  --line:      rgba(11,79,74,0.14);
  --shadow:    0 20px 45px -20px rgba(11,79,74,0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;
  color-scheme: light;
}

html[data-theme="dark"]{
  --bg:        #0A1D1B;
  --bg-soft:   #0E2624;
  --surface:   #123330;
  --text:      #EAF6F3;
  --text-soft: #9FC4BE;
  --teal:      #7FE0D2;
  --teal-2:    #59C6B7;
  --accent:    #FF9B7C;
  --accent-2:  #FFD37A;
  --line:      rgba(234,246,243,0.14);
  --shadow:    0 20px 45px -20px rgba(0,0,0,0.55);
  color-scheme: dark;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  transition: background .4s ease, color .4s ease;
  overflow-x: hidden;
}

h1, h2, h3, .display{
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--teal);
}

a{ color: inherit; text-decoration: none; }

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

.container{
  width: min(1080px, 92vw);
  margin: 0 auto;
}

::selection{ background: var(--accent); color: #fff; }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible{
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* =========================================================
   Theme toggle button
   ========================================================= */

.theme-toggle{
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .25s ease, background .3s ease;
}
.top-controls{
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch{
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.lang-switch button{
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.lang-switch button:hover{ color: var(--teal); }
.lang-switch button.active{
  background: var(--teal);
  color: var(--bg-soft);
}
.theme-toggle:hover{ transform: translateY(-2px) rotate(-8deg); }
.theme-toggle svg{ width: 24px; height: 24px; stroke: var(--teal); fill: none; stroke-width: 1.8; }
.theme-toggle .icon-sun{ display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon{ display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun{ display: block; }

/* =========================================================
   Top mini brand (no full navbar — just a small mark)
   ========================================================= */

.brand{
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--teal);
}
.brand .pulse-mark{ width: 34px; height: 34px; }
.brand .pulse-mark path{
  stroke: var(--accent);
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   Hero
   ========================================================= */

.hero{
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-grid{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-2);
  font-weight: 600;
  margin-bottom: 18px;
}
.eyebrow::before{
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pip 1.8s ease-in-out infinite;
}
@keyframes pip{ 0%,100%{ transform: scale(1); opacity:1;} 50%{ transform: scale(1.6); opacity:.55;} }

.hero h1{
  font-size: clamp(2.4rem, 5vw, 3.7rem);
  line-height: 1.05;
}
.hero h1 em{
  font-style: normal;
  color: var(--accent);
}

.hero p.lead{
  margin-top: 22px;
  max-width: 46ch;
  font-size: 1.08rem;
  color: var(--text-soft);
}

.hero-actions{
  margin-top: 34px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  font-family: inherit;
}
.btn-primary{
  background: var(--teal);
  color: var(--bg-soft);
  box-shadow: 0 14px 30px -10px rgba(11,79,74,.55);
}
.btn-primary:hover{ transform: translateY(-3px); }
.btn-ghost{
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover{ background: var(--surface); }

/* portrait blob */
.hero-visual{
  position: relative;
  aspect-ratio: 1/1;
  max-width: 420px;
  margin: 0 auto;
}
.blob{
  position: absolute;
  inset: 0;
  border-radius: 44% 56% 60% 40% / 48% 42% 58% 52%;
  background: linear-gradient(160deg, var(--accent-2), var(--accent));
  animation: morph 10s ease-in-out infinite;
  box-shadow: var(--shadow);
}
@keyframes morph{
  0%,100%{ border-radius: 44% 56% 60% 40% / 48% 42% 58% 52%; }
  50%{ border-radius: 58% 42% 40% 60% / 40% 58% 42% 60%; }
}
.hero-visual .badge{
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px var(--line);
}
.hero-visual .badge svg{ width: 46%; height: 46%; }
.hero-visual .badge .stetho{ stroke: var(--teal); fill: none; stroke-width: 1.6; }

.float-icon{
  position: absolute;
  width: 54px; height: 54px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  animation: float 6s ease-in-out infinite;
}
.float-icon.i1{ top: -6%; right: 4%; animation-delay: 0s; }
.float-icon.i2{ bottom: 6%; left: -8%; animation-delay: 1.4s; }
.float-icon.i3{ bottom: -4%; right: 14%; animation-delay: 2.8s; }
@keyframes float{
  0%,100%{ transform: translateY(0) rotate(0deg); }
  50%{ transform: translateY(-16px) rotate(-6deg); }
}

/* ECG signature divider */
.pulse-divider{
  width: 100%;
  height: 64px;
  margin: 10px 0;
}
.pulse-divider path{
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-dashoffset 1.6s ease;
}

/* =========================================================
   Sections shared
   ========================================================= */

section{ padding: 90px 0; position: relative; }

.section-head{ max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2{ font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.section-head p{ color: var(--text-soft); margin-top: 12px; }

.reveal{
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible{ opacity: 1; transform: translateY(0); }

/* About */
.about-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.about-text p{ color: var(--text-soft); margin-top: 14px; }
.stat-cards{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.stat-card{
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: transform .25s ease;
}
.stat-card:hover{ transform: translateY(-6px); }
.stat-card .num{
  font-family: "Fraunces", serif;
  font-size: 2.1rem;
  color: var(--accent);
  font-weight: 600;
}
.stat-card .label{ color: var(--text-soft); font-size: 0.92rem; margin-top: 6px; }

/* Access card (ID lookup) */
.access-card{
  max-width: 620px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 46px 42px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  text-align: center;
}
.access-card .icon-wrap{
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--accent-2), var(--accent));
  display: flex; align-items: center; justify-content: center;
}
.access-card .icon-wrap svg{ width: 30px; height: 30px; stroke: #fff; fill: none; stroke-width: 2; }

.id-form{
  margin-top: 28px;
  display: flex;
  gap: 10px;
  flex-direction: column;
  /* flex-wrap: wrap; */
}
.id-form input{
  /* flex: 1 1 auto; */
  width: 100%;
  height: 45px;
  padding: 15px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .2s ease;
}
.id-form input:focus{ border-color: var(--accent); outline: none; }
.id-form button{ flex: 0 0 auto; display: flex; justify-content: center;}

.form-msg{
  margin-top: 14px;
  font-size: 0.9rem;
  min-height: 1.2em;
  color: var(--accent);
}

/* Footer */
footer{
  padding: 50px 0 40px;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.92rem;
}
footer a{
  color: var(--teal);
  font-weight: 600;
  border-bottom: 1.5px solid var(--line);
}
footer a:hover{ border-color: var(--teal); }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 860px){
  .hero-grid{ grid-template-columns: 1fr; text-align: center; }
  .hero p.lead{ margin-inline: auto; }
  .hero-actions{ justify-content: center; }
  .hero-visual{ margin-top: 30px; max-width: 300px; }
  .about-grid{ grid-template-columns: 1fr; }
  .brand{ font-size: 0; }
  .brand .pulse-mark{ width: 30px; height: 30px; }
}

@media (max-width: 520px){
  .access-card{ padding: 34px 22px; }
  .id-form{ flex-direction: column; align-items: center;}
  .id-form input {width: 200px; height: 50px}
  .id-form button{ width: 100%; justify-content: center; margin-top: 10px;}
}

/* =========================================================
   PDF viewer page
   ========================================================= */

.view-shell{
  min-height: 100svh;
  padding: 110px 0 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.back-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--teal);
  width: fit-content;
}
.back-link svg{ width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.back-link:hover{ color: var(--accent); }

.doc-card{
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.doc-toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}
.doc-toolbar h2{ font-size: 1.25rem; }
.doc-toolbar .id-pill{
  display: inline-block;
  margin-top: 4px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-family: monospace;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.doc-frame-wrap{
  background: var(--bg-soft);
}
.doc-frame-wrap iframe{
  width: 100%;
  height: 74vh;
  border: none;
  display: block;
}

.empty-state{
  text-align: center;
  padding: 70px 30px;
}
.empty-state .icon-wrap{
  width: 74px; height: 74px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
}
.empty-state .icon-wrap svg{ width: 32px; height: 32px; stroke: var(--accent); fill: none; stroke-width: 1.8; }
.empty-state h2{ font-size: 1.5rem; }
.empty-state p{ color: var(--text-soft); margin-top: 10px; max-width: 40ch; margin-inline: auto; }
.empty-state .btn{ margin-top: 24px; }

@media (max-width: 640px){
  .doc-frame-wrap iframe{ height: 62vh; }
  .doc-toolbar{ padding: 18px 20px; }
}
