/* === Базовые сбросы и переменные === */
:root {
  --color-bg: #fafaf7;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #6b6b6b;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-border: #e5e5e0;
  --color-danger: #dc2626;
  --color-success: #16a34a;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* === Контейнер === */
.quiz-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* === Экраны === */
.screen {
  display: none;
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease;
}
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 { font-size: 1.6rem; margin-bottom: 16px; line-height: 1.25; }
h2 { font-size: 1.35rem; margin-bottom: 16px; line-height: 1.3; }
h3 { font-size: 1.1rem; margin: 24px 0 12px; }

.lead { font-size: 1.05rem; color: var(--color-muted); margin-bottom: 24px; }

ul.benefits {
  list-style: none;
  margin: 24px 0;
  padding: 0;
}
ul.benefits li {
  padding: 8px 0 8px 28px;
  position: relative;
}
ul.benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: bold;
}

/* === Прогресс === */
.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--color-muted);
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.3s ease;
  width: 0%;
}

/* === Ответы === */
.answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.answer {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  transition: all 0.15s ease;
}
.answer:hover {
  border-color: var(--color-accent);
  background: #f5f8ff;
}
.answer.selected {
  border-color: var(--color-accent);
  background: #eff4ff;
  font-weight: 500;
}

/* === Кнопки === */
.btn-primary, .btn-secondary {
  display: inline-block;
  border: none;
  border-radius: var(--radius);
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s ease;
}
.btn-primary {
  background: var(--color-accent);
  color: white;
}
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-primary:disabled {
  background: var(--color-border);
  color: var(--color-muted);
  cursor: not-allowed;
}
.btn-secondary {
  background: transparent;
  color: var(--color-muted);
  padding: 10px 16px;
}
.btn-secondary:hover { color: var(--color-text); }

.nav {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}

/* === Форма === */
form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.95rem;
}
form input[type="text"],
form input[type="tel"],
form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-surface);
  transition: border-color 0.15s ease;
}
form input:focus, form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}
form input.error { border-color: var(--color-danger); }
.checkbox-label {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 8px !important;
  font-size: 0.9rem;
  color: var(--color-muted);
}
.checkbox-label input { margin-top: 4px; flex-shrink: 0; }
.form-note {
  font-size: 0.85rem;
  color: var(--color-muted);
  text-align: center;
  margin-top: 8px;
}

/* === Результат === */
#result-content {
  background: #f5f8ff;
  border-left: 4px solid var(--color-accent);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  white-space: pre-line;
}
#result-content strong { color: var(--color-text); }
#result-content ul { margin: 8px 0 8px 20px; }

/* === Футер === */
.site-footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 0.85rem;
  color: var(--color-muted);
}
.site-footer a { color: var(--color-accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* === Адаптив === */
@media (max-width: 480px) {
  .quiz-container { padding: 16px 12px 40px; }
  .screen { padding: 24px 16px; }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.15rem; }
}

.muted { color: var(--color-muted); font-size: 0.95rem; }