/* ============================================================
   НИШ Трейнер — app.css
   ============================================================ */

/* --- Шрифты и базовый сброс --- */
:root {
  --font:       'Inter', system-ui, sans-serif;

  /* Palette */
  --primary:    #4F46E5;
  --primary-dk: #3730A3;
  --success:    #10B981;
  --danger:     #EF4444;
  --warning:    #F59E0B;
  --info:       #06B6D4;
  --gray-50:    #F9FAFB;
  --gray-100:   #F3F4F6;
  --gray-200:   #E5E7EB;
  --gray-400:   #9CA3AF;
  --gray-700:   #374151;
  --gray-900:   #111827;

  /* Sidebar */
  --sidebar-w:  260px;
  --sidebar-bg: #0F172A;
  --sidebar-txt:#94A3B8;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.1);
  --shadow-md:  0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.16);

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--gray-900); background: var(--gray-50); }

/* ============================================================
   AUTH LAYOUT
   ============================================================ */
.layout-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-wrapper { width: 100%; max-width: 420px; padding: 1rem; }

.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .4s ease;
}

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

.auth-logo {
  width: 140px; height: 72px;
  background: #fff; /* linear-gradient(135deg, var(--primary), #7C3AED); */
  border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2rem; color: #fff;
  box-shadow: 0 8px 24px rgba(79,70,229,.4);
}

.auth-title { font-size: 1.6rem; font-weight: 800; text-align: center; color: var(--gray-900); }
.auth-subtitle { text-align: center; color: var(--gray-400); margin-top: .25rem; margin-bottom: 1.5rem; font-size: .9rem; }

.auth-form .form-group { margin-bottom: 1rem; }
.auth-form .form-label { font-size: .85rem; font-weight: 600; color: var(--gray-700); margin-bottom: .4rem; display: block; }

.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); pointer-events: none; }
.input-icon-right { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--gray-400); padding: 0; }
.input-icon-wrap .form-control { padding-left: 2.25rem; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-200); transition: border-color .2s, box-shadow .2s; }
.input-icon-wrap .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); outline: none; }

.btn-auth {
  width: 100%; padding: .75rem;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  cursor: pointer; transition: transform .15s, box-shadow .15s;
  margin-top: 1.5rem;
}
.btn-auth:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79,70,229,.35); }

.auth-footer-note { text-align: center; font-size: .75rem; color: var(--gray-400); margin-top: 1.5rem; }

/* ============================================================
   ADMIN LAYOUT — Sidebar
   ============================================================ */
.layout-admin { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-txt);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 1000;
  transition: transform .3s ease;
}

.sidebar-header { padding: 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-logo { display: flex; align-items: center; gap: .65rem; font-size: 1.1rem; font-weight: 700; color: #fff; }
.sidebar-logo i { font-size: 1.4rem; color: var(--primary); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem 0; }
.nav-section-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.3); padding: .75rem 1rem .25rem; }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem 1rem; color: var(--sidebar-txt);
  text-decoration: none; border-radius: 8px; margin: 1px .5rem;
  font-size: .9rem; transition: background .2s, color .2s;
}
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-link.active { background: rgba(79,70,229,.25); color: var(--primary); font-weight: 600; }
.sidebar-nav .nav-link i { font-size: 1rem; flex-shrink: 0; }

.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; gap: .75rem; }
.user-avatar { font-size: 1.6rem; color: var(--gray-400); flex-shrink: 0; }
.user-name { font-size: .85rem; color: #fff; font-weight: 600; }
.user-role { font-size: .7rem; color: var(--sidebar-txt); }
.btn-logout { margin-left: auto; color: var(--gray-400); text-decoration: none; font-size: 1.2rem; transition: color .2s; }
.btn-logout:hover { color: var(--danger); }

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .3s;
}

.topbar {
  background: #fff; border-bottom: 1px solid var(--gray-200);
  padding: .85rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle { background: none; border: 1px solid var(--gray-200); border-radius: 8px; padding: .3rem .6rem; cursor: pointer; color: var(--gray-700); font-size: 1.1rem; }
.sidebar-toggle:hover { background: var(--gray-100); }

.page-content { padding: 1.5rem; flex: 1; }

/* Collapsed sidebar */
.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.sidebar-collapsed .main-content { margin-left: 0; }

/* ============================================================
   CARDS & PANELS
   ============================================================ */
.card-panel {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.panel-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  border-radius: var(--radius-md);
  padding: 1.5rem;
  color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }

.stat-card--blue   { background: linear-gradient(135deg, #4F46E5, #7C3AED); }
.stat-card--green  { background: linear-gradient(135deg, #10B981, #059669); }
.stat-card--purple { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.stat-card--orange { background: linear-gradient(135deg, #F59E0B, #D97706); }

.stat-icon { font-size: 2rem; opacity: .6; margin-bottom: .5rem; }
.stat-value { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .85rem; opacity: .85; margin-top: .25rem; }

/* ============================================================
   TABLES
   ============================================================ */
.admin-table { border-collapse: separate; border-spacing: 0; }
.admin-table thead th { background: var(--gray-50); border-bottom: 2px solid var(--gray-200); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-700); padding: .75rem; }
.admin-table tbody td { padding: .75rem; vertical-align: middle; }
.admin-table tbody tr:hover td { background: var(--gray-50); }

/* ============================================================
   BADGES & PILLS
   ============================================================ */
.badge-subject { display: inline-flex; align-items: center; background: rgba(79,70,229,.1); color: var(--primary); border-radius: 20px; padding: .2rem .75rem; font-size: .78rem; font-weight: 600; }

.level-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: .8rem; }
.level-1 { background: #D1FAE5; color: #065F46; }
.level-2 { background: #FEF3C7; color: #92400E; }
.level-3 { background: #FEE2E2; color: #991B1B; }

/* ============================================================
   PAGE HEADERS
   ============================================================ */
.page-header { margin-bottom: 1.5rem; }
.page-title { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); display: flex; align-items: center; gap: .5rem; }
.page-subtitle { color: var(--gray-400); font-size: .9rem; margin-top: .25rem; }

/* ============================================================
   QUICK ACTIONS (admin dashboard)
   ============================================================ */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.quick-action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; padding: 1rem;
  border-radius: var(--radius-md); border: 2px solid var(--gray-200);
  color: var(--gray-700); text-decoration: none; font-size: .85rem; font-weight: 600;
  transition: all .2s;
}
.quick-action-btn i { font-size: 1.4rem; color: var(--primary); }
.quick-action-btn:hover { border-color: var(--primary); background: rgba(79,70,229,.05); color: var(--primary); transform: translateY(-2px); }

/* Credential box */
.credentials-box { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: .75rem; }
.credentials-box code { background: rgba(79,70,229,.1); padding: .1rem .4rem; border-radius: 4px; color: var(--primary); }

/* Info list */
.info-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.info-list li { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }

/* User cell */
.user-cell { display: flex; align-items: center; gap: .5rem; }
.user-avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: rgba(79,70,229,.1); display: flex; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0; }

/* Form sections */
.form-section { background: var(--gray-50); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1rem; }
.form-section-title { font-size: .85rem; font-weight: 700; color: var(--gray-700); margin-bottom: .75rem; display: flex; align-items: center; gap: .4rem; }

/* Subject cards (admin) */
.subject-card { border: 2px solid var(--gray-200); border-radius: var(--radius-md); padding: 1.25rem; text-align: center; transition: border-color .2s, transform .2s; }
.subject-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.subject-card-icon { font-size: 2rem; color: var(--primary); margin-bottom: .5rem; }
.subject-card-name { font-weight: 700; }

/* Question card */
.question-card { border-left: 4px solid var(--primary); }
.question-number { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.composite-context { background: rgba(245,158,11,.08); border-left: 3px solid var(--warning); padding: .75rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.question-content, .question-text { line-height: 1.7; }
.answers-preview { display: flex; flex-direction: column; gap: .5rem; }
.answer-item { padding: .5rem .75rem; border-radius: var(--radius-sm); background: var(--gray-50); border: 1px solid var(--gray-200); }
.answer-correct { background: #D1FAE5; border-color: #6EE7B7; }

/* Empty states */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--gray-400); }
.empty-state i { font-size: 3rem; display: block; margin-bottom: 1rem; }

/* Help list */
.help-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.help-list li { font-size: .82rem; color: var(--gray-700); padding-left: .5rem; border-left: 2px solid var(--gray-200); }

/* Media panel */
.media-panel { background: var(--gray-50); border-radius: var(--radius-sm); padding: .75rem; margin-top: .5rem; }

/* Answer row */
.answer-row { padding: .5rem 0; }

/* ============================================================
   STUDENT LAYOUT
   ============================================================ */
.layout-student { min-height: 100vh; background: var(--gray-50); }

.student-navbar {
  background: linear-gradient(90deg, var(--primary), #7C3AED);
  padding: .75rem 1.25rem;
}
.student-navbar .navbar-brand { color: #fff; font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: .5rem; }
.student-nav-info { color: rgba(255,255,255,.85); font-size: .9rem; }

.student-container { max-width: 1600px; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }

@media (min-width: 1200px) {
  .row-cols-xl-5 > * {
    flex: 0 0 auto;
    width: 20%;
  }
}

.student-page-title { font-size: 1.6rem; font-weight: 800; }
.section-title { font-size: 1.1rem; font-weight: 700; color: var(--gray-700); display: flex; align-items: center; gap: .5rem; }

/* Subject cards (student) */
.student-subject-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; padding: 1.5rem;
  background: #fff; border-radius: var(--radius-md);
  border: 2px solid var(--gray-200);
  color: var(--gray-900); text-decoration: none;
  transition: all .25s; position: relative;
  box-shadow: var(--shadow-sm);
}
.student-subject-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--primary); }
.student-subject-card .subject-icon { font-size: 2.2rem; color: var(--primary); }
.student-subject-card .subject-name { font-weight: 700; font-size: 1rem; text-align: center; }
.student-subject-card .subject-meta { font-size: .78rem; color: var(--gray-400); }
.student-subject-card .subject-arrow { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--primary); opacity: 0; transition: opacity .2s; }
.student-subject-card:hover .subject-arrow { opacity: 1; }

/* History card */
.history-card { background: #fff; border-radius: var(--radius-md); padding: 1.25rem; border: 1px solid var(--gray-200); position: relative; transition: box-shadow .2s; }
.history-card:hover { box-shadow: var(--shadow-md); }
.history-subject { font-size: .8rem; color: var(--gray-400); font-weight: 600; text-transform: uppercase; }
.history-test { font-weight: 700; margin-top: .15rem; }
.score-circle { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem; flex-shrink: 0; }
.score-pass { background: #D1FAE5; color: #065F46; }
.score-fail { background: #FEE2E2; color: #991B1B; }

/* Level sections */
.level-section { border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.level-header { padding: 1rem 1.25rem; display: flex; align-items: center; gap: .75rem; font-weight: 700; }
.level-header-1 { background: linear-gradient(90deg, #D1FAE5, #A7F3D0); color: #065F46; }
.level-header-2 { background: linear-gradient(90deg, #FEF3C7, #FDE68A); color: #92400E; }
.level-header-3 { background: linear-gradient(90deg, #FEE2E2, #FECACA); color: #991B1B; }
.level-badge-lg { padding: .2rem .7rem; border-radius: 20px; background: rgba(0,0,0,.1); font-size: .8rem; font-weight: 700; }
.level-name { font-size: 1.05rem; }

/* Test card */
.test-card {
  background: #fff; border-radius: var(--radius-md);
  padding: 1.25rem; border: 2px solid var(--gray-200);
  position: relative; transition: border-color .2s, box-shadow .2s;
}
.test-card:hover:not(.test-card--locked) { border-color: var(--primary); box-shadow: var(--shadow-md); }
.test-card--locked { opacity: .65; }
.test-number { font-size: .75rem; color: var(--gray-400); font-weight: 700; text-transform: uppercase; }
.test-title { font-weight: 700; margin: .35rem 0; }
.test-meta { font-size: .8rem; color: var(--gray-400); }
.test-last-result { font-size: .82rem; margin-top: .35rem; }
.test-passed-badge { position: absolute; top: .75rem; right: .75rem; color: var(--success); font-size: 1.3rem; }
.test-lock-badge { position: absolute; top: .75rem; right: .75rem; color: var(--gray-400); font-size: 1.1rem; }

/* ============================================================
   TEST RUN
   ============================================================ */
.test-topbar {
  background: var(--gray-900); color: #fff;
  padding: .75rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 16px rgba(0,0,0,.3);
}
.test-topbar-left { display: flex; align-items: center; gap: .75rem; flex: 1; }
.test-title-bar { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.test-timer { display: flex; align-items: center; gap: .5rem; font-size: 1.2rem; font-weight: 700; color: #fff; background: rgba(255,255,255,.1); padding: .35rem .75rem; border-radius: 8px; flex-shrink: 0; }
.timer-warning { color: var(--danger) !important; animation: pulse 1s infinite; }
.test-progress-bar-wrap { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,.1); }
.test-progress-bar { height: 100%; background: var(--primary); transition: width .5s linear; }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.6; } }

.test-container { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem; }

.question-block { background: #fff; border-radius: var(--radius-md); padding: 1.5rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.question-block-header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.q-number { font-size: .8rem; font-weight: 700; color: var(--gray-400); text-transform: uppercase; }
.q-type-badge { font-size: .75rem; padding: .15rem .5rem; border-radius: 20px; background: var(--gray-100); color: var(--gray-700); }
.q-type-badge.composite { background: rgba(245,158,11,.15); color: #92400E; }

.composite-situation { background: rgba(99,102,241,.05); border-left: 3px solid var(--primary); padding: .75rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-bottom: 1rem; }
.situation-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--primary); margin-bottom: .25rem; }

.math-content { line-height: 1.75; }
.math-content img { max-width: 100%; border-radius: 8px; margin: .5rem 0; }

.answers-list { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.answer-option {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .85rem 1rem; border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200); cursor: pointer;
  transition: all .2s; user-select: none;
}
.answer-option:hover { border-color: var(--primary); background: rgba(79,70,229,.04); }
.answer-option.selected { border-color: var(--primary); background: rgba(79,70,229,.08); }
.answer-option input[type=radio] { display: none; }
.answer-letter { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--gray-300); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; transition: all .2s; }
.answer-option:hover .answer-letter { border-color: var(--primary); color: var(--primary); }
.answer-option.selected .answer-letter { background: var(--primary); border-color: var(--primary); color: #fff; }
.answer-content { flex: 1; line-height: 1.6; }
.scenario-tag { font-size: .8rem; color: var(--gray-400); display: block; margin-bottom: .2rem; }

.test-nav-footer { background: #fff; border-radius: var(--radius-md); padding: 1.25rem 1.5rem; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-md); margin-top: 1.5rem; }
.test-answered-count { font-size: .9rem; color: var(--gray-700); }

/* ============================================================
   RESULT PAGE
   ============================================================ */
.result-page { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; }

.result-header {
  border-radius: var(--radius-lg); padding: 2rem;
  display: flex; align-items: center; gap: 1.5rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}
.result-pass { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); }
.result-fail { background: linear-gradient(135deg, #FEE2E2, #FECACA); }
.result-icon { font-size: 3.5rem; flex-shrink: 0; }
.result-pass .result-icon { color: var(--success); }
.result-fail .result-icon { color: var(--danger); }
.result-info h1 { font-size: 1.5rem; font-weight: 800; }
.result-score-big { margin-left: auto; text-align: center; flex-shrink: 0; }
.score-number { font-size: 2.5rem; font-weight: 900; }
.score-fraction { font-size: .9rem; color: var(--gray-700); }

.stat-mini { display: flex; align-items: center; gap: .75rem; background: #fff; padding: 1rem; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.stat-mini i { font-size: 1.4rem; }

.mistake-block { border-left: 3px solid var(--danger); padding: .75rem 1rem; margin-bottom: .75rem; background: #fff8f8; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.mistake-topic { font-size: .78rem; color: var(--danger); font-weight: 700; margin-bottom: .35rem; display: flex; align-items: center; gap: .3rem; }

.rec-topic-name { font-size: .9rem; font-weight: 700; color: var(--primary); padding: .4rem 0; display: flex; align-items: center; gap: .4rem; border-bottom: 1px solid var(--gray-200); margin-bottom: .5rem; }
.rec-material-card { background: #fff; border-radius: var(--radius-sm); padding: 1rem; border: 1px solid var(--gray-200); }
.rec-material-title { font-weight: 700; font-size: .9rem; }
.rec-media-badge { font-size: .78rem; margin-top: .25rem; }
.rec-material-content { margin-top: .75rem; line-height: 1.7; }

/* ============================================================
   PARENT LAYOUT
   ============================================================ */
.layout-parent { min-height: 100vh; background: var(--gray-50); }
.parent-navbar { background: linear-gradient(90deg, #0F172A, #1E293B); padding: .75rem 1.25rem; }
.parent-navbar .navbar-brand { color: #fff; font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: .5rem; }
.parent-page-title { font-size: 1.5rem; font-weight: 800; }
.parent-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

.subject-progress-row { margin-bottom: 1rem; }
.weak-topics-list { list-style: none; display: flex; flex-direction: column; gap: .75rem; }
.wt-name { font-weight: 600; font-size: .9rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-collapsed .sidebar { transform: translateX(-100%); }
  .sidebar-collapsed .main-content { margin-left: 0; }
  .result-header { flex-direction: column; text-align: center; }
  .result-score-big { margin-left: 0; }
  .test-topbar-left { flex: none; }
  .test-title-bar { display: none; }
}

/* ============================================================
   Переключатель языка (lang-switcher)
   ============================================================ */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 2px 6px;
  margin: 0;
}

.lang-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 14px;
  cursor: pointer;
  transition: background .18s, color .18s;
  line-height: 1.6;
}

.lang-btn:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.lang-btn--active {
  background: rgba(255,255,255,0.9);
  color: var(--primary);
}

.lang-divider {
  color: rgba(255,255,255,0.35);
  font-size: 0.75rem;
  line-height: 1;
}

/* В сайдбаре (тёмный фон — стили те же) */
.sidebar-footer .lang-switcher {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}

.sidebar-footer .lang-btn {
  color: rgba(255,255,255,0.6);
}

.sidebar-footer .lang-btn--active {
  background: rgba(255,255,255,0.85);
  color: var(--primary-dk);
}

/* На странице авторизации (поверх auth-wrapper) */
.layout-auth .lang-switcher {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 100;
  background: rgba(79,70,229,0.15);
  border-color: rgba(79,70,229,0.3);
}

.layout-auth .lang-btn {
  color: var(--primary);
}

.layout-auth .lang-btn:hover {
  background: rgba(79,70,229,0.15);
  color: var(--primary-dk);
}

.layout-auth .lang-btn--active {
  background: var(--primary);
  color: #fff;
}

.layout-auth .lang-divider {
  color: var(--primary);
  opacity: .4;
}
