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

:root {
  --bg: #f5f5f7;
  --bg-white: #ffffff;
  --bg-dark: #1d1d1f;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-on-dark: #f5f5f7;
  --text-muted-dark: rgba(245,245,247,0.55);
  --accent: #0066cc;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0,102,204,0.06);
  --accent-line: rgba(0,102,204,0.22);
  --border: rgba(0,0,0,0.08);
  --radius: 18px;
  --page-width: 760px;
  --page-pad: 22px;
}

html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { max-width: calc(var(--page-width) + var(--page-pad) * 2); margin: 0 auto; padding: 0 var(--page-pad); }

/* NAV */
nav {
  position: sticky; top: 0; z-index: 50; height: 48px;
  display: flex; align-items: center;
  background: rgba(245,245,247,0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--page-pad);
}
.nav-inner { width: 100%; max-width: calc(var(--page-width) + var(--page-pad) * 2); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.nav-logo b { font-size: 17px; font-weight: 400; color: var(--text-primary); letter-spacing: -0.02em; }
.nav-tag { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 3px 7px; }
.nav-cta { font-size: 12px; color: var(--accent); text-decoration: none; }
.nav-cta:hover { color: var(--accent-hover); }

/* HERO */
.hero { padding: 64px 0 24px; text-align: center; }
.hero-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; max-width: 620px; margin: 0 auto 18px; }
.hero p { font-size: 18px; font-weight: 300; line-height: 1.6; color: var(--text-secondary); max-width: 520px; margin: 0 auto 18px; }
.hero-sign { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.hero-sign span { color: var(--text-secondary); font-weight: 300; }

/* ANAMNESE CARD */
.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: 0 4px 40px rgba(0,0,0,0.05);
  padding: 0;
  margin: 16px auto 64px;
  overflow: hidden;
}
.card-head { padding: 22px 28px 0; }
.progress-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.progress-step { font-size: 12px; font-weight: 500; letter-spacing: 0.04em; color: var(--accent); text-transform: uppercase; }
.progress-count { font-size: 12px; color: var(--text-secondary); }
.progress-bar { height: 3px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 12.5%; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; }

.card-body { padding: 30px 28px 28px; }

.step { display: none; animation: fade 0.35s ease; }
.step.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.q-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 8px; }
.q-help { font-size: 14px; font-weight: 300; color: var(--text-secondary); line-height: 1.55; margin-bottom: 22px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin: 18px 0 9px; display: block; }
.field-label:first-child { margin-top: 0; }

/* TEXT INPUTS */
.inp {
  width: 100%; border: 1px solid var(--border); background: var(--bg);
  padding: 12px 14px; font-size: 15px; font-weight: 300; font-family: inherit;
  color: var(--text-primary); border-radius: 10px; outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.inp:focus { border-color: var(--accent); background: var(--bg-white); box-shadow: 0 0 0 3px rgba(0,102,204,0.1); }
.inp::placeholder { color: var(--text-secondary); opacity: 0.55; }

/* CHIPS */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chips.stack { flex-direction: column; }
.chip {
  font-family: inherit; font-size: 14px; font-weight: 400;
  text-align: left; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-white);
  color: var(--text-primary); border-radius: 12px; padding: 13px 16px;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.12s;
}
.chips.stack .chip { width: 100%; }
.chip:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.chip.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 500; box-shadow: 0 0 0 1px var(--accent) inset; }

/* NAV BUTTONS */
.actions { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; }
.btn-blue { font-size: 15px; font-weight: 400; padding: 11px 26px; border-radius: 980px; background: var(--accent); color: #fff; text-decoration: none; border: none; cursor: pointer; font-family: inherit; transition: background 0.2s, transform 0.15s; }
.btn-blue:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-blue:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-back { font-size: 14px; font-weight: 400; padding: 11px 6px; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-family: inherit; transition: color 0.2s; }
.btn-back:hover { color: var(--text-primary); }
.btn-back[hidden] { visibility: hidden; }

/* LOADING */
.loading { display: none; text-align: center; padding: 48px 28px; }
.loading.active { display: block; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 18px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { font-size: 14px; color: var(--text-secondary); }

/* RESULT */
.result { display: none; padding: 32px 28px 30px; }
.result.active { display: block; }
.result-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.result-body h3 { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 24px 0 8px; }
.result-body h3:first-child { margin-top: 0; }
.result-body p { font-size: 15px; font-weight: 300; line-height: 1.7; color: var(--text-primary); margin-bottom: 12px; }
.result-cta { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--border); }
.result-cta p { font-size: 15px; font-weight: 300; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }

/* FOOTER */
footer { border-top: 1px solid var(--border); padding: 22px var(--page-pad); }
.footer-inner { max-width: calc(var(--page-width) + var(--page-pad) * 2); margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-inner span, .footer-inner a { font-size: 12px; color: var(--text-secondary); text-decoration: none; }
.footer-inner a:hover { color: var(--text-primary); }

@media (max-width: 600px) {
  .hero { padding: 44px 0 16px; }
  .card-body, .result, .loading { padding-left: 20px; padding-right: 20px; }
  .card-head { padding-left: 20px; padding-right: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}