* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  color: #111827;
  background: #f3f4f6;
}

a {
  text-decoration: none;
  color: inherit;
}

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

.topbar {
  background: #1f3d6d;
  color: #fff;
  padding: 15px 0;
}

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

.brand {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav a,
.nav button {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.hero {
  padding: 32px 0 18px;
}

.hero-landing {
  padding-top: 26px;
  padding-bottom: 20px;
}

.hero-box,
.card,
.panel,
.form-card,
.lesson-card,
.sidebar,
.stat {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
}

.hero-box {
  padding: 28px;
}

.hero-box-landing {
  text-align: center;
  padding: 30px 24px 28px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.2;
}

.hero p {
  margin: 0;
  color: #5b677a;
  font-size: 15px;
}

.section {
  padding: 0 0 24px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.panel,
.form-card,
.lesson-card {
  padding: 20px;
}

.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 10px;
  background: #1f3d6d;
  color: #fff;
  border: 0;
  cursor: pointer;
  font-size: 14px;
}

.btn-login-main {
  min-width: 94px;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
}

.btn.block {
  width: 100%;
}

.btn.secondary {
  background: #e5e7eb;
  color: #111827;
}

.btn.success {
  background: #065f46;
}

.btn.danger {
  background: #991b1b;
}

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

.form-row.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.admin-lesson-body textarea {
  min-height: 220px;
}

.admin-lesson-body textarea[name="text_content"] {
  min-height: 320px;
}

.admin-lesson-body textarea[name="homework_text"] {
  min-height: 260px;
}

.admin-lesson-body textarea[name="quiz_question"] {
  min-height: 140px;
}

.panel > form textarea[name="text_content"] {
  min-height: 260px;
}

.panel > form textarea[name="homework_text"] {
  min-height: 220px;
}

.panel > form textarea[name="quiz_question"] {
  min-height: 120px;
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #075985;
  margin-bottom: 16px;
}

.error {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  margin-bottom: 16px;
}

.tariff-price {
  font-size: 28px;
  font-weight: 700;
  margin: 14px 0;
}

.tariffs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.tariff-card {
  position: relative;
  background: #fff;
  border: 1px solid #e7e9ee;
  border-radius: 24px;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
  min-height: 520px;
}

.tariff-card.featured {
  border: 2px solid #b7c2d2;
  box-shadow: 0 10px 22px rgba(31, 61, 109, 0.12);
}

.tariff-card-inner {
  padding: 34px 34px 26px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.tariff-badge {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f3d6d;
  color: #fff;
  padding: 10px 26px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(31, 61, 109, 0.18);
}

.tariff-top {
  min-height: 142px;
}

.tariff-name {
  font-size: 24px;
  color: #606978;
  margin-bottom: 18px;
  line-height: 1.2;
}

.tariff-price-new {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.tariff-price-value {
  font-size: 52px;
  line-height: 0.92;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -1.5px;
}

.tariff-currency {
  font-size: 22px;
  color: #666f80;
  padding-bottom: 7px;
}

.tariff-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 12px 0 26px;
}

.tariff-features {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.tariff-features li {
  position: relative;
  padding-left: 38px;
  margin-bottom: 22px;
  font-size: 16px;
  line-height: 1.45;
  color: #4d5868;
}

.tariff-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  color: #1f3d6d;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}

.tariff-footer {
  margin-top: 10px;
}

.tariff-pay-btn {
  width: 100%;
  min-height: 56px;
  border-radius: 20px;
  border: 2px solid #e3e6ec;
  background: #fff;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 18px;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(17, 24, 39, 0.05);
}

.tariff-pay-btn.primary {
  background: #1f3d6d;
  color: #fff;
  border-color: #1f3d6d;
}

.tariff-pay-arrow {
  font-size: 24px;
  line-height: 1;
  margin-top: -1px;
}

.course-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

.lesson-page-layout {
  position: relative;
}

.sidebar {
  padding: 16px;
  position: sticky;
  top: 16px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin: 10px 0 8px;
}

.progress-value {
  height: 100%;
  background: #111827;
}

.chapter-block {
  margin-bottom: 16px;
}

.chapter-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.lesson-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lesson-list li {
  margin-bottom: 8px;
}

.lesson-link,
.lesson-disabled {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.lesson-link {
  background: #f3f4f6;
}

.lesson-link.completed {
  background: #dcfce7;
}

.lesson-link.active {
  outline: 2px solid #111827;
}

.lesson-disabled {
  background: #e5e7eb;
  color: #6b7280;
}

.lesson-nav-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.lesson-nav-top-left {
  display: flex;
  justify-content: flex-start;
}

.lesson-nav-top-center {
  display: flex;
  justify-content: center;
}

.lesson-nav-top-right {
  display: flex;
  justify-content: flex-end;
}

.lesson-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  background: #1f3d6d;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.lesson-nav-btn.secondary {
  background: #e8edf6;
  color: #1f3d6d;
}

.lesson-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.meta,
.small {
  color: #6b7280;
  font-size: 13px;
}

.lesson-content {
  white-space: pre-line;
  line-height: 1.65;
  margin-top: 16px;
}

.materials {
  list-style: none;
  padding: 0;
  margin: 0;
}

.materials li {
  background: #f9fafb;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.materials-links-list {
  margin: 0;
  padding-left: 24px;
}

.materials-links-list li {
  margin-bottom: 12px;
  line-height: 1.5;
  color: #111827;
}

.materials-links-list li a {
  color: #1f3d6d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.comment {
  background: #f9fafb;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  padding: 18px;
}

.stat .num {
  font-size: 28px;
  font-weight: 700;
  margin-top: 8px;
}

.stat-link {
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #f9fafb;
}

.badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 12px;
}

.badge.success {
  background: #dcfce7;
  color: #166534;
}

.badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.inline-form {
  display: inline;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mb-16 {
  margin-bottom: 16px;
}

.footer {
  padding: 28px 0;
  color: #6b7280;
  text-align: center;
}

video,
audio {
  width: 100%;
  max-width: 100%;
}

.media-player {
  width: 100%;
}

.media-player video {
  display: block;
  width: 100%;
  max-height: 560px;
  border-radius: 12px;
  background: #000;
}

.media-player audio {
  display: block;
  width: 100%;
}

.admin-media-player video {
  max-height: 320px;
}

.quiz-form {
  margin-top: 16px;
}

.quiz-question {
  font-size: 18px;
  line-height: 1.55;
  margin-top: 8px;
  margin-bottom: 18px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  cursor: pointer;
  margin-bottom: 0;
  font-weight: 400;
}

.quiz-option input[type="radio"],
.quiz-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0 0;
  flex: 0 0 18px;
}

.quiz-option span {
  display: block;
  line-height: 1.5;
}

.test-feedback-box {
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff5f5;
  border: 1px solid #f3c2c2;
}

.test-feedback-title {
  font-size: 14px;
  font-weight: 700;
  color: #991b1b;
}

.test-feedback-text {
  margin-top: 8px;
  line-height: 1.55;
  color: #374151;
}

.test-feedback-explanation {
  margin-top: 8px;
}

.admin-lesson-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-lesson-item {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f9fafb;
  overflow: hidden;
}

.admin-lesson-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
}

.admin-lesson-summary::-webkit-details-marker {
  display: none;
}

.admin-lesson-summary::after {
  content: "▾";
  font-size: 18px;
  color: #6b7280;
  margin-left: auto;
}

.admin-lesson-item[open] .admin-lesson-summary::after {
  content: "▴";
}

.admin-lesson-summary-left {
  min-width: 0;
}

.admin-lesson-summary-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-lesson-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.admin-lesson-body {
  padding: 18px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.mobile-course-dock {
  display: none;
}

@media (max-width: 1200px) {
  .tariffs-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .tariff-card,
  .tariff-card-inner {
    min-height: auto;
  }

  .tariff-top {
    min-height: auto;
  }
}

@media (max-width: 980px) {
  .grid-2,
  .grid-3,
  .course-layout,
  .stats,
  .form-row.cols-2,
  .form-row.cols-3,
  .lesson-nav-top {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .lesson-sidebar {
    display: none;
  }

  .lesson-nav-top-left,
  .lesson-nav-top-center,
  .lesson-nav-top-right {
    justify-content: stretch;
  }

  .lesson-nav-btn {
    width: 100%;
  }

  .admin-lesson-summary,
  .admin-lesson-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-lesson-summary::after {
    margin-left: 0;
  }

  .tariff-card-inner {
    padding: 26px 22px 24px;
  }

  .tariff-price-value {
    font-size: 42px;
  }

  .tariff-features li {
    font-size: 16px;
  }

  .mobile-course-dock {
    display: block;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 50;
  }

  .mobile-course-dock-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
    font-weight: 600;
    color: #111827;
  }

  body {
    padding-bottom: 84px;
  }
}