/* ============================================================
   style.css — все стили сайта
   Тёмная и светлая темы управляются CSS-переменными.
   Класс .dark на <html> активирует тёмную тему.
   ============================================================ */

/* ----------------------------------------------------------
   1. Шрифт Inter (локальный)
   Скачай inter.woff2 и положи в папку fonts/
   ---------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap; /* показывает системный шрифт, пока Inter грузится */
}

/* ----------------------------------------------------------
   2. CSS-переменные (цвета)
   ---------------------------------------------------------- */
:root {
  /* Светлая тема (по умолчанию) */
  --bg:         #f4f4f5;
  --surface:    #ffffff;
  --border:     #e4e4e7;
  --text:       #18181b;
  --text-muted: #71717a;
  --accent:     #2563eb;
  --grid-color: rgba(0, 0, 0, 0.055);

  /* Цвета уровней */
  --level-beginner:     #10b981;
  --level-intermediate: #f59e0b;
  --level-advanced:     #ef4444;

  /* Успех/ошибка в тестах */
  --success-bg: rgba(16, 185, 129, 0.12);
  --success:    #10b981;
  --error-bg:   rgba(239, 68, 68, 0.12);
  --error:      #ef4444;

  /* Радиусы */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 20px;
}

/* Тёмная тема — заменяем только переменные */
html.dark {
  --bg:         #1e1e1e;
  --surface:    #2a2a2a;
  --border:     #3a3a3a;
  --text:       #e8e8e8;
  --text-muted: #888888;
  --accent:     #60a5fa;
  --grid-color: rgba(255, 255, 255, 0.045);
}

/* ----------------------------------------------------------
   3. Сброс и базовые стили
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  /* плавный переход при смене темы */
  transition: color 0.25s ease, background-color 0.25s ease;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);

  /* Паттерн клетки на фоне */
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 32px 32px;
}

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

button { cursor: pointer; border: none; outline: none; }
input  { outline: none; }
img    { max-width: 100%; }

/* ----------------------------------------------------------
   4. Кастомный скроллбар
   ---------------------------------------------------------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ----------------------------------------------------------
   5. Навбар
   ---------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}
.logo:hover { text-decoration: none; }

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Кнопка переключения темы */
.theme-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.theme-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}
.theme-btn svg { width: 18px; height: 18px; }

/* ----------------------------------------------------------
   6. Контейнер страниц
   ---------------------------------------------------------- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 20px;
}

/* ----------------------------------------------------------
   7. Блок цитаты
   ---------------------------------------------------------- */
.quote-section {
  text-align: center;
  padding: 40px 0 32px;
  max-width: 640px;
  margin: 0 auto 40px;
}

.quote-icon {
  color: var(--accent);
  opacity: 0.3;
  margin-bottom: 16px;
}
.quote-icon svg { width: 36px; height: 36px; }

.quote-text {
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 12px;
  font-style: italic;
}

.quote-author {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ----------------------------------------------------------
   8. Поисковая строка
   ---------------------------------------------------------- */
.search-wrap {
  position: relative;
  max-width: 540px;
  margin: 0 auto 28px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.search-input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.975rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

/* ----------------------------------------------------------
   9. Кнопки-действия под поиском
   ---------------------------------------------------------- */
.action-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: none;
}
.btn-primary:hover { box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 40%, transparent); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Счётчик результатов поиска */
.search-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-align: center;
}

/* ----------------------------------------------------------
   10. Сетка карточек курсов
   ---------------------------------------------------------- */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Пустое состояние */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state p { font-size: 1.1rem; margin-bottom: 8px; }

/* ----------------------------------------------------------
   11. Карточка курса
   ---------------------------------------------------------- */
.course-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-color: var(--accent);
  text-decoration: none;
}

.card-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  line-height: 1;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;

  /* Ограничение до 2 строк */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.level-beginner {
  color: var(--level-beginner);
  background: rgba(16, 185, 129, 0.1);
}
.level-intermediate {
  color: var(--level-intermediate);
  background: rgba(245, 158, 11, 0.1);
}
.level-advanced {
  color: var(--level-advanced);
  background: rgba(239, 68, 68, 0.1);
}

/* ----------------------------------------------------------
   12. Страница курса — макет
   ---------------------------------------------------------- */
.course-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* Прогресс-бар */
.progress-bar-wrap {
  margin-bottom: 28px;
}

