:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --bg: #f6f8fc;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius-md: 18px;
  --radius-lg: 24px;
  --shadow-sm: 0 6px 16px rgba(15, 23, 42, .06);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }

body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .08), transparent 34%),
    radial-gradient(circle at top right, rgba(14, 165, 233, .08), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  padding-bottom: 86px;
}

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .22), transparent 35%),
    linear-gradient(135deg, #f8fbff, #eef5ff);
}

.auth-hero {
  min-height: 620px;
  border-radius: 34px;
  padding: 42px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .96), rgba(14, 165, 233, .86)),
    url('https://images.unsplash.com/photo-1555396273-367ea4eb4db5?q=80&w=1200&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  box-shadow: 0 20px 45px rgba(37, 99, 235, .25);
}

.auth-card {
  border-radius: 30px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, .1);
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.2);
  margin-bottom: 12px;
  font-weight: 700;
}

.auth-feature i { font-size: 22px; }

.login-demo {
  padding: 14px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 14px;
}

.app-header {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229, 231, 235, .8);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand {
  font-size: 21px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -.3px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .25);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
  flex-shrink: 0;
}

.avatar-lg { width:68px; height:68px; font-size:26px; }
.page { display: none; animation: fadeIn .18s ease-in-out; }
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.main-card {
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-md);
}

.shadow-sm-only { box-shadow: var(--shadow-sm) !important; }

.info-box,
.content-box {
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 16px;
}

#page-home .main-card { max-width: 760px; margin: 0 auto; }
#page-home .info-box { background: linear-gradient(180deg, #ffffff, #f8fafc); }
#page-home .btn-primary { min-height: 54px; font-size: 17px; }

.course-row {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  background: #fff;
  cursor: pointer;
  transition: .18s ease;
  box-shadow: var(--shadow-sm);
}

.course-row:hover {
  border-color: rgba(37, 99, 235, .38);
  background: #fbfdff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.course-icon,
.lesson-type-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.lesson-type-icon { width: 46px; height: 46px; font-size: 22px; border-radius: 15px; }
.badge { border-radius: 999px; padding: 7px 10px; font-weight: 700; }
.progress { background: #e8edf5; border-radius: 999px; overflow: hidden; }
.progress-bar { border-radius: 999px; }

#catalogSearch { min-height: 48px; border-left: 0; }
#catalogSearch:focus { box-shadow: none; border-color: var(--border); }
#page-catalog .input-group-text { border-right: 0; border-radius: 16px 0 0 16px; }
#page-catalog .form-control { border-radius: 0 16px 16px 0; }
.catalog-btn { white-space: nowrap; min-width: 132px; }
.empty-icon { font-size: 42px; }

.lesson-step {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  margin-bottom: 10px;
  cursor: pointer;
  transition: .18s ease;
}

.lesson-step:hover { border-color: rgba(37, 99, 235, .4); background: #f8fbff; }
.lesson-step.active { border-color: rgba(37, 99, 235, .55); background: var(--primary-soft); box-shadow: 0 8px 20px rgba(37, 99, 235, .08); }
.lesson-step.done { border-color: rgba(22, 163, 74, .35); background: #f0fdf4; }
.lesson-step.locked { opacity: .6; background: #f9fafb; }

.video-box {
  border-radius: 24px;
  overflow: hidden;
  background: #111827;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .18);
}

video { display: block; width: 100%; max-height: 460px; background: #111827; }
.lesson-image { width: 100%; border-radius: 22px; border: 1px solid var(--border); max-height: 420px; object-fit: cover; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  border-radius: 15px;
  font-weight: 700;
  padding: 11px 18px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }
.btn-light { background: #fff; border-color: var(--border); color: #334155; border-radius: 15px; font-weight: 700; padding: 11px 18px; }
.btn-light:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-success, .btn-outline-primary { border-radius: 15px; font-weight: 700; padding: 11px 18px; }
.btn-sm { padding: 8px 12px; border-radius: 13px; font-size: 13px; }

.desktop-nav { display: none; gap: 8px; }
.desktop-nav button { border: 0; background: transparent; color: #475569; font-weight: 700; border-radius: 999px; padding: 9px 15px; transition: .15s; }
.desktop-nav button.active, .desktop-nav button:hover { color: var(--primary); background: var(--primary-soft); }

.bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(229, 231, 235, .95);
  border-radius: 24px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .18);
  display: flex;
  overflow: hidden;
  z-index: 2000;
}
.bottom-nav button { flex: 1; border: 0; background: transparent; padding: 12px 4px; color: #64748b; font-size: 11px; transition: .15s; }
.bottom-nav button i { display: block; font-size: 20px; margin-bottom: 2px; }
.bottom-nav button.active { color: var(--primary); font-weight: 800; background: var(--primary-soft); }
.bottom-nav button:hover { background: #f8fafc; }

.toast { border-radius: 18px !important; }
.modal-content { border-radius: 24px !important; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

@media (min-width: 992px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .desktop-nav { display: flex; }
}

@media (max-width: 576px) {
  main.container { padding-left: 14px; padding-right: 14px; }
  .main-card { border-radius: 22px; }
  .course-row { align-items: flex-start !important; padding: 14px; border-radius: 18px; }
  .catalog-item { flex-wrap: wrap; }
  .catalog-btn { width: 100%; margin-top: 8px; }
  .course-icon { width: 50px; height: 50px; font-size: 24px; }
  h2 { font-size: 24px; }
  h3 { font-size: 22px; }
  .video-box { border-radius: 18px; }
}

/* Stepik-like course structure */
.course-tree-header {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fafc;
  padding: 14px;
}

.module-block {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  margin-bottom: 14px;
  overflow: hidden;
}

.module-block.active {
  border-color: rgba(37, 99, 235, .35);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .06);
}

.module-title {
  padding: 14px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.module-block.active .module-title {
  background: var(--primary-soft);
}

.module-steps {
  padding: 10px;
}

.module-steps .lesson-step {
  box-shadow: none;
  margin-bottom: 8px;
}

.module-steps .lesson-step:last-child {
  margin-bottom: 0;
}

/* Informative employee dashboard */
.home-hero {
  overflow: hidden;
  position: relative;
}

.home-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -120px;
  top: -120px;
  border-radius: 50%;
  background: rgba(37, 99, 235, .08);
}

.home-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
}

.next-learning-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.home-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.home-stat-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  min-height: 132px;
}

.home-stat-icon,
.rule-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 10px;
}

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

.home-course-item:hover {
  border-color: rgba(37, 99, 235, .35);
  background: #fbfdff;
  transform: translateY(-1px);
}

.rule-row {
  display: flex;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.rule-row .rule-icon {
  flex-shrink: 0;
  margin-bottom: 0;
}

.module-block.locked {
  opacity: .72;
  background: #f9fafb;
}

.module-block.locked .module-title {
  cursor: not-allowed;
}

.module-block.locked .lesson-step {
  cursor: not-allowed;
}

@media (max-width: 576px) {
  .home-summary-grid {
    grid-template-columns: 1fr;
  }

  .home-stat-card {
    min-height: auto;
  }

  .home-course-item {
    align-items: flex-start;
  }
}

/* Compact readable dashboard update */
html {
  font-size: 14px;
}

body {
  padding-bottom: 74px;
}

.container {
  max-width: 1120px;
}

.app-header .container {
  padding-top: .65rem !important;
  padding-bottom: .65rem !important;
}

.brand {
  font-size: 18px;
}

.brand-logo,
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  font-size: 18px;
}

.avatar {
  border-radius: 50%;
}

.avatar-lg {
  width: 54px;
  height: 54px;
  font-size: 21px;
}

main.container {
  padding-top: 1rem !important;
  padding-bottom: 1.25rem !important;
}

.main-card {
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .065);
}

#page-home .main-card {
  max-width: none;
  margin: 0;
}

.home-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr);
  gap: 14px;
}

.home-focus-card {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .08), transparent 34%),
    #fff;
}

.home-helper-card {
  background:
    linear-gradient(180deg, #fff, #f8fafc);
}

.home-kicker {
  padding: 6px 10px;
  font-size: 12px;
}

.next-learning-card.compact {
  padding: 14px;
  border-radius: 18px;
}

.step-path {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.step-path-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.step-path-title {
  font-weight: 800;
  font-size: 15px;
}


.employee-progress-card {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .10), transparent 32%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  overflow: hidden;
}

.employee-progress-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .20);
}

.employee-progress-percent {
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -1px;
}

.employee-progress-track {
  height: 18px;
  background: #e8edf5;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, .08);
}

.employee-progress-fill {
  height: 100%;
  min-width: 42px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9, #22c55e);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  transition: width .35s ease;
}

.employee-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}

.employee-progress-meta > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.home-status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.home-status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.home-stat-icon,
.rule-icon,
.mini-rule-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  margin-bottom: 0;
}

.mini-rule {
  display: flex;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.course-icon,
.lesson-type-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  font-size: 22px;
}

.course-row,
.home-course-item,
.lesson-step,
.module-title {
  padding: 12px;
  border-radius: 16px;
}

.home-course-item .course-icon {
  width: 42px;
  height: 42px;
  font-size: 20px;
}

.btn-primary,
.btn-light,
.btn-success,
.btn-outline-primary {
  padding: 9px 14px;
  border-radius: 13px;
}

.btn-lg {
  padding: 10px 15px;
  font-size: 1rem;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.badge {
  padding: 5px 8px;
  font-size: 11px;
}

.info-box,
.content-box {
  padding: 13px;
  border-radius: 15px;
}

.auth-hero {
  min-height: 560px;
  padding: 34px;
  border-radius: 28px;
}

.auth-card {
  border-radius: 24px;
}

.bottom-nav {
  left: 10px;
  right: 10px;
  bottom: 10px;
  border-radius: 20px;
}

.bottom-nav button {
  padding: 9px 3px;
  font-size: 10px;
}

.bottom-nav button i {
  font-size: 18px;
}

@media (max-width: 991px) {
  .home-top-grid {
    grid-template-columns: 1fr;
  }

  .home-status-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  html {
    font-size: 13px;
  }

  body {
    padding-bottom: 68px;
  }

  main.container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .home-status-strip {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .employee-progress-percent {
    font-size: 26px;
  }

  .employee-progress-track {
    height: 16px;
  }

  .employee-progress-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }


  .home-status-item {
    gap: 8px;
  }

  .home-status-item .small {
    font-size: 10px;
  }

  .course-row,
  .home-course-item {
    padding: 11px;
  }

  .course-icon {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .step-path-title {
    font-size: 14px;
  }
}

.ratio iframe {
  border: 0;
  width: 100%;
  height: 100%;
}

.course-mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: .18s ease;
}

.course-mini-row:hover {
  border-color: rgba(37, 99, 235, .38);
  background: #fbfdff;
}

.course-mini-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.course-language-switcher select,
.catalog-language-select {
  min-width: 96px;
  border-radius: 12px;
  font-weight: 700;
}

.language-inline {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}
