/* Переопределения для новых серверных страниц Django. */

/* Меню чуть левее — в legacy оно было по центру шапки, теперь прижато к бренду.
   Слегка ужимаем только межблочные зазоры (не размеры текста и не паддинги
   кнопок), чтобы при длинных русских подписях флажок языка помещался в
   viewport, но визуально шапка осталась такой же «крупной». */
@media (min-width: 980px) {
  .topbar__inner {
    gap: 20px;
  }

  .topbar__inner > .nav {
    justify-content: flex-start;
    flex: 0 1 auto;
    gap: 22px;
    margin-left: 8px;
    margin-right: auto;
  }
}

/* Язык как dropdown: один активный флажок + выпадающий список альтернативных. */
.lang-flags {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-flags form {
  margin: 0;
  padding: 0;
  display: block;
}

.lang-flags .lang-flag {
  width: 30px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.lang-flags .lang-flag:hover {
  transform: translateY(-1px);
  border-color: transparent;
  background: transparent;
}

.lang-flags .lang-flag--current {
  padding-right: 10px;
  border-color: transparent;
  background: transparent;
  position: relative;
}

.lang-flags .lang-flag--current::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 50%;
  margin-top: -1px;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 3px solid rgba(255, 255, 255, .7);
  transition: transform .18s ease;
}

.lang-flags.is-open .lang-flag--current::after {
  transform: rotate(180deg);
  margin-top: -2px;
}

.lang-flag__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  background: rgba(8, 11, 26, .96);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  z-index: 60;
  min-width: 38px;
}

.lang-flags.is-open .lang-flag__dropdown {
  display: flex;
}

.lang-flags .lang-flag:focus-visible {
  outline: 2px solid rgba(37, 99, 235, .6);
  outline-offset: 2px;
}

.section h1 {
  font-size: 42px;
  color: #0b1020;
  text-shadow: none;
  margin: 0 0 10px;
}

.section h2 {
  color: #0b1020;
  text-shadow: none;
}

.section--dark h1,
.section--dark h2 {
  color: #fff;
}

.breadcrumbs {
  font-size: 14px;
  color: #525a73;
  margin-bottom: 16px;
}

.breadcrumbs a {
  color: #1d4ed8;
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.course-hero {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 32px;
}

.course-hero img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(7, 10, 22, .12);
}

.section .lead {
  color: #3a435c;
  font-size: 18px;
  line-height: 1.5;
  margin: 10px 0 18px;
}

.course-meta {
  list-style: none;
  padding: 0;
  margin: 18px 0;
}

.course-meta li {
  margin: 6px 0;
  color: #525a73;
}

.course-meta strong {
  color: #0b1020;
}

.course-body {
  max-width: 760px;
  font-size: 17px;
  line-height: 1.6;
  color: #0b1020;
  margin: 0 0 40px;
}

.course-teachers h2,
.teacher-certs h2,
.teacher-courses h2 {
  margin-top: 32px;
}

.teacher-hero {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 24px;
}

.teacher-hero img {
  width: 100%;
  border-radius: 16px;
}

.teacher-certs ul {
  padding-left: 20px;
  color: #0b1020;
}

.lang-form select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 14px;
}

.section > .container > p.muted {
  margin-top: 6px;
}

@media (max-width: 720px) {
  .course-hero,
  .teacher-hero {
    grid-template-columns: 1fr;
  }
}

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(200%);
  padding: 12px 20px;
  border-radius: 12px;
  color: #fff;
  background: #111827;
  font-size: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transition: transform .3s ease, opacity .3s ease;
  opacity: 0;
  z-index: 9999;
  max-width: 90vw;
  text-align: center;
}

.toast.toast--show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast[data-variant="success"] { background: #10b981; }
.toast[data-variant="error"]   { background: #dc2626; }

.section--lead {
  background: linear-gradient(180deg, #070a16, #08112a);
  color: #fff;
  padding: 72px 0;
}

.section--lead h2 { color: #fff; }
.section--lead .muted { color: rgba(255,255,255,.7); }

.leadform {
  max-width: 640px;
  margin: 24px auto 0;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 28px;
}

.leadform__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.leadform .field { display: block; margin-bottom: 16px; }
.leadform .field > span { display: block; font-size: 13px; color: rgba(255,255,255,.8); margin-bottom: 4px; }
.leadform input,
.leadform select,
.leadform textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
}

.leadform__consent {
  display: flex;
  gap: 8px;
  align-items: start;
  font-size: 13px;
  color: rgba(255,255,255,.75);
  margin: 12px 0;
}

@media (max-width: 640px) {
  .leadform__row { grid-template-columns: 1fr; }
}
