/* ================================================================
   style.css — UniLMS+
   ================================================================ */

/* ── Переменные ───────────────────────────────────────────────── */
:root {
  --bg:         #f7f8fb;
  --text:       #0f172a;
  --muted:      #6b7280;
  --p1:         #6366f1;
  --p2:         #4f46e5;
  --accent:     linear-gradient(90deg, var(--p1), var(--p2));
  --card:       #ffffff;
  --radius:     12px;
  --shadow-sm:  0 6px 18px rgba(17, 24, 39, 0.06);
  --shadow-lg:  0 10px 30px rgba(17, 24, 39, 0.08);
  --gap:        16px;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body { height: 100%; }

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* Блокировка скролла при открытом меню */
body.menu-open {
  overflow: hidden;
}

/* ── Container ────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ================================================================
   HEADER
   ================================================================ */
header {
  position: sticky;
  top: 0;
  /* z-index ниже мобильного меню (9999) */
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #eef2ff;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 12px 20px;
}

/* Логотип */
.logo {
  font-weight: 700;
  font-size: 20px;
  color: var(--p1);
  text-decoration: none;
  flex-shrink: 0;
}

/* Десктопная навигация */
.desktop-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-left: 12px;
  flex: 1;
}

.desktop-nav a {
  color: #334155;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 15px;
  transition: background 0.15s ease, color 0.15s ease;
}

.desktop-nav a:hover {
  background: rgba(99, 102, 241, 0.07);
  color: var(--p1);
}

/* Auth кнопки (десктоп) */
.auth-cont {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── Кнопки ───────────────────────────────────────────────────── */
.btn-login,
.btn-register {
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn-login {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-login:hover    { opacity: 0.88; }
.btn-login:active   { transform: scale(0.97); }

.btn-register {
  background: #fff;
  color: var(--p1);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.btn-register:hover  { background: #f5f3ff; }
.btn-register:active { transform: scale(0.97); }

/* Основная CTA кнопка */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 13px 24px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover  { opacity: 0.88; }
.btn-primary:active { transform: scale(0.97); }

/* Вторичная кнопка */
.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid #e2e8f0;
  padding: 13px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }

/* ── Burger ───────────────────────────────────────────────────── */
/* Скрыт на десктопе */
.burger {
  display: none;
}

/* ── desktop-only helper ──────────────────────────────────────── */
.desktop-only {
  display: flex;
}

/* ================================================================
   MOBILE MENU — fullscreen overlay
   ВЫНЕСЕН из <header>, живёт в <body>
   ================================================================ */
.mobile-menu {
  /* Начальное состояние: скрыто */
  position: fixed;
  inset: 0;                           /* покрывает весь экран */
  z-index: 9999;                      /* выше header (100) и всего остального */

  background: #fff;

  display: flex;
  flex-direction: column;

  /* Анимация: невидимо и смещено вверх */
  opacity: 0;
  transform: translateY(-16px);
  pointer-events: none;
  visibility: hidden;

  transition:
    opacity    0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform  0.28s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.28s;         /* visibility меняется после анимации */
}

/* Открытое состояние */
.mobile-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  transition:
    opacity   0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0s;
}

/* Внутренняя обёртка — flex-колонка на всю высоту */
.mobile-menu__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── Шапка меню (логотип + крестик) ── */
.mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  background: #1b1b1b;
  flex-shrink: 0;
}

.mobile-menu__header .logo {
  color: #fff;
}

/* Кнопка закрытия (крестик) */
.menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.menu-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
}

.menu-close:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* ── Ссылки навигации ── */
.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #eef2ff;
}

.mobile-menu__link {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 20px;
  color: #334155;
  text-decoration: none;
  font-size: 17px;
  font-weight: 500;
  border-bottom: 1px solid #eef2ff;
  transition: background 0.15s ease, color 0.15s ease;
}

