/* Основной контейнер */
.container-fluid {
    position: relative;
    z-index: 1;
}

/* Фоновое изображение */
.bg_main {
    background-image: url(../img/elements/banner.png);
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: cover;
    width: 100%;
    height: 90vh; /* Увеличиваем высоту на весь экран */
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
}

.padding_text {
  padding: 50px 0;                    /* добавляем отступы для текста */
}

/* Контент-обертка */
.content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1320px;
    margin: 0 auto;
    height: 100%;
    padding: 0 15px;
    position: relative;
    z-index: 3;  /* Изменяем на 3, чтобы контент был над плавающими элементами */
}

/* Плавающие элементы */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;  /* Изменяем с -2 на 2, чтобы элементы были над фоном */
}

.floating-circle, .floating-square, .floating-triangle, 
.floating-dot, .floating-ring, .floating-cross, .floating-plus {
    position: absolute;
    opacity: 0.2;
    animation: float 15s infinite linear;
}

/* Футер сайта (не использовать отрицательный z-index — ссылки станут некликабельными) */
.footer {
    position: relative;
    z-index: 5;
    flex-shrink: 0;
    padding: 1.5rem 0;
    background-image: radial-gradient(circle at 50% 50%, #0b4f9e, #041526);
    color: #fff;
    text-align: center;
    pointer-events: auto;
}

/* Супермен */
.image-content {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    z-index: 0;  /* располагаем над плавающими элементами */
}

.image-content img {
    max-width: 100%; /* Размер изображения */
    height: auto;
    margin-right: -15%;
    margin-top: 50px;
    position: relative;              /* убираем дублирующий z-index */
}

/* Текст */
.text-promo {
    flex: 1;
    padding-right: 30px;
    position: relative;
    z-index: 4;  /* Изменяем на 4, чтобы текст был над всем */
}

/* Общие стили для текстовых элементов */
.text-promo h3, 
.text-promo h5, 
.text-promo p {
    margin-bottom: 1.5rem;
    color: #ffffff;
    position: relative;
    z-index: 1000;
}

/* Главный заголовок с новым шрифтом */
.main-title {
    font-family: 'Arsenal SC', sans-serif;
    font-size: 5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: titleGlow 2s infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }
    to {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(13, 110, 253, 0.6);
    }
}

/* Стили для терминального промта */
.terminal-prompt {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 30px;
    font-family: 'Courier New', monospace;
    color: #33ff33;
    display: flex;
    align-items: center;
    box-shadow: 0 0 15px rgba(51, 255, 51, 0.3);
    max-width: 600px;
}

.prompt-symbol {
    color: #33ff33;
    font-weight: bold;
    margin-right: 10px;
    font-size: 1.5rem;
}

.prompt-text {
    color: #ffffff;
    font-size: 1.2rem;
    line-height: 1.5;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background-color: #33ff33;
    margin-left: 5px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* Стильная кнопка */
.boxed-btn4 {
    display: inline-block;
    padding: 15px 35px;
    background: white;
    color: rgb(33, 33, 33) !important;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 184, 148, 0.2);
    position: relative;
    z-index: 1000;
    margin-top: 20px;  /* Добавляем отступ сверху */
}

.boxed-btn4:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px #1f1f1f4d;
    background: radial-gradient(circle at 50% 50%, #05aa26, #046217);
    color: white !important;
}

/* Футуристичная анимация */
.futuristic-animation {
    position: absolute;
    top: 100px; /* Отступ сверху, чтобы не перекрывать меню */
    right: 0;
    width: 40%;
    height: 100%;
    z-index: 3; /* Увеличиваем z-index, чтобы элемент был видимым */
    overflow: hidden;
    pointer-events: none; /* Чтобы анимация не блокировала клики */
}

.animation-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Пульсирующий круг */
.circle-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 2px solid rgba(13, 110, 253, 0.5);
    box-shadow: 0 0 20px rgba(13, 110, 253, 0.5);
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.3;
    }
}

/* Шестиугольник */
.hexagon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 115px;
    background-color: rgba(13, 110, 253, 0.2);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Поток данных */
.data-stream {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(13, 110, 253, 0.05) 20%, 
        rgba(13, 110, 253, 0.1) 50%, 
        rgba(13, 110, 253, 0.05) 80%, 
        transparent 100%);
    animation: dataFlow 5s linear infinite;
}