.progress-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.course-title-top {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.progress-track {
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

/* Кнопка «Назад» */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); text-decoration: none; }
.back-link svg { width: 16px; height: 16px; }

/* Контейнер sidebar + контент */
.course-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* ----------------------------------------------------------
   13. Sidebar (список блоков)
   ---------------------------------------------------------- */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sidebar-heading {
  padding: 12px 16px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.sidebar-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); color: var(--text); }

.sidebar-item.active {
  background: var(--accent);
  color: #fff;
}
.sidebar-item.done { color: var(--text); }

.sidebar-item-icon { flex-shrink: 0; margin-top: 1px; }
.sidebar-item-icon svg { width: 12px; height: 12px; }

/* ----------------------------------------------------------
   14. Контент блока
   ---------------------------------------------------------- */
.block-content {
  flex: 1;
  min-width: 0;
}

.block-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
}

/* Бейдж типа блока */
.block-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.badge-theory {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}
.badge-practice {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}
.badge-summary {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}
.block-type-badge svg { width: 12px; height: 12px; }

.summary-prose {
  border-left: 3px solid #10b981;
  padding-left: 20px;
}

.employment-cta {
  margin-top: 24px;
  padding-left: 20px;
  border-left: 3px solid #10b981;
}

.btn-employment {
  display: inline;
  color: #10b981;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.btn-employment:hover {
  color: #059669;
  text-decoration: underline;
}

.block-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}

/* ----------------------------------------------------------
   15. Теория — стили для форматированного текста
   ---------------------------------------------------------- */
.prose h1, .prose h2, .prose h3 {
  color: var(--text);
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}
.prose h1 { font-size: 1.6rem; }
.prose h2 { font-size: 1.3rem; }
.prose h3 { font-size: 1.1rem; }
.prose :first-child { margin-top: 0; }

.prose p {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1em;
}

.prose strong { font-weight: 600; }

.prose code {
  background: var(--border);
  color: var(--accent);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'Courier New', Consolas, monospace;
}

.prose pre {
  background: color-mix(in srgb, var(--surface) 50%, var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  margin-bottom: 1em;
}
.prose pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 0.875rem;
}

.prose ul {
  padding-left: 1.4em;
  margin-bottom: 1em;
}
.prose li {
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 0.3em;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1em;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.25em 0;
  border-radius: var(--radius-sm);
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.5;
}

.md-table th,
.md-table td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border);
  vertical-align: top;
}

.md-table thead tr {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.md-table th {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.md-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.md-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.md-table code {
  font-size: 0.85em;
}

/* ----------------------------------------------------------
   16. Тест (MCQ)
   ---------------------------------------------------------- */
.question-block {
  margin-bottom: 36px;
}
.question-block:last-child { margin-bottom: 0; }

.question-text {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.5;
}
.question-num {
  color: var(--text-muted);
  font-weight: 400;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}
.option-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
}

.option-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.option-btn.correct {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--text);
}
.option-btn.wrong {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--text);
}
.option-btn:disabled { cursor: default; }

/* Буква варианта ответа */
.option-letter {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Иконка результата */
.option-result-icon {
  margin-left: auto;
  flex-shrink: 0;
}
.option-result-icon svg { width: 16px; height: 16px; }
.icon-correct { color: var(--success); }
.icon-wrong   { color: var(--error); }

/* Кнопка «Проверить» */
.check-btn {
  padding: 9px 22px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.check-btn:disabled { opacity: 0.35; cursor: default; }
.check-btn:not(:disabled):hover { opacity: 0.9; transform: translateY(-1px); }

/* Сообщение о результате */
.feedback {
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
}
.feedback.correct { background: var(--success-bg); color: var(--success); }
.feedback.wrong   { background: var(--error-bg);   color: var(--error); }

/* ----------------------------------------------------------
   17. Навигация «Назад / Далее»
   ---------------------------------------------------------- */
.course-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text);
}
.nav-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.nav-btn svg { width: 16px; height: 16px; }

.nav-btn-finish {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.nav-btn-finish:hover { opacity: 0.9; border-color: var(--success); color: #fff; }

/* ----------------------------------------------------------
   18. Адаптивность
   ---------------------------------------------------------- */
@media (max-width: 900px) {
  /* На мобильных скрываем sidebar */
  .sidebar { display: none; }
  .block-card { padding: 24px 20px; }
}

@media (max-width: 600px) {
  .quote-text { font-size: 1.1rem; }
  .page { padding: 24px 16px; }
  .course-page { padding: 20px 16px 48px; }
  .courses-grid { grid-template-columns: 1fr; }
  .btn { padding: 9px 16px; font-size: 0.8rem; }
  .course-title-top { font-size: 1.1rem; }
}

/* ----------------------------------------------------------
   19. Анимации
   ---------------------------------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeInUp 0.35s ease forwards;
}

.quote-section {
  animation: fadeInUp 0.5s ease forwards;
}

/* ----------------------------------------------------------
   21. Quiz — прогресс вопроса и экран результатов
   ---------------------------------------------------------- */

/* Строка «Вопрос N из M» + мини-прогресс */
.quiz-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.quiz-counter {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.quiz-mini-progress {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.quiz-mini-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.35s ease;
}

/* Карточка итогового счёта */
.quiz-score-card {
  text-align: center;
  padding: 28px 20px 24px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.quiz-score-emoji {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 10px;
}

.quiz-score-fraction {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.quiz-score-fraction span {
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text-muted);
}

.quiz-score-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Разбор ответов */
.quiz-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.quiz-result-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.quiz-result-row.correct {
  background: var(--success-bg);
  border-color: var(--success);
}

.quiz-result-row.wrong {
  background: var(--error-bg);
  border-color: var(--error);
}

.result-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  min-width: 18px;  /* не даёт flex расширить контейнер */
  overflow: hidden; /* обрезает SVG если он выбивается */
  margin-top: 2px;
}
.result-icon svg {
  display: block;   /* убирает inline-отступ снизу */
  width: 18px;
  height: 18px;
}
.quiz-result-row.correct .result-icon { color: var(--success); }
.quiz-result-row.wrong   .result-icon { color: var(--error); }

.result-content { flex: 1; min-width: 0; }

.result-q-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.45;
}

.result-answer {
  font-size: 0.8rem;
  margin-bottom: 2px;
}
.result-answer.correct { color: var(--success); }
.result-answer.wrong   { color: var(--error); }

.result-correct-answer {
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 500;
}

/* Кнопка «Пройти заново» */
.quiz-retake-btn {
  width: 100%;
  justify-content: center;
  gap: 8px;
}
.quiz-retake-btn svg { width: 15px; height: 15px; }


/* Оверлей — затемнённый фон */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;

  /* Анимация появления */
  animation: modalOverlayIn 0.2s ease forwards;
}
@keyframes modalOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Карточка модала */
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 420px;
  position: relative;
  animation: modalCardIn 0.25s ease forwards;
}
@keyframes modalCardIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

/* Кнопка закрытия (×) */
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover {
  background: var(--border);
  color: var(--text);
}
.modal-close svg { width: 18px; height: 18px; }

/* Иконка сердца в круге */
.modal-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.modal-icon-wrap svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

/* Заголовок и текст модала */
.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 10px;
}
.modal-body {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.7;
  margin-bottom: 12px;
}

.modal-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 16px;
}

/* Блок с QR-кодом */
.modal-qr {
  text-align: center;
  margin: 14px 0 8px;
  padding: 16px;
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.modal-qr-img {
  display: block;
  width: 190px;
  height: 190px;
  margin: 0 auto;
  border-radius: 6px;
}

.modal-qr-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: #666;
}

/* Кнопки модала */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Кнопка «Поддержать» — ссылка, выглядит как кнопка */
.btn-support {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.btn-support:hover { opacity: 0.88; transform: translateY(-1px); text-decoration: none; }
.btn-support:active { transform: scale(0.97); }
.btn-support svg { width: 17px; height: 17px; }

/* «Скоро появится» — неактивное состояние */
.btn-support-soon {
  background: var(--border);
  color: var(--text-muted);
  cursor: default;
}
.btn-support-soon:hover { opacity: 1; transform: none; }

/* Кнопка «Закрыть» */
.btn-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  margin-top: 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-modal-close:hover { border-color: var(--accent); color: var(--text); }

.modal-icon-employment {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.btn-employment-index {
  border-color: #10b981;
  color: #10b981;
}
.btn-employment-index:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: #059669;
  color: #059669;
}
.btn-employment-index svg { color: inherit; }

.modal-actions-col {
  flex-direction: column;
  align-items: stretch;
}

.btn-employment-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.30);
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn-employment-modal:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(16, 185, 129, 0.40);
  text-decoration: none;
}
.btn-employment-modal:active { transform: scale(0.97); }
