@font-face {
  font-family: "PP Pangram Sans";
  src: url("https://epifanov.clinic/local/templates/epifanov-clinic/fonts/PPPangramSans-CompactRegular.woff2") format("woff2"),
       url("https://epifanov.clinic/local/templates/epifanov-clinic/fonts/PPPangramSans-CompactRegular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PP Pangram Sans";
  src: url("https://epifanov.clinic/local/templates/epifanov-clinic/fonts/PPPangramSans-Medium.woff2") format("woff2"),
       url("https://epifanov.clinic/local/templates/epifanov-clinic/fonts/PPPangramSans-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PP Pangram Sans";
  src: url("https://epifanov.clinic/local/templates/epifanov-clinic/fonts/PPPangramSans-Semibold.woff2") format("woff2"),
       url("https://epifanov.clinic/local/templates/epifanov-clinic/fonts/PPPangramSans-Semibold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f5d27a;
  --paper-deep: #e0a629;
  --ink: #07365e;
  --muted: #5c7082;
  --green: #25b7c4;
  --blue: #06487c;
  --rose: #6fcad2;
  --surface: rgba(247, 253, 255, .91);
  --line: rgba(6, 72, 124, .16);
  --shadow: 0 24px 80px rgba(6, 72, 124, .16);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  overflow-y: auto;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "PP Pangram Sans", "Open Sans", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 16%, rgba(255,255,255,.78), transparent 24rem),
    radial-gradient(circle at 88% 76%, rgba(37,183,196,.26), transparent 28rem),
    linear-gradient(135deg, #f7fbfd 0%, #e8f6fa 44%, #d7eef5 100%);
  overflow-x: hidden;
  overflow-y: auto;
}

button, input { font: inherit; }

body.access-locked {
  overflow: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .17;
  background-image:
    linear-gradient(90deg, rgba(6,72,124,.07) 1px, transparent 1px),
    linear-gradient(rgba(37,183,196,.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 82%);
}

.brand-logo {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 22px;
  display: block;
  width: clamp(190px, 22vw, 330px);
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.access-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 30%, rgba(37, 183, 196, .24), transparent 26rem),
    rgba(244, 251, 253, .94);
}

.access-screen.hidden {
  display: none;
}

.access-card {
  width: min(100%, 420px);
  padding: 30px;
}

.access-card p {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.access-card h1 {
  margin: 0 0 20px;
  font-size: 28px;
  line-height: 1.08;
}

.access-error {
  display: block;
  min-height: 20px;
  margin-top: 12px;
  color: #a02b2b;
  font-size: 13px;
  font-weight: 600;
}

.shell {
  position: relative;
  min-height: 100vh;
  padding: 28px;
  padding-top: 86px;
  padding-bottom: 76px;
  overflow: visible;
}

.entry {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(320px, 480px);
  align-items: center;
  gap: clamp(18px, 3vw, 54px);
  max-width: 1260px;
  margin: 0 auto;
}

.type-note {
  grid-column: 1 / -1;
  justify-self: center;
  min-height: 28px;
  margin: -78px 0 0;
  color: #31536d;
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
}

.type-note::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 5px;
  vertical-align: -.16em;
  background: var(--green);
  animation: caret-blink .85s steps(2, start) infinite;
}

.core-meta {
  position: fixed;
  right: 14px;
  bottom: 10px;
  z-index: 12;
  max-width: min(420px, calc(100vw - 28px));
  margin: 0;
  color: rgba(7, 54, 94, .58);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
  text-align: right;
  pointer-events: none;
}

.core-meta span {
  display: block;
}

.core-meta a {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

.doctor-stage {
  position: relative;
  min-height: 720px;
  display: grid;
  place-items: center;
  justify-self: start;
  transform: translateX(-58px);
}

.doctor-orb {
  position: relative;
  z-index: 1;
  width: min(58vw, 780px);
  aspect-ratio: 1;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: end center;
  background: #7dd2dd;
  border: 1px solid rgba(6,72,124,.14);
  box-shadow:
    inset 0 0 0 10px rgba(255, 255, 255, .22),
    0 28px 62px rgba(6, 72, 124, .16);
}

.doctor-orb::before {
  content: "";
  position: absolute;
  inset: -18%;
  z-index: 0;
  background:
    conic-gradient(from 0deg, #dff8fb, #6fd1dc, #158ba5, #06487c, #7dd2dd, #eefcff, #dff8fb);
  animation: orb-spin 13s linear infinite, orb-hue 6s ease-in-out infinite alternate;
  filter: saturate(1.12);
}

.doctor-orb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(6, 72, 124, .10),
    inset 0 -40px 68px rgba(6, 72, 124, .10);
}

.doctor-gif {
  position: relative;
  z-index: 1;
  width: auto;
  height: 90%;
  object-fit: contain;
  object-position: center bottom;
  transform: translateY(0);
  mix-blend-mode: normal;
  filter: drop-shadow(0 18px 18px rgba(40, 24, 0, .14));
}

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

@keyframes orb-hue {
  0% { filter: hue-rotate(0deg) saturate(1.05); }
  100% { filter: hue-rotate(18deg) saturate(1.24); }
}

.speech {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 10%;
  max-width: 320px;
  padding: 18px 20px;
  background: #f8fdff;
  border: 2px solid rgba(6,72,124,.82);
  border-radius: 8px;
  box-shadow: 8px 8px 0 rgba(37,183,196,.22);
  transform: rotate(-2deg);
}

.speech::after {
  content: "";
  position: absolute;
  right: 48px;
  bottom: -18px;
  width: 32px;
  height: 32px;
  background: #f8fdff;
  border-right: 2px solid rgba(6,72,124,.82);
  border-bottom: 2px solid rgba(6,72,124,.82);
  transform: rotate(45deg);
}

.speech span,
.form-head p,
.kicker {
  display: block;
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.speech strong {
  display: block;
  min-height: 2.1em;
  font-size: clamp(20px, 2.8vw, 34px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: 0;
}

.speech strong::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: .95em;
  margin-left: 4px;
  vertical-align: -.12em;
  background: var(--green);
  animation: caret-blink .85s steps(2, start) infinite;
}

.glass {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.intake {
  padding: clamp(22px, 4vw, 38px);
}

.intake.attention,
.question-panel.attention {
  animation: patient-nudge 5.6s ease-in-out 1.2s infinite;
  transform-origin: 50% 60%;
}

@keyframes patient-nudge {
  0%, 82%, 100% { transform: translateX(0) rotate(0); }
  86% { transform: translateX(-3px) rotate(-.22deg); }
  90% { transform: translateX(3px) rotate(.22deg); }
  94% { transform: translateX(-2px) rotate(-.14deg); }
  98% { transform: translateX(1px) rotate(.08deg); }
}

.form-head h1,
.result-card h2 {
  margin: 0 0 22px;
  font-size: clamp(24px, 2.45vw, 34px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: 0;
}

.form-head h1 {
  margin-bottom: 10px;
}

.form-note {
  display: block;
  max-width: 360px;
  margin-bottom: 22px;
  color: #4a657a;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 400;
}

label span,
legend {
  display: block;
  margin-bottom: 7px;
  color: #31536d;
  font-size: 13px;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255,255,255,.84);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 16px;
  outline: none;
  transition: box-shadow .18s, border-color .18s, background .18s;
}

input:focus {
  background: #fff;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(37,183,196,.14);
}

.split {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
  margin-top: 14px;
}

.intake > label { display: block; margin-top: 14px; }

.sport {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.sport label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.62);
  cursor: pointer;
}

.sport input { width: 18px; min-height: 18px; accent-color: var(--green); }
.sport span { margin: 0; color: var(--ink); font-weight: 680; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  color: #31536d;
  font-size: 13px;
  line-height: 1.35;
}

.consent input {
  width: 18px;
  min-height: 18px;
  margin-top: 1px;
  accent-color: var(--green);
}

.consent span {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.start-btn,
.next,
.ghost {
  min-height: 50px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
}

.start-btn,
.next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: 20px;
  color: #fffdf2;
  background: linear-gradient(135deg, #06487c, #25b7c4);
  box-shadow: 0 12px 28px rgba(6,72,124,.24);
  text-decoration: none;
}

.start-btn i,
.next i {
  font-style: normal;
  font-size: 22px;
}

.appointment-btn {
  margin-top: 22px;
}

.secondary-btn {
  margin-top: 10px;
  color: var(--blue);
  background: rgba(247,253,255,.88);
  border: 1px solid rgba(37,183,196,.34);
  box-shadow: none;
}

.secondary-btn:hover {
  background: #ffffff;
}

.hidden { display: none !important; }

.test {
  position: relative;
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 860px);
  grid-auto-rows: max-content;
  justify-content: center;
  align-content: start;
  gap: 8px;
  max-width: 1220px;
  margin: 0 auto;
  padding-top: 18px;
  padding-bottom: 64px;
}

.question-doctor {
  position: fixed;
  z-index: 0;
  right: max(-192px, calc((100vw - 1220px) / 2 - 260px));
  bottom: 54px;
  height: clamp(420px, 52vw, 760px);
  max-width: none;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
  filter: drop-shadow(0 24px 34px rgba(6, 72, 124, .14));
}

.rail {
  position: static;
  z-index: 2;
  align-self: end;
  display: grid;
  gap: 0;
}

.patient-mini,
.meter,
.axis-list {
  padding: 16px;
  border: 1px solid rgba(6,72,124,.12);
  border-radius: 8px;
  background: rgba(247,253,255,.84);
}

.meter {
  width: 100%;
}

.patient-mini {
  position: fixed;
  top: 76px;
  right: 22px;
  z-index: 21;
  width: min(300px, calc(100vw - 44px));
  box-shadow: 0 14px 34px rgba(6, 72, 124, .12);
}

.patient-mini b {
  display: block;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 600;
}

.patient-mini span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.meter-top {
  display: flex;
  justify-content: space-between;
  color: #31536d;
  font-size: 13px;
  font-weight: 600;
}

.time-left,
.time-spent {
  margin-top: 8px;
  color: #5c7082;
  font-size: 13px;
  font-weight: 500;
}

.time-spent {
  margin-top: 3px;
  color: #31536d;
}

.reset-test {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 24;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(37,183,196,.42);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(247,253,255,.92);
  box-shadow: 0 12px 30px rgba(6, 72, 124, .13);
  cursor: pointer;
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.reset-test:hover {
  background: #ffffff;
  border-color: rgba(6,72,124,.46);
  transform: translateY(-1px);
}

.bar {
  height: 12px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(6,72,124,.13);
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--rose));
  transition: width .24s ease;
}

.axis-list { display: none; }

.axis-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 7px;
  color: #536b7e;
  font-size: 13px;
  border: 1px solid transparent;
}

.axis-chip.on {
  color: var(--ink);
  background: #ffffff;
  border-color: rgba(37,183,196,.28);
}

.axis-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.question-panel {
  position: relative;
  z-index: 3;
  align-self: start;
  min-height: 0;
  max-height: none;
  padding: clamp(22px, 4vw, 44px);
  display: block;
  overflow: visible;
}

.q-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

#question-count {
  flex: 0 0 auto;
  min-width: 48px;
  text-align: right;
  white-space: nowrap;
}

.question-panel h2 {
  max-width: 850px;
  margin: 14px 0 10px;
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: 0;
}

#question-note {
  display: none;
}

.options {
  display: grid;
  gap: 12px;
  align-content: start;
  max-height: none;
  overflow: visible !important;
  padding-right: 0;
}

.option {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(6,72,124,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.68);
  cursor: pointer;
  transition: transform .16s, border-color .16s, background .16s, box-shadow .16s;
}

.option:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.82);
}

.option.selected {
  border-color: rgba(37,183,196,.78);
  background: #f7fdff;
  box-shadow: 0 0 0 4px rgba(37,183,196,.12);
}

.option .dot {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(6,72,124,.24);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.option.multi .dot { border-radius: 6px; }
.option.selected .dot { border-color: var(--green); background: var(--green); }
.option.selected .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.option.multi.selected .dot::after { width: 11px; height: 7px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg); background: transparent; border-radius: 0; }

.option b {
  display: block;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 500;
}

.option small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
  font-size: 14px;
}

.nav-row {
  position: static;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  margin-top: 20px;
  clear: both;
}

.option:focus-visible,
.next:focus-visible,
.ghost:focus-visible,
.reset-test:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.ghost {
  margin-top: 20px;
  color: var(--ink);
  background: rgba(255,255,255,.5);
  border: 1px solid var(--line);
}

.result {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
}

.result-card {
  width: min(980px, 100%);
  padding: clamp(24px, 5vw, 48px);
}

#result-summary {
  max-width: 760px;
  color: #4a657a;
  font-size: 18px;
  line-height: 1.5;
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.branch-card {
  padding: 18px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--branch) 28%, transparent);
  background: color-mix(in srgb, var(--branch) 11%, rgba(255,255,255,.7));
}

.branch-card h3 {
  margin: 0;
  color: var(--branch);
  font-size: 20px;
  line-height: 1.12;
  font-weight: 600;
}

.branch-card .score {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 16px;
}

.branch-card .score b { font-size: 24px; }
.branch-card .score span { color: var(--muted); }
.branch-card ul { margin: 14px 0 0; padding-left: 18px; color: #465f74; line-height: 1.35; }

.logic-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  border: 1px dashed rgba(6,72,124,.24);
  color: #4a657a;
  background: rgba(255,255,255,.58);
}

@media (max-width: 900px) {
  .shell { padding: 16px; }
  .shell { padding-top: 86px; }
  .brand-logo { width: 210px; top: 14px; left: 14px; }
  .entry { grid-template-columns: 1fr; }
  .type-note { margin-top: 0; max-width: 620px; }
  .doctor-stage {
    min-height: min(106vw, 640px);
    align-items: center;
    justify-self: center;
    transform: none;
  }
  .doctor-orb { width: min(104vw, 640px); }
  .doctor-gif {
    width: 73%;
    height: auto;
    max-width: none;
    transform: translateY(8%);
  }
  .speech {
    left: 50%;
    top: calc(-8% + 40px);
    max-width: 138px;
    padding: 8px 9px;
    transform: translateX(-50%) rotate(-2deg);
  }
  .speech span { font-size: 6px; }
  .speech strong {
    min-height: 2.2em;
    font-size: 11px;
  }
  .speech::after {
    right: 30px;
    bottom: -10px;
    width: 18px;
    height: 18px;
  }
  .test { grid-template-columns: 1fr; }
  .question-doctor {
    right: -120px;
    bottom: -40px;
    height: 54vh;
    opacity: .34;
  }
  .question-panel {
    min-height: 0;
    max-height: none;
  }
  .rail { position: static; }
  .patient-mini {
    position: static;
    width: 100%;
  }
  .reset-test { top: 14px; right: 14px; }
  .axis-list { display: none; }
  .podium { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .brand-logo {
    position: relative;
    top: auto;
    left: auto;
    width: 178px;
    margin: 8px 0 12px 0;
  }
  .shell {
    width: 100%;
    max-width: 100vw;
    padding: 10px 14px 46px;
    overflow-x: hidden;
  }
  .entry,
  .test,
  .result {
    width: 100%;
    max-width: 100%;
    justify-items: center;
  }
  .rail {
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
  }
  .split, .nav-row { grid-template-columns: 1fr; }
  .nav-row { gap: 6px; }
  .nav-row .ghost,
  .nav-row .next {
    margin-top: 10px;
  }
  .doctor-stage {
    width: 100%;
    min-height: min(104vw, 520px);
    overflow: visible;
  }
  .doctor-orb { width: min(100%, 520px); }
  .doctor-gif {
    width: 74%;
    height: auto;
    max-width: none;
    object-position: center bottom;
    transform: translateY(8%);
  }
  .speech {
    left: 50%;
    top: calc(-6% + 40px);
    max-width: min(38vw, 140px);
    padding: 8px 9px;
    transform: translateX(-50%) rotate(-2deg);
  }
  .speech span { font-size: 6px; }
  .speech strong {
    min-height: 2.2em;
    font-size: 10px;
  }
  .intake,
  .question-panel,
  .result-card,
  .patient-mini,
  .meter {
    width: 100%;
    max-width: 100%;
    padding: 20px 18px;
  }
  .meter {
    padding: 12px 18px;
  }
  .meter .bar {
    height: 8px;
    margin-top: 7px;
  }
  .meter .time-left,
  .meter .time-spent {
    margin-top: 4px;
    line-height: 1.15;
  }
  .form-head h1,
  .result-card h2 {
    font-size: 22px;
    line-height: 1.08;
  }
  .form-note,
  #result-summary {
    font-size: 13px;
  }
  label span,
  legend,
  .meter-top,
  .time-left,
  .time-spent,
  .q-meta {
    font-size: 10px;
  }
  input {
    min-height: 38px;
    padding: 9px 11px;
    font-size: 12px;
  }
  .sport label,
  .option {
    padding: 9px 10px;
  }
  .consent {
    gap: 8px;
    font-size: 10px;
  }
  .consent span {
    font-size: 10px;
  }
  .consent input {
    width: 15px;
    min-height: 15px;
  }
  .option {
    grid-template-columns: 18px minmax(0, 1fr) 18px;
    text-align: center;
  }
  .option > span:last-child {
    grid-column: 2;
    justify-self: stretch;
  }
  .sport span,
  .option b {
    font-size: 12px;
  }
  .option small {
    font-size: 10px;
  }
  .start-btn,
  .next,
  .ghost {
    min-height: 38px;
    font-size: 12px;
  }
  .option .dot {
    width: 18px;
    height: 18px;
  }
  .options {
    gap: 8px;
  }
  .type-note {
    max-width: 100%;
    font-size: 11px;
  }
  .core-meta {
    right: 10px;
    bottom: 6px;
    max-width: calc(100vw - 20px);
    font-size: 8px;
  }
  .question-panel h2 { font-size: 22px; }
  .question-panel { min-height: 0; }
  .question-doctor { display: none; }
}
