@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --surface:      #EDE8DE;
  --surface-alt:  #E4DDD0;
  --border:       #CFC8B8;
  --text:         #1C1408;
  --muted:        #7A705E;
  --text-inv:     #F0EAE0;
  --muted-inv:    rgba(240, 234, 224, 0.50);
  --accent:       #2ABFBF;
  --accent-light: rgba(42, 191, 191, 0.13);
  --accent-hover: #229F9F;
  --success:      #10B981;
  --radius:       12px;
  --shadow:       0 2px 8px rgba(20, 12, 4, 0.18);
  --shadow-md:    0 6px 24px rgba(20, 12, 4, 0.28);
}

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

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(155deg, #1A0C04 0%, #2C1A0A 45%, #221408 75%, #1A0E06 100%);
  background-attachment: fixed;
  color: var(--text-inv);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ── Layout ── */
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
.site-header {
  background: rgba(20, 10, 4, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(240, 234, 224, 0.07);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-inv);
}
.logo-mark {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg { width: 14px; height: 14px; fill: white; }
.stream-badge {
  font-size: 0.78rem;
  color: var(--muted-inv);
  background: rgba(240,234,224,0.07);
  border: 1px solid rgba(240,234,224,0.12);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── Page ── */
.page { padding: 44px 0 80px; }

/* ── Hero — прямо на тёмном фоне ── */
.hero {
  margin-bottom: 44px;
}
.hero-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}
.hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text-inv);
}
.hero p {
  color: var(--muted-inv);
  font-size: 0.92rem;
  max-width: 500px;
  line-height: 1.65;
}
.teal { color: var(--accent); }

/* ── Section label — на тёмном фоне ── */
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-inv);
  margin-bottom: 16px;
}

/* ── Lesson cards — бежевые ── */
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.lesson-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}
.lesson-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}
.lesson-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light), var(--shadow);
}

.lesson-card-num {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.lesson-card-title {
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}
.lesson-card-topics {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}
.lesson-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.lesson-card-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
}
.badge-upcoming { background: rgba(28,20,8,0.07); color: var(--muted); }
.badge-current  { background: rgba(42,191,191,0.13); color: var(--accent); }
.badge-done     { background: rgba(16,185,129,0.10); color: var(--success); }

/* ── Lesson page — breadcrumb + header на тёмном ── */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: var(--muted-inv);
  margin-bottom: 28px;
  transition: color 0.15s;
}
.breadcrumb:hover { color: var(--text-inv); }

.lesson-header { margin-bottom: 32px; }
.lesson-num-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 6px;
}
.lesson-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-inv);
  margin-bottom: 10px;
}
.lesson-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--muted-inv);
}
.meta-dot {
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Content blocks — бежевые ── */
.block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.block-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-alt);
}
.block-icon {
  width: 26px; height: 26px;
  background: rgba(42,191,191,0.12);
  border: 1px solid rgba(42,191,191,0.2);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.block-icon svg {
  width: 13px; height: 13px;
  stroke: var(--accent); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.block-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.block-body { padding: 20px; }

.placeholder {
  background: rgba(28,20,8,0.04);
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.5;
}

/* ── Lesson nav ── */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(240,234,224,0.10);
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--muted-inv);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(240,234,224,0.14);
  background: rgba(240,234,224,0.05);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  text-decoration: none;
}
.nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(42,191,191,0.07);
}
.nav-btn-ghost { opacity: 0.25; pointer-events: none; }

/* ── Login ── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.login-logo {
  width: 44px; height: 44px;
  background: var(--accent);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.login-logo svg { width: 22px; height: 22px; stroke: white; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-card h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}
.login-card .sub {
  font-size: 0.83rem;
  color: var(--muted);
  margin-bottom: 28px;
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface-alt);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  letter-spacing: 0.04em;
}
.field input::placeholder { color: rgba(28,20,8,0.3); }
.field input:focus { border-color: var(--accent); background: #EDE8DE; }
.field input.error { border-color: #EF4444; }
.btn {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}
.btn:hover { background: var(--accent-hover); }
.login-hint {
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .hero h1 { font-size: 1.4rem; }
  .lessons-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 24px; }
}
