/* ===================================================
   MENTORIO — COURSE.CSS
   Стили личного кабинета (не затрагивает лендинг)
   =================================================== */

/* ===== ПЕРЕМЕННЫЕ (те же что в style.css) ===== */
:root {
  --white: #ffffff;
  --bg-alt: #F7F6FF;
  --bg-dark: #18163A;
  --text: #111827;
  --text-muted: #6B7280;
  --accent: #6366F1;
  --accent-dark: #4338CA;
  --accent-light: #EEF2FF;
  --green: #16A34A;
  --green-light: #F0FDF4;
  --border: #E5E7EB;
  --shadow: 0 4px 20px rgba(99,102,241,0.10);
  --radius: 16px;
  --radius-sm: 8px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-w: 280px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg-alt); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ===== КНОПКИ ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 100px; font-size: 14px; font-weight: 600;
  font-family: var(--font); transition: all 0.2s; cursor: pointer;
  text-decoration: none; white-space: nowrap; border: 2px solid transparent;
}
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.3); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent-light); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--white); color: var(--text); }
.btn-success { background: var(--green); color: white; border-color: var(--green); }
.btn-success:hover { background: #15803d; border-color: #15803d; }
.btn-done { background: var(--green-light); color: var(--green); border-color: #BBF7D0; cursor: default; }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-full { width: 100%; }

/* ===== ШАПКА КАБИНЕТА ===== */
.course-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.course-header__logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
}
.course-header__user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}
.course-header__name { font-weight: 600; color: var(--text); }

/* ===== СТРАНИЦА ВХОДА ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--white) 100%);
  padding: 24px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(99,102,241,0.15);
  text-align: center;
}
.login-card__logo { font-size: 28px; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
.login-card__subtitle { font-size: 15px; color: var(--text-muted); margin-bottom: 36px; line-height: 1.5; }
.login-card__back { display: block; margin-top: 24px; font-size: 13px; color: var(--text-muted); }
.login-card__back:hover { color: var(--accent); }

/* Netlify Identity кнопка */
.netlify-identity-widget { width: 100% !important; }

/* ===== ДАШБОРД ===== */
.dashboard {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px;
}
.dashboard__welcome {
  margin-bottom: 32px;
}
.dashboard__greeting {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.dashboard__greeting span { color: var(--accent); }
.dashboard__sub { font-size: 15px; color: var(--text-muted); }

/* Прогресс-бар */
.progress-bar {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  border: 1px solid var(--border);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.progress-bar__label { font-size: 14px; font-weight: 600; white-space: nowrap; }
.progress-bar__track {
  flex: 1;
  height: 10px;
  background: var(--bg-alt);
  border-radius: 100px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #818CF8);
  border-radius: 100px;
  transition: width 0.6s ease;
  width: 0%;
}
.progress-bar__count {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* Сетка модулей */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.module-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}
.module-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--accent); }
.module-card--done { border-color: #BBF7D0; background: var(--green-light); }
.module-card--done:hover { border-color: var(--green); }
.module-card--current { border-color: var(--accent); border-width: 2px; background: var(--accent-light); }
.module-card__num {
  min-width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: var(--text-muted);
  flex-shrink: 0;
}
.module-card--done .module-card__num { background: var(--green); color: white; font-size: 16px; }
.module-card--current .module-card__num { background: var(--accent); color: white; }
.module-card__title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.module-card__desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.module-card--done .module-card__title { color: var(--green); }
.module-card--current .module-card__title { color: var(--accent-dark); }

/* ===== СТРАНИЦА МОДУЛЯ ===== */
.course-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - 60px);
}

/* Боковая панель */
.course-sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.sidebar__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0 20px 12px;
}
.sidebar__list { padding: 0 8px; }
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.sidebar__item:hover { background: var(--bg-alt); color: var(--text); }
.sidebar__item--active { background: var(--accent-light); color: var(--accent-dark); font-weight: 700; }
.sidebar__item--done { color: var(--green); }
.sidebar__item--done:hover { background: var(--green-light); }
.sidebar__num {
  min-width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  flex-shrink: 0;
}
.sidebar__item--active .sidebar__num { background: var(--accent); color: white; }
.sidebar__item--done .sidebar__num { background: var(--green); color: white; font-size: 13px; }
.sidebar__back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar__back:hover { color: var(--accent); }

/* Основной контент */
.course-main {
  padding: 40px 48px;
  max-width: 860px;
}
.module-header { margin-bottom: 32px; }
.module-header__num {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--accent-dark);
  margin-bottom: 12px;
}
.module-header__title {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* Видео */
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0f0f0f;
  margin-bottom: 36px;
  box-shadow: var(--shadow);
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.video-placeholder {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  gap: 12px;
}
.video-placeholder span { font-size: 48px; }

/* Конспект */
.module-content { margin-bottom: 40px; }
.module-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 12px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.module-content h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.module-content p { font-size: 16px; color: var(--text-muted); line-height: 1.75; margin-bottom: 14px; }
.module-content ul { padding-left: 20px; margin-bottom: 14px; }
.module-content ul li { font-size: 16px; color: var(--text-muted); line-height: 1.75; margin-bottom: 6px; list-style: disc; }
.module-content strong { color: var(--text); font-weight: 600; }

.content-placeholder {
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Навигация между модулями */
.module-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  gap: 16px;
}
.module-nav__mark { flex: 1; text-align: center; }

/* ===== МОБИЛЬНЫЙ ===== */
.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 20px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .course-layout { grid-template-columns: 1fr; }
  .course-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    display: none;
  }
  .course-sidebar.open { display: block; }
  .course-main { padding: 24px 20px; }
  .sidebar-toggle { display: flex; }
  .modules-grid { grid-template-columns: 1fr; }
  .module-nav { flex-wrap: wrap; }
  .module-nav__mark { order: -1; width: 100%; }
}

@media (max-width: 480px) {
  .login-card { padding: 36px 24px; }
  .dashboard { padding: 24px 16px; }
  .progress-bar { flex-wrap: wrap; }
}
