:root {
  --bg: #F4F7F9;
  --surface: #FFFFFF;
  --ink: #1F2933;
  --ink-soft: #5B6B74;
  --line: #DCE3E8;

  --brand-900: #006caa;
  --brand-700: #0190d4;
  --brand-500: #7fd2f3;
  --brand-200: #85cae6;

  --accent: #E0A039;
  --accent-ink: #6B4A10;

  --ok: #2F8F5B;
  --mild: #D9A441;
  --moderate: #DB7B34;
  --severe: #C4432E;

  --radius: 14px;
  --shadow: 0 8px 24px rgba(15, 53, 64, 0.08);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--brand-900);
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 { font-size: 2.2rem; font-weight: 600; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}
.container--wide { max-width: 1080px; }

/* --- Хедер: тонкая "линия горизонта" как визуальная подпись сайта --- */
.site-header {
  background: linear-gradient(180deg, var(--brand-900) 0%, var(--brand-700) 100%);
  color: #EAF3F5;
  padding: 22px 0;
  position: relative;
  overflow: hidden;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-header a.brand {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.site-header a.brand:hover { text-decoration: none; opacity: 0.9;}
.site-nav a {
  color: #CFE3E7;
  margin-left: 22px;
  font-size: 0.95rem;
}
.site-nav a:hover { color: #fff; }

.brand img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin: 0 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  line-height: 1.5rem;
}

main { padding: 44px 0 64px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

/* --- Прогресс визарда: "пузырёк" на линии горизонта --- */
.horizon-progress {
  position: relative;
  height: 6px;
  background: var(--brand-200);
  border-radius: 999px;
  margin-bottom: 28px;
}
.horizon-progress__fill {
  position: absolute;
  top: 0; left: 0; height: 100%;
  background: var(--brand-500);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.horizon-progress__bubble {
  position: absolute;
  top: 50%;
  width: 16px; height: 16px;
  background: var(--accent);
  border: 3px solid var(--surface);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: left 0.3s ease;
}
.horizon-progress__label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.question-text {
  font-size: 1.25rem;
  font-family: var(--font-display);
  color: var(--brand-900);
  margin-bottom: 24px;
}

.options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.option:hover { border-color: var(--brand-500); background: #F6FAFB; }
.option input[type="radio"] { accent-color: var(--brand-900); width: 18px; height: 18px; }
.option.selected { border-color: var(--brand-500); background: var(--brand-200); }

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--brand-700); color: #fff; }
.btn-primary:hover { background: var(--brand-900); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--brand-700); border: 1.5px solid var(--line); }
.btn-secondary:hover { border-color: var(--brand-500); text-decoration: none; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(0.95); text-decoration: none; }
.btn-danger { background: transparent; color: var(--severe); border: 1.5px solid var(--severe); }

.btn-row { display: flex; gap: 12px; align-items: center; }

.hero {
  text-align: center;
  padding: 48px 0 8px;
}
.hero p.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0 auto 32px;
}

.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 8px;
}
@media (max-width: 640px) {
  .role-cards { grid-template-columns: 1fr; }
  .site-header .container {flex-direction: column;}
  .site-nav {margin-top: 5px;}
}
.role-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.role-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.role-card h3 { margin-bottom: 6px; }
.role-card p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0; }

.result-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 16px;
}
.result-badge--ok { background: var(--ok); }
.result-badge--mild { background: var(--mild); color: var(--accent-ink); }
.result-badge--moderate { background: var(--moderate); }
.result-badge--severe { background: var(--severe); }

.score-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  color: var(--brand-900);
}

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data-table th, table.data-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
table.data-table th { color: var(--ink-soft); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }

.flash {
  background: #FFF4E5;
  border: 1px solid var(--mild);
  color: var(--accent-ink);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
}

form.stack { display: flex; flex-direction: column; gap: 16px; }
label { font-weight: 600; font-size: 0.9rem; color: var(--brand-900); display: block; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--surface);
  color: var(--ink);
}
textarea { min-height: 120px; font-family: var(--font-mono); font-size: 0.9rem; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--brand-500);
  outline-offset: 1px;
  border-color: var(--brand-500);
}
input[type="radio"]:focus, input[type="checkbox"]:focus {
  outline: none;
}
.field-hint { font-size: 0.82rem; color: var(--ink-soft); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row label { margin: 0; font-weight: 500; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px;
  background: var(--brand-900);
  color: #CFE3E7;
  padding: 24px 0;
  flex-shrink: 0;
}
.admin-sidebar a {
  display: block;
  color: #CFE3E7;
  padding: 10px 24px;
  font-size: 0.92rem;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.admin-sidebar .brand { color: #fff; font-family: var(--font-display); padding: 0 24px 20px; font-size: 1.1rem; }
.admin-main { flex: 1; padding: 32px 40px; max-width: 980px; }

.list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }
.list-row .meta { color: var(--ink-soft); font-size: 0.85rem; }
.tag {
  display: inline-block; font-size: 0.75rem; font-family: var(--font-mono);
  background: var(--brand-200); color: var(--brand-900); padding: 2px 8px; border-radius: 6px;
}
.actions a, .actions button { margin-left: 8px; font-size: 0.88rem; }

.condition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 16px;
  font-size: 0.9rem;
}
.condition-grid .opt { display: flex; align-items: center; gap: 6px; }

footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
}

article.post h1 { margin-bottom: 0.3em; }
article.post .post-meta { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 24px; }
article.post .post-body { font-size: 1.05rem; }
article.post .post-body h2 { margin-top: 1.4em; }
