/* ==========================================================
   Header / navigation
   ========================================================== */

.site-topbar,
#header {
  background: linear-gradient(135deg, #0b1a3e 0%, #0d47a1 100%);
}

.site-topbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.875rem;
}

#header {
  z-index: 1025;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0.2rem 0.75rem rgba(15, 23, 42, 0.12);
}

#header .navbar-brand img {
  display: block;
}

#header .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.92) !important;
  border-radius: 0.375rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

#header .navbar-nav .nav-link:hover,
#header .navbar-nav .nav-link:focus,
#header .navbar-nav [aria-current="page"] {
  color: #fff ;
  background: rgba(255, 255, 255, 0.1);
}

/* Выпадающие меню основной навигации */
#header .dropdown-menu,
.site-topbar .dropdown-menu {
  background-color: #0b1a3e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.2);
}

#header .dropdown-item,
.site-topbar .dropdown-item,
.site-topbar .dropdown-header {
  color: #e6edf6 !important;
}

#header .dropdown-item:hover,
#header .dropdown-item:focus,
.site-topbar .dropdown-item:hover,
.site-topbar .dropdown-item:focus {
  background-color: #1565c0;
  color: #fff !important;
}

#header .dropdown-divider,
.site-topbar .dropdown-divider {
  border-top-color: rgba(255, 255, 255, 0.18);
}

.header-top-link {
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.header-top-link:hover,
.header-top-link:focus {
  color: #fff;
  text-decoration: underline;
}

.header-phone {
  display: flex;
  align-items: center;
  line-height: 1.05;
  white-space: nowrap;
}

.header-phone span {
  display: flex;
  flex-direction: column;
}

.header-phone strong {
  font-size: 0.93rem;
  font-weight: 700;
}

.header-phone small {
  margin-top: 0.15rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.7rem;
}

.header-phone-main strong {
  font-size: 1rem;
}

.header-messenger-btn,
.header-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  text-decoration: none;
  color: #fff;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.header-messenger-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  font-size: 1rem;
}

.header-messenger-btn:hover,
.header-messenger-btn:focus,
.header-action-btn:hover,
.header-action-btn:focus {
  color: #fff;
  transform: translateY(-1px);
}

.header-messenger-btn-telegram,
.header-action-telegram {
  background-color: #229ed9;
}

.header-messenger-btn-max,
.header-action-max {
  background: linear-gradient(135deg, #1ea7e8 0%, #8b5cf6 100%);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-action-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.4rem;
  font-size: 0.85rem;
}

.header-action-btn:not(.header-action-telegram):not(.header-action-max) {
  background: rgba(255, 255, 255, 0.08);
}

.header-action-btn:not(.header-action-telegram):not(.header-action-max):hover,
.header-action-btn:not(.header-action-telegram):not(.header-action-max):focus {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Регион */
.region-selector {
  border-radius: 50rem;
}

.region-dropdown {
  position: relative;
}

.region-confirm-mini {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 1050;
}

.region-confirm-card {
  min-width: 220px;
  padding: 0.75rem;
  color: #1f2937;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.65rem;
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.18);
  font-size: 0.85rem;
}

.region-confirm-title {
  color: #6b7280;
  font-size: 0.78rem;
}

.region-confirm-value {
  margin: 0.15rem 0 0.55rem;
  font-weight: 600;
}

.region-confirm-actions {
  display: flex;
  gap: 0.4rem;
}

.region-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
  max-height: 60vh;
  overflow: auto;
}

.region-list .region-item {
  text-align: left;
  white-space: normal;
}

/* Мобильный dropdown «Связаться» — специально светлый,
   чтобы не наследовать тёмное оформление основного меню. */
.contact-dropdown-toggle {
  white-space: nowrap;
}

#header .contact-menu {
  min-width: 285px;
  padding: 0.5rem !important;
  background: #fff !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 0.75rem;
  box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.2);
}

.contact-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  color: #1f2937 !important;
  text-decoration: none;
  border-radius: 0.5rem;
}

.contact-menu-item:hover,
.contact-menu-item:focus {
  color: #0d47a1 !important;
  background: #f1f5f9;
}

.contact-menu-item > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-menu-item strong {
  font-size: 0.9rem;
}

.contact-menu-item small {
  color: #6b7280;
  font-size: 0.73rem;
}

.contact-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 2.25rem;
  border-radius: 50%;
  color: #fff;
  background: #0d6efd;
}

.contact-menu-icon-telegram {
  background: #229ed9;
}

.contact-menu-icon-max {
  background: linear-gradient(135deg, #1ea7e8 0%, #8b5cf6 100%);
  font-size: 0.58rem;
  font-weight: 800;
}

.contact-menu-divider {
  height: 1px;
  margin: 0.35rem 0;
  background: #e5e7eb;
}

@media (max-width: 991.98px) {
  #header .navbar-collapse {
    padding-top: 0.75rem;
  }

  #header .navbar-nav .nav-link,
  #header .navbar-nav [aria-current="page"] {
    padding: 0.65rem 0.75rem;
  }

  #header .dropdown-menu {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
    box-shadow: none;
  }
}

@media (max-width: 575.98px) {
  #header .navbar-brand img {
    width: 80px;
    height: auto;
  }

  .contact-dropdown-toggle {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }
}

/* ==========================================================
   Остальные общие стили из прежнего header-custom.css
   сохранены, чтобы не ломать страницы, которые уже их используют.
   ========================================================== */

/* Test questions: allow wrapping on mobile, override global span nowrap */
.question,
.question .card-header,
.question .card-body,
.question .form-check-label,
.question span {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.12) !important;
}

.btn.rounded-pill {
  border-radius: 50rem !important;
}

.accordion-button:not(.collapsed) {
  background-color: rgba(13, 110, 253, 0.05);
  color: #0d6efd;
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: none;
  border-color: rgba(13, 110, 253, 0.2);
}

#coursesTabs .nav-link {
  color: #495057;
  font-weight: 500;
  transition: all 0.2s;
}

#coursesTabs .nav-link.active {
  background-color: #0d6efd;
  color: #fff;
}

#coursesTabs .nav-link:not(.active):hover {
  background-color: #e9ecef;
}

[data-counter] {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 575.98px) {
  .display-5 { font-size: 1.75rem; }
  .display-6 { font-size: 1.5rem; }
}

#scrollTopBtn {
  opacity: 0.8;
  transition: opacity 0.3s;
}

#scrollTopBtn:hover {
  opacity: 1;
}

.form-control:focus,
.form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

@media (max-width: 767.98px) {
  .d-flex.flex-wrap.gap-4.small span {
    flex-basis: 100%;
  }
}

footer {
  background-color: #0f172a !important;
  color: #e6edf6 !important;
  border-top: 3px solid #1565c0;
}

footer a {
  color: #94a3b8 !important;
}

footer a:hover {
  color: #fff !important;
}