/* ===== LangExchange — страница тестов ===== */

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --green: #10b981;
  --red: #ef4444;
  --ink: #111827;
  --muted: #4b5563;
  --muted-2: #6b7280;
  --line: #e5e7eb;
  --soft: #f9fafb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Inter-Regular", system-ui, -apple-system, sans-serif;
  background: var(--soft);
  color: var(--ink);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Шапка ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  padding: 0 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 48px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.logo-icon {
  width: 34px; height: 34px;
  background: var(--blue);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}
.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}
.nav-link:hover { color: var(--blue); }
.nav-link.is-active {
  color: var(--blue);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.login-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.login-link:hover { color: var(--blue); }

/* ---------- Кнопки ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled {
  background: #93b4f7;
  border-color: #93b4f7;
  cursor: not-allowed;
}
.btn-sm {
  height: 40px;
  padding: 0 18px;
}

/* ---------- Содержимое ---------- */
.content {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 64px 80px 80px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.page-title {
  margin: 0;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.3px;
  color: var(--ink);
}
.page-subtitle {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Фильтры ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  height: 40px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover {
  border-color: #d1d5db;
  color: var(--ink);
}
.chip.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* ---------- Сетка карточек ---------- */
.tests-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* Карточка */
.test-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 220px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(17,24,39,.07);
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.test-card:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(37,99,235,.13);
  transform: translateY(-2px);
}

.test-card-top {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.level-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}
.topic-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: var(--soft);
  color: var(--muted);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.test-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.test-card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.test-card-desc {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.test-card-meta {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-2);
}

/* Состояния */
.state-box {
  grid-column: 1 / -1;
  padding: 48px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .content { padding: 48px 40px 64px; }
  .tests-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .header { padding: 0 20px; height: 68px; }
  .header-left { gap: 20px; }
  .nav { display: none; }
  .login-link { display: none; }
  .content { padding: 32px 20px 56px; gap: 28px; }
  .page-title { font-size: 26px; }
  .page-subtitle { font-size: 15px; }
}

@media (max-width: 640px) {
  .tests-grid { grid-template-columns: 1fr; }
  .page-header { gap: 8px; }
  .filters { gap: 6px; }
  .chip { height: 36px; font-size: 13px; }
}