@keyframes dataFlow {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(100%);
    }
}

/* Сетка линий */
.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(13, 110, 253, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(13, 110, 253, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: gridMove 10s linear infinite;
}

@keyframes gridMove {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 20px 20px;
    }
}

/* Частицы */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: particlesFade 8s ease-in-out infinite alternate;
}

@keyframes particlesFade {
    0% {
        opacity: 0.3;
        background-size: 20px 20px;
    }
    50% {
        opacity: 0.7;
        background-size: 30px 30px;
    }
    100% {
        opacity: 0.3;
        background-size: 20px 20px;
    }
}

/* Медиа-запросы для адаптивности */
@media (max-width: 768px) {
    .main-title {
        font-size: 3rem;
    }
    
    .terminal-prompt {
        padding: 10px;
    }
    
    .prompt-text {
        font-size: 1rem;
    }
    
    .futuristic-animation {
        width: 100%;
        height: 100%;
        opacity: 0.3;
    }
    
    .content-wrapper {
        flex-direction: column;
        text-align: center;
    }
    
    .text-promo {
        padding-right: 0;
        margin-bottom: 20px;
    }
}

/* Baseline для Bootstrap-навбаров: без фиксированной высоты (многострочная шапка, sticky) */
.navbar {
    z-index: 1000;
}
/* Для активного пункта меню */
.navbar .nav-link.active {
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #0d6efd;                /* Изменение цвета */
    text-shadow: 0 0 1px rgba(13, 110, 253, 0.3);  /* Легкое свечение */
    
    /* Подчеркивание снизу */
    &::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 100%;
        height: 2px;
        background: linear-gradient(90deg, #0d6efd, #041526);
        border-radius: 2px;
    }
}

/* Для выпадающего меню */
.navbar .dropdown-item {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    letter-spacing: 0.8px;
}


/* Остальные стили навбара остаются без изменений */

/* Круг */
.floating-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #138eb0;
    top: 20%;
    left: 20%;
}

/* Маленький круг */
.floating-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ffc107;
    top: 40%;
    left: 25%;
    animation: floatFast 10s infinite linear;
}

/* Кольцо */
.floating-ring {
    width: 40px;
    height: 40px;
    border: 4px solid #dc3545;
    border-radius: 50%;
    top: 15%;
    right: 30%;
    animation: floatSlow 20s infinite linear;
}

/* Квадрат */
.floating-square {
    width: 40px;
    height: 40px;
    background: #28a745;
    top: 60%;
    right: 15%;
    animation-delay: -5s;
}

/* Треугольник */
.floating-triangle {
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 45px solid #dc3545;
    top: 30%;
    right: 30%;
    animation-delay: -10s;
}

/* Крестик */
.floating-cross {
    width: 30px;
    height: 30px;
    position: absolute;
    top: 70%;
    left: 20%;
    animation: floatRotate 12s infinite linear;
}

.floating-cross:before,
.floating-cross:after {
    content: '';
    position: absolute;
    background: #17a2b8;
}