.mobile-menu__link:hover  { background: #f8fafc; color: var(--p1); }
.mobile-menu__link:active { background: #f1f5f9; }

.mobile-menu__link:focus-visible {
  outline: 2px solid var(--p1);
  outline-offset: -2px;
}

/* ── Кнопки auth внизу меню ── */
.mobile-menu__auth {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 20px;
  margin-top: auto;
}

.mobile-menu__auth .btn-login,
.mobile-menu__auth .btn-register {
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  text-align: center;
}

/* ================================================================
   HERO
   ================================================================ */
.hero {
  padding: 80px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: 42px;
  line-height: 1.08;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

.hero > .container > div > p {
  color: var(--muted);
  margin-bottom: 28px;
  max-width: 52ch;
  font-size: 16px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Dashboard preview */
.dashboard-preview {
  background: linear-gradient(180deg, #fff, #f8faff);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid #eef2ff;
}

.dash-bar {
  height: 10px;
  background: #eef2ff;
  border-radius: 6px;
  margin-bottom: 16px;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.dash-card {
  height: 84px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #eef3ff;
}

/* ================================================================
   ROLES
   ================================================================ */
.roles {
  padding: 80px 0;
}

.roles h2,
.features h2,
.dashboard h2 {
  font-size: 30px;
  margin-bottom: 8px;
  text-align: center;
  letter-spacing: -0.3px;
}

.roles-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.role-card {
  background: var(--card);
  padding: 24px;
  border-radius: 14px;
  border: 1px solid #eef2ff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.role-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.role-card h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.role-card p {
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 15px;
}

.role-card ul {
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ================================================================
   FEATURES
   ================================================================ */
.features {
  padding: 80px 0;
}

.features-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.feature {
  background: var(--card);
  padding: 24px;
  border-radius: 14px;
  border: 1px solid #eef2ff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature h4 {
  font-size: 16px;
  margin-bottom: 8px;
}

.feature p {
  color: var(--muted);
  font-size: 14px;
}

/* ================================================================
   DASHBOARD SECTION
   ================================================================ */
.dashboard {
  padding: 80px 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.dashboard-grid h2 { text-align: left; }

.dashboard-grid p {
  color: var(--muted);
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.7;
}

.mock {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #eef2ff;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.mock-bar {
  height: 10px;
  background: #eef2ff;
  border-radius: 6px;
  margin-bottom: 14px;
}

.mock-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mock-box {
  height: 76px;
  background: #f8fafc;
  border-radius: 8px;
}

/* ================================================================
   CTA
   ================================================================ */
.cta {
  background: linear-gradient(135deg, #6366f1, #6d7cf5);
  color: #fff;
  text-align: center;
  border-radius: 16px;
  margin: 32px 0;
  padding: 60px 0;
}

.cta .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cta h2 {
  font-size: 30px;
  color: #fff;
  text-align: center;
}

.cta p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 48ch;
}

.cta .btn-primary {
  background: #fff;
  color: var(--p1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.cta .btn-primary:hover { opacity: 0.9; }

/* ================================================================
   FOOTER
   ================================================================ */
footer {
  padding: 28px 0;
  text-align: center;
  background: #fff;
  border-top: 1px solid #eef2ff;
  color: #64748b;
  font-size: 14px;
}

/* ================================================================
   RESPONSIVE — tablet 900–1100px
   ================================================================ */
@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: 1fr 400px;
  }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr 300px;
  }

  .dash-card {
    height: 68px;
  }
}

/* ================================================================
   RESPONSIVE — mobile ≤ 768px
   ================================================================ */
@media (max-width: 768px) {

  .container {
    padding: 0 16px;
  }

  /* ── Скрываем десктопные элементы ── */
  .desktop-nav,
  .desktop-only {
    display: none !important;
  }

  /* ── Показываем бургер ── */
  .burger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    /* z-index НИЖЕ мобильного меню */
    z-index: 101;
    transition: background 0.15s ease;
  }

  .burger:hover { background: #f1f5f9; }

  .burger:focus-visible {
    outline: 2px solid var(--p1);
    outline-offset: 2px;
  }

  /* Линии бургера */
  .bline {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 2px;
    background: #0f172a;
    border-radius: 2px;
    transform: translateX(-50%);
    transition:
      top     0.25s ease,
      opacity 0.2s  ease,
      transform 0.25s ease;
  }

  .bline:nth-child(1) { top: 15px; }
  .bline:nth-child(2) { top: 21px; }
  .bline:nth-child(3) { top: 27px; }

  /* ── Hero ── */
  .hero { padding: 40px 0; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .dashboard-preview { order: 2; }

  .hero h1         { font-size: 28px; }
  .hero-buttons    { flex-direction: column; }
  .btn-primary,
  .btn-secondary   { width: 100%; text-align: center; }

  /* ── Sections ── */
  .roles,
  .features,
  .dashboard { padding: 48px 0; }

  /* ── Dashboard grid ── */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .dashboard-grid h2 { text-align: center; }

  /* ── CTA ── */
  .cta {
    margin: 16px 0;
    border-radius: 0;
    padding: 40px 0;
  }

  .cta h2 { font-size: 24px; }
}