:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #dbe4f0;
  --success: #15803d;
  --danger: #b91c1c;
  --warning: #92400e;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(160deg, #eff6ff 0%, #eef2ff 50%, #f8fafc 100%);
  color: var(--text);
}

body.dark-header {
  background: linear-gradient(160deg, #e0f2fe 0%, #eff6ff 30%, #f8fafc 100%);
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0;
}

.card {
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 32px;
}

.card.narrow {
  max-width: 560px;
  margin: 0 auto;
}

.page-shell {
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand {
  font-size: 24px;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.55;
}

h1, h2, h3 {
  margin-top: 0;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.button,
button,
input,
select,
a.button {
  font: inherit;
}

.button,
button,
a.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: 0.2s ease;
}

.button.primary,
button.primary {
  background: var(--primary);
  color: #fff;
}

.button.primary:hover,
button.primary:hover {
  background: var(--primary-hover);
}

.button.secondary,
button.secondary {
  background: #e2e8f0;
  color: var(--text);
}

.button.ghost,
button.ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.button.full,
button.full {
  width: 100%;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

label {
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

input {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 0 14px;
  background: #fff;
}

.notice,
.error,
.success,
.warning {
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 16px;
  line-height: 1.5;
}

.notice { background: #eff6ff; color: #1e3a8a; }
.error { background: #fee2e2; color: var(--danger); }
.success { background: #dcfce7; color: var(--success); }
.warning { background: #fef3c7; color: var(--warning); }

.course-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.course-card,
.lesson-card,
.practice-card,
.info-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
}

.lesson-list {
  display: grid;
  gap: 14px;
}

.lesson-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lesson-card.locked {
  opacity: 0.74;
}

.lesson-meta {
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.free { background: #dcfce7; color: #166534; }
.badge.locked { background: #fee2e2; color: #991b1b; }
.badge.full { background: #dbeafe; color: #1d4ed8; }

.lesson-layout {
  display: grid;
  gap: 22px;
}

.theory-section {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 18px;
}

.theory-section:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.examples {
  display: grid;
  gap: 10px;
}

.example-line {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.practice-list {
  display: grid;
  gap: 16px;
}

.option-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.option-item {
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

.option-item:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

.option-item:active {
  background: #eff6ff;
  transform: scale(0.995);
}

.option-item input[type="radio"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  min-height: auto;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
  border: none;
  border-radius: 50%;
  padding: 0;
  background: transparent;
}

.option-item span {
  flex: 1;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

.option-item:has(input:checked) {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 1px var(--primary);
}

.result-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.small-link {
  color: var(--primary);
  text-decoration: none;
}

.center {
  text-align: center;
}

@media (max-width: 680px) {
  .card {
    padding: 22px;
  }

  .lesson-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