.floating-cross:before {
    width: 100%;
    height: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.floating-cross:after {
    width: 4px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

/* Плюсик */
.floating-plus {
    font-size: 40px;
    color: rgba(13, 110, 253, 0.45);
    top: 45%;
    right: 40%;
    animation: floatBounce 8s infinite ease-in-out;
}

/* Разные анимации */
@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(20px, 20px) rotate(180deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

@keyframes floatFast {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(30px, -30px) rotate(180deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

@keyframes floatSlow {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, 20px) scale(1.2); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes floatRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes floatBounce {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-15px, 15px) rotate(15deg); }
}

/* Анимация для текста */
.animate-text {
    animation: slideIn 1s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Анимация для параграфа */
.fade-in {
    animation: fadeIn 1.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Пульсирующая кнопка */
.pulse-button {
    transition: transform 0.3s ease;
}

.pulse-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

/* Анимация для картинки */
.bounce-animation {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;      /* элементы располагаются друг под другом */
        text-align: center;          /* центрируем текст */
    }

    .text-promo {
        padding-right: 0;            /* убираем отступ справа */
        margin-bottom: 20px;         /* добавляем отступ снизу */
    }

    .image-content {
        justify-content: center;     /* центрируем изображение */
    }

    .image-content img {
        max-width: 100%;            /* возвращаем стандартную ширину */
        margin-right: 0;            /* убираем отрицательный отступ справа */
        margin-top: 0;              /* убираем отступ сверху */
    }
}

/* Иерархия z-index:
   Навбар, текст: 1000
   Контент-обертка: 3
   Супермен: 0
   Плавающие элементы: 2
   Фон: 1
   Футер: см. единый блок .footer выше (z-index положительный)
*/

/* Также добавим overflow-x: hidden для body, чтобы гарантировать отсутствие прокрутки */
body {
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    color: #1d1d1d;
}

.navbar .nav-link {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 1px;
    position: relative;
    transition: all 0.3s ease;
}

/* Стили для прижатия футера к низу */
html, body {
    height: 100%;
}

.wrapper {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* Стили для форм */
.form-control {
    border-radius: 4px;
    border: 1px solid #ced4da;
    padding: 10px 15px;
    height: auto;
    font-size: 15px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

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

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.card {
    border: none;
    box-shadow: 0 0 20px rgba(0,0,0,0.08);
    border-radius: 8px;
    color: #1d1d1d;  /* Базовый цвет текста для карточек */
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f8f9fa;
    padding: 20px;
}

.card-body {
    padding: 30px;
}

/* Аватар в карточке профиля: явные размеры — иначе SVG (Multiavatar) с img-fluid может дать нулевую высоту */
.profile-card-avatar {
    display: block;
    max-width: 150px;
    width: 150px;
    height: 150px;
    object-fit: cover;
    background-color: #e9ecef;
}

.card-footer {
    background-color: #fff;
    border-top: 2px solid #f8f9fa;
    padding: 20px;
}

.btn-primary {
    padding: 10px 25px;
    font-weight: 500;
    letter-spacing: 0.5px;
    background-color: #0d6efd;
    border-color: #0d6efd;
    transition: all 0.2s ease;
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    color: #ffffff !important;
}

/* Стили для сообщений об ошибках */
.alert-danger {
    background-color: #fff2f2;
    border-color: #ffdbdb;
    color: #d63939;
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 4px;
    margin-top: 5px;
}

/* Стили для подсказок */
.form-text {
    color: #6c757d;
    font-size: 13px;
    margin-top: 5px;
}

/* Стили для требований к паролю */
.password-requirements {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid #0d6efd;
}

.password-requirements p {
    font-size: 14px;
    margin-bottom: 8px;
    color: #495057;
}

.password-requirements ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.password-requirements li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 4px;
}

.password-requirements li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #0d6efd;
}

/* Стили для CKEditor */
.ck-editor__editable {
    min-height: 400px !important;
}

.ck.ck-editor {
    width: 100% !important;
}

.ck-editor__editable_inline {
    padding: 0 1rem !important;
}

/* Основной контент, исключая главную страницу и меню */
.container:not(.home-container) {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Для форм и других элементов */
.card-body,
.form-control,
.btn:not(.navbar-btn),
.alert,
.list-group-item {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Для текста в CKEditor */
.ck-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Стили для отображения контента CKEditor */
.lecture-content {
    color: #1d1d1d;
}

.lecture-content * {
    color: #1d1d1d;
}

/* Если есть вложенные элементы с белым цветом */
.lecture-content p,
.lecture-content span,
.lecture-content div,
.lecture-content h1,
.lecture-content h2,
.lecture-content h3,
.lecture-content h4,
.lecture-content h5,
.lecture-content h6,
.lecture-content li {
    color: #1d1d1d !important;
}

/* Принудительно масштабируем все изображения */
.lecture-content img {
    width: 100% !important;
    height: auto !important;
    max-width: 800px !important;
    margin: 0 auto !important;
    display: block !important;
}

/* Делаем изображения в лекциях респонсивными */
.lecture-content img,
.responsive-image {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin: 1rem auto !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    .lecture-content img,
    .responsive-image {
        width: 100% !important;
    }
}

/* Логотип в навбарах без класса site-navbar (quest, wheel и т.д.) */
.navbar:not(.site-navbar) .navbar-brand img {
    height: 40px;
    width: auto;
    max-width: 150px;
    outline: none !important;
    border: none !important;
}

/* Устранение обводки логотипа при фокусе */
.navbar-brand:focus,
.navbar-brand:active,
.navbar-brand:hover {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Переопределяем цвета текста в карточках */
.card,
.card-header,
.card-body,
.card-title,
.card-text {
    color: #1d1d1d;  /* Убираем !important */
}

/* Специфичные стили для карточек в кабинете преподавателя */
.teacher-dashboard .card-title,
.teacher-content .card-title,
body[class*="teacher"] .card-title,
.teacher-dashboard .card-header h5,
.teacher-content .card-header h5,
body[class*="teacher"] .card-header h5 {
    color: #1d1d1d !important;  /* Явно задаем темный цвет для заголовков */
}

/* Для текста в формах */
.form-label,
.form-control,
.form-select,
.form-check-label {
    color: #1d1d1d !important;
}

/* Для списков */
.list-group-item {
    color: #1d1d1d !important;
}

/* Исключения для бейджей и кнопок */
.badge,
.btn {
    color: unset !important;
}

/* Переопределяем цвета текста в карточках */
.card,
.card-header,
.card-body,
.card-title,
.card-text {
    color: #1d1d1d;  /* Убираем !important */
}

/* Специфичные стили для карточек в кабинете преподавателя */
.teacher-dashboard .card-title,
.teacher-content .card-title,
body[class*="teacher"] .card-title,
.teacher-dashboard .card-header h5,
.teacher-content .card-header h5,
body[class*="teacher"] .card-header h5 {
    color: #1d1d1d !important;  /* Явно задаем темный цвет для заголовков */
}

/* Для текста в формах */
.form-label,
.form-control,
.form-select,
.form-check-label {
    color: #1d1d1d !important;
}

/* Для списков */
.list-group-item {
    color: #1d1d1d !important;
}

/* Исключения для бейджей и кнопок */
.badge,
.btn {
    color: unset !important;
}

/* Специфичные стили для кнопок в кабинете преподавателя */
.teacher-dashboard .btn-primary,
.teacher-content .btn-primary,
body[class*="teacher"] .btn-primary {
    color: #ffffff !important;
}

.teacher-dashboard .btn-primary:hover,
.teacher-content .btn-primary:hover,
body[class*="teacher"] .btn-primary:hover {
    color: #ffffff !important;
}

/* Общее переопределение для всех основных кнопок */
.btn.btn-primary {
    color: #ffffff !important;
}

.btn.btn-primary:hover {
    color: #ffffff !important;
}

/* Сброс наследования цвета для кнопок */
.badge,
.btn {
    color: unset !important;
}

/* Специфичные стили для карточек в кабинете преподавателя */
.test-card .card-header h5,
.test-card .card-header .mb-0 {
    color: #1d1d1d !important;
}

/* Общие стили для текста в карточках тестов */
.test-card .card-text,
.test-card .text-muted,
.test-card small {
    color: #6c757d !important;
}

/* Убираем дублирующиеся стили */
.card,
.card-header,
.card-body,
.card-title,
.card-text {
    color: unset;  /* Сбрасываем цвет */
}

/* Стили для бейджей с оценками */
.badge {
    font-size: 0.875rem;
    padding: 0.35em 0.65em;
    font-weight: 600;
}

.bg-purple {
    background-color: #0d6efd !important;
    color: #fff !important;
}

.bg-danger {
    background-color: #dc3545 !important;
    color: #fff !important;
}

.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.bg-success {
    background-color: #198754 !important;
    color: #fff !important;
}

.bg-secondary {
    background-color: #6c757d !important;
    color: #fff !important;
}

/* Добавим стили для заголовков в карточках */
.card-header h2,
.card-header h5,
.card-body h5,
.card-title {
    color: #1d1d1d !important;  /* Темный цвет для заголовков в карточках */
}

/* Исключение для текста на главной странице */
.bg_main .text-promo h3,
.bg_main .text-promo h5,
.bg_main .text-promo p {
    color: #ffffff;
}

.highlight {
    color: #ff4500; /* Цвет для выделения */
    font-weight: bold; /* Жирное начертание */
    text-transform: uppercase; /* Все буквы в верхнем регистре */
    margin-right: 0.2em; /* Небольшой отступ справа */
}

/* Стили для таблиц в вопросах */
.question-text table {
    width: auto;
    margin: 1rem 0;
    border-collapse: collapse;
}

.question-text td, 
.question-text th {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    text-align: center;
}

.question-text figure.table {
    margin: 1rem 0;
}

/* Центрирование изображений из CKEditor (figure class="... image-style-align-center ...")
   Важно: на главной странице контент рендерится в .blog-post-content, поэтому правило
   должно быть глобальным (а не только внутри шаблонов). */
.blog-post-content figure.image-style-align-center,
.blog-post-content figure.image.image-style-align-center {
    float: none !important;
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
}

/* В некоторых случаях выравнивание живёт на figure только как image_resized + image-style-align-center. */
.blog-post-content figure.image_resized.image-style-align-center {
    float: none !important;
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
}

/* Ссылки в теле постов (CKEditor): отличимы от текста, мягкая подсветка при наведении */
.blog-post-content a,
body.home-fresh .blog-post-excerpt.blog-post-content a {
    color: #0f766e;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
    text-decoration-color: rgba(15, 118, 110, 0.42);
    border-radius: 0.2em;
    transition: color 0.18s ease, background-color 0.18s ease, text-decoration-color 0.18s ease;
}

.blog-post-content a:hover,
body.home-fresh .blog-post-excerpt.blog-post-content a:hover {
    color: #0d9488;
    background-color: rgba(38, 166, 154, 0.16);
    text-decoration-color: rgba(13, 148, 136, 0.85);
}

.blog-post-content a:focus-visible,
body.home-fresh .blog-post-excerpt.blog-post-content a:focus-visible {
    outline: 2px solid #26a69a;
    outline-offset: 2px;
}

/* ========== Шапка сайта: свежий минимализм (site-navbar) ========== */
.site-navbar.navbar {
    position: sticky;
    top: 0;
    z-index: 1500;
    height: auto !important;
    min-height: 4.25rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    align-items: center;
    font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: rgba(255, 255, 255, 0.78) !important;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 4px 24px rgba(15, 23, 42, 0.06);
    isolation: isolate;
}

.site-navbar .dropdown-menu {
    z-index: 1600;
}

.site-navbar > .container {
    align-items: center;
    row-gap: 0.5rem;
}

.site-navbar .navbar-brand {
    margin-left: 0 !important;
    padding-right: 0.5rem;
    padding-top: 0;
    padding-bottom: 0;
    flex: 0 0 auto;
    align-items: center;
}

.site-navbar-logo {
    height: 46px !important;
    width: auto !important;
    max-height: 48px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-navbar .navbar-brand:hover .site-navbar-logo {
    opacity: 0.92;
    transform: scale(1.02);
}

.site-navbar .site-nav-link {
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
    color: #475569 !important;
    padding: 0.5rem 0.95rem !important;
    border-radius: 999px;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.site-navbar .site-nav-link:hover,
.site-navbar .site-nav-link:focus {
    color: #049622 !important;
    background: rgba(4, 150, 34, 0.09);
    box-shadow: none;
}

.site-navbar .site-nav-link.active {
    font-weight: 600;
    color: #049622 !important;
    background: rgba(4, 150, 34, 0.12);
    text-shadow: none;
}

.site-navbar .nav-link-login {
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    letter-spacing: -0.01em;
    color: #fff !important;
    background: linear-gradient(135deg, #05a827 0%, #049622 45%, #037a1b 100%) !important;
    padding: 0.5rem 1.35rem !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 14px rgba(4, 150, 34, 0.35);
    border: none !important;
    min-height: 42px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.site-navbar .nav-link-login:hover,
.site-navbar .nav-link-login:focus {
    color: #fff !important;
    filter: brightness(1.05);
    box-shadow: 0 6px 20px rgba(4, 150, 34, 0.45);
    transform: translateY(-1px);
}

.site-navbar-avatar {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 0 3px rgba(4, 150, 34, 0.35);
}

.site-navbar .site-nav-user.dropdown-toggle::after {
    margin-left: 0.35rem;
    opacity: 0.55;
}

.site-navbar-dropdown.dropdown-menu {
    margin-top: 0.65rem !important;
    padding: 0.5rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12);
    min-width: 13rem;
}

.site-navbar-dropdown .dropdown-item {
    font-family: "DM Sans", system-ui, sans-serif;
    font-weight: 500;
    letter-spacing: -0.01em;
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    color: #334155;
}

.site-navbar-dropdown .dropdown-item:hover,
.site-navbar-dropdown .dropdown-item:focus {
    background: rgba(4, 150, 34, 0.08);
    color: #049622;
}

.site-navbar-dropdown .dropdown-divider {
    margin: 0.4rem 0.5rem;
    opacity: 0.12;
}

.site-navbar-toggler {
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.04);
}

.site-navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(4, 150, 34, 0.25);
}

.site-navbar .navbar-toggler-icon {
    filter: brightness(0.35);
}

@media (max-width: 991.98px) {
    /* Непрозрачная полоса: иначе полупрозрачный фон смешивается с текстом страницы при прокрутке */
    .site-navbar.navbar {
        background: #fff !important;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 4px 20px rgba(15, 23, 42, 0.06);
    }

    /*
     * Нельзя flex-wrap: nowrap: третий ребёнок (.navbar-collapse) с flex-basis: 100%
     * оказывается в одной строке с брендом и гамбургером и сжимается до нуля —
     * ссылки меню рисуются поверх контента страницы.
     */
    .site-navbar > .container {
        flex-wrap: wrap;
        align-items: center;
    }

    .site-navbar .navbar-toggler {
        margin-left: auto;
    }

    .site-navbar .navbar-collapse.collapsing {
        overflow: hidden;
    }

    .site-navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        max-width: 100%;
        flex-grow: 1;
        min-width: 0;
        background: #fff;
        border: 1px solid rgba(15, 23, 42, 0.1);
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
        overflow: hidden;
    }

    .site-navbar .navbar-nav {
        width: 100%;
        max-width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
        align-items: stretch !important;
        gap: 0.15rem;
    }

    .site-navbar .navbar-nav .nav-item {
        width: 100%;
        max-width: 100%;
    }

    .site-navbar .site-nav-link {
        border-radius: 12px;
        width: 100%;
        max-width: 100%;
        justify-content: flex-start !important;
        box-sizing: border-box;
    }

    .site-navbar .site-nav-user {
        max-width: 100%;
    }

    .site-navbar .site-nav-user .text-truncate {
        max-width: min(10rem, 55vw) !important;
    }

    .site-navbar .nav-link-login {
        width: 100%;
        max-width: 100%;
        margin-top: 0.35rem;
        box-sizing: border-box;
    }

    .site-navbar .dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100%;
        max-width: 100%;
        margin-top: 0.35rem !important;
        margin-bottom: 0.25rem;
        border: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: none;
    }
}

@media (max-width: 768px) {
    .site-navbar .navbar-brand img.site-navbar-logo {
        height: 40px !important;
    }

    .site-navbar .navbar-nav .nav-link:not(.nav-link-login) {
        padding: 0.75rem 1rem;
        min-height: 44px;
    }

    .site-navbar .navbar-toggler {
        padding: 0.5rem;
        border: none;
        min-height: 44px;
        min-width: 44px;
    }

    .site-navbar .navbar-collapse {
        margin-top: 0.75rem;
        padding: 0.5rem 0 0.75rem;
        border-radius: 14px;
    }

    .site-navbar .dropdown-item {
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .site-navbar .navbar-brand img.site-navbar-logo {
        height: 36px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-navbar .site-nav-link,
    .site-navbar .nav-link-login,
    .site-navbar .navbar-brand:hover .site-navbar-logo {
        transition: none;
    }
    .site-navbar .nav-link-login:hover,
    .site-navbar .nav-link-login:focus {
        transform: none;
    }
}

/* Юридические страницы и футер */
.legal-doc-page .legal-doc-inner {
    max-width: 42rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.legal-doc-page .legal-doc-inner h2 {
    color: #2c3e50;
}

.legal-doc-crosslinks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 0.35rem;
    text-align: center;
}

.legal-doc-crosslinks__sep {
    color: #adb5bd;
    user-select: none;
}

.footer .footer-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    max-width: 100%;
    margin: 0 auto;
    color: #fff;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.footer .footer-strip__copy {
    color: #fff;
    flex-shrink: 1;
    min-width: 0;
}

.footer .footer-strip__sep {
    color: rgba(255, 255, 255, 0.55);
    flex-shrink: 0;
    user-select: none;
}

.footer .footer-strip__link {
    color: #fff !important;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    flex-shrink: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.footer .footer-strip__link:hover,
.footer .footer-strip__link:focus {
    color: #fff !important;
    text-decoration-thickness: 2px;
}

.footer .footer-strip__link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    border-radius: 2px;
}
