/* ========================================
   Общие стили
   ======================================== */
body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    color: #ffffff;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: 18px;
}

html {
    scroll-behavior: smooth; /* Плавная прокрутка */
}

/* ========================================
   Шапка
   ======================================== */
header {
    background-color: #222;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.logo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    animation: swing 2s infinite alternate;
}

@keyframes swing {
    0% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(5deg);
    }
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 5px;
    background-color: #333;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    white-space: nowrap;
    display: inline-block;
}

nav a:hover {
    background-color: #ab47bc;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(171, 71, 188, 0.5);
}

/* ========================================
   Основная часть
   ======================================== */
main {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

section {
    background: linear-gradient(145deg, #333, #2a2a2a);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s forwards;
    overflow: hidden; /* Чтобы элементы не выходили за пределы */
}

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

h1 {
    color: #ab47bc;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
}

h2 {
    color: #ab47bc;
    font-size: 24px;
    font-weight: bold;
}

/* ========================================
   Изображения
   ======================================== */
img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(171, 71, 188, 0.5);
}

/* Изображения на главной странице */
.intro img {
    width: 300px;
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
}

.epidemic img {
    width: 300px;
    float: right;
    margin-left: 20px;
    margin-bottom: 20px;
}

.syndrome img {
    width: 300px;
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
}

.crisis img {
    width: 300px;
    float: right;
    margin-left: 20px;
    margin-bottom: 20px;
}

.support img {
    width: 500px;
    float: right;
    margin-left: 20px;
    margin-bottom: 20px;
    max-width: 100%;
}

/* ========================================
   Переопределение стилей для иконок в секции "Спасательные протоколы"
   ======================================== */
/* ========================================
   Сброс всех эффектов и точное выравнивание иконок в .support-options
   ======================================== */
.support-options .icon {
    /* 1) Жёсткий размер в ширину, высота – auto, чтобы сохранять пропорции */
    width: 32px;
    height: auto;

    /* 2) Убираем любые float’ы */
    float: none !important;

    /* 3) Отступ справа (между иконкой и текстом) */
    margin: 0 8px 0 0;

    /* 4) Сбрасываем любые закругления, тени, фоны, анимации, которые могли быть у img */
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: none !important;
    transition: none !important;
    transform: none !important;

    /* 5) Выравнивание по вертикали:
       - vertical-align: middle ставит центр иконки примерно по центру текста
       - position: relative + top: 2px чуть опускает изображение вниз, 
         чтобы центр иконки совпал с серединой строчных букв.
       Если у вас шрифт или line-height другие, возможно,
       хватит `top: 1px` или нужно `top: 3px`. Попробуйте менять.
    */
    vertical-align: middle;
    position: relative;
    top: -2px;
}

/* 6) Убираем любые эффекты при наведении (hover), если наследуются от img:hover */
.support-options .icon:hover {
    box-shadow: none !important;
    transform: none !important;
    background: none !important;
}



/* Изображения в секциях проблем */
.problems-section.odd img {
    width: 250px;
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
}

.problems-section.even img {
    width: 250px;
    float: right;
    margin-left: 20px;
    margin-bottom: 20px;
}

/* ========================================
   Текст и выравнивание
   ======================================== */
section:not(.support) p {
    text-align: justify;
    margin: 0 0 20px 0;
}

section:not(.support) img {
    margin-bottom: 20px;
    max-width: 45%;
}

section:not(.support) img[style*="float: left"],
section:not(.support) .odd img {
    float: left;
    margin-right: 25px;
    margin-left: 0;
}

section:not(.support) img[style*="float: right"],
section:not(.support) .even img {
    float: right;
    margin-left: 25px;
    margin-right: 0;
}

section:not(.support) img + p {
    margin-top: 0;
    overflow: hidden;
    text-align: justify;
}

section:not(.support) p ~ p {
    clear: none;
    margin-left: 0;
    margin-right: 0;
}

section:not(.support) p ~ p:not(:first-of-type) {
    display: flow-root;
}

/* ========================================
   Кастомные списки
   ======================================== */
ul.custom-list {
    list-style: none;
    padding-left: 0;
    margin-left: 25px;
    position: relative;
    overflow: hidden;
}

section:not(.support) ul.custom-list {
    margin-left: 0;
    padding-left: 25px;
}

ul.custom-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}

ul.custom-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: #ab47bc;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-50%) scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

section:not(.support) ul.custom-list {
    display: flow-root;
}

section.syndrome ul.custom-list {
    margin-left: 25px;
}

/* ========================================
   Секция "Спасательные протоколы"
   ======================================== */
.support {
    background: linear-gradient(145deg, #5a5a5a, #4a4a4a);
    color: #f5f5f7;
}

.support h2, .support h3 {
    color: #FFD700;
}

.support p {
    color: #f5f5f7;
}

/* ========================================
   Кнопки
   ======================================== */
button {
    background-color: #333;
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    font-weight: bold;
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
}

button:hover {
    background-color: #ab47bc;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(171, 71, 188, 0.5);
}

/* ========================================
   Цитаты
   ======================================== */
blockquote {
    position: relative;
    max-width: 75%;
    text-align: center;
    margin: 30px auto;
    padding: 25px 35px;
    border-left: 4px solid #ab47bc;
    background: 
        linear-gradient(145deg, rgba(50, 50, 50, 0.95), rgba(40, 40, 40, 0.95)),
        radial-gradient(circle at 10% 50%, rgba(171, 71, 188, 0.15), transparent 60%),
        radial-gradient(circle at 90% 50%, rgba(171, 71, 188, 0.15), transparent 60%);
    color: #f0f0f0;
    box-shadow: 0 0 30px rgba(171, 71, 188, 0.1) inset, 0 5px 20px rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    font-family: 'Merriweather', serif;
    font-size: 16px;
    line-height: 1.7;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    overflow: hidden;
    border: 1px solid rgba(171, 71, 188, 0.2);
}

blockquote::before,
blockquote::after {
    content: "“";
    position: absolute;
    font-family: 'Playfair Display', serif;
    font-size: 3.5em;
    color: #ab47bc;
    opacity: 0.5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

blockquote::before {
    top: -12px;
    left: 15px;
}

blockquote::after {
    content: "”";
    bottom: -28px;
    right: 15px;
}

blockquote:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(171, 71, 188, 0.2) inset, 0 8px 25px rgba(171, 71, 188, 0.3);
    background: 
        linear-gradient(145deg, rgba(60, 60, 60, 0.95), rgba(50, 50, 50, 0.95)),
        radial-gradient(circle at 10% 50%, rgba(171, 71, 188, 0.25), transparent 60%),
        radial-gradient(circle at 90% 50%, rgba(171, 71, 188, 0.25), transparent 60%);
    border-left-color: #d06be0;
}

/* ========================================
   Секция метафоры
   ======================================== */
.hero-metaphor {
    background: 
        linear-gradient(145deg, #1a1a1a, #0d0d0d),
        radial-gradient(circle at 70% 30%, #2d2d2d 20%, transparent 50%);
    border: 1px solid #3a3a3a;
    margin: 50px 0;
    padding: 60px 20px;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.7) inset;
}

.hero-metaphor h2 {
    font-size: 2.4em;
    color: #d4d4d4;
    text-align: center;
    margin: 0 auto 30px;
    max-width: 800px;
    text-shadow: 0 0 15px rgba(171, 71, 188, 0.3);
    transition: color 0.3s;
}

.metaphor-text {
    font-size: 1.15em;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto;
    padding: 25px;
    color: #c7c7c7;
    border-left: 3px solid #ab47bc;
    background: rgba(50, 50, 50, 0.15);
}

.metaphor-image {
    width: 100%;
    max-width: 750px !important;
    display: block;
    margin: 0 auto 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* ========================================
   Истории клиентов
   ======================================== */
.stories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
}

.story {
    text-align: center;
    background: #333;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.story img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.story h3 {
    font-size: 18px;
    margin: 10px 0;
    color: #ab47bc;
}

.story p {
    font-size: 16px;
    text-align: center;
    color: #f0f0f0;
}

.story-content {
    max-height: 100px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.story.expanded .story-content {
    max-height: 1000px;
}

.story-toggle {
    display: block;
    background-color: #333;
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.story-toggle:hover {
    background-color: #ab47bc;
}

.story.expanded .story-toggle::after {
    content: "Скрыть";
}

.story-toggle::after {
    content: "Читать дальше";
}

/* ========================================
   Секция видео
   ======================================== */
.video-section {
    background: linear-gradient(145deg, #333, #2a2a2a);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s forwards;
}

.video-section h2 {
    color: #ab47bc;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
}

.video-section p {
    text-align: center;
    margin-bottom: 30px;
}

.video-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.video-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-item video {
    width: 100%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.video-item p {
    margin-top: 10px;
    text-align: center;
    font-size: 16px;
    color: #f0f0f0;
}

/* ========================================
   Страница авторизации
   ======================================== */
.auth-section {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    padding: 30px;
    box-sizing: border-box;
}

.auth-section input {
    width: calc(100% - 24px);
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #444;
    border-radius: 5px;
    background: #2a2a2a;
    color: #fff;
    font-size: 16px;
    box-sizing: border-box;
}

.auth-section input:focus {
    border-color: #ab47bc;
    box-shadow: 0 0 8px rgba(171, 71, 188, 0.3);
}

.auth-buttons {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.auth-section button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.message {
    margin-top: 25px;
    padding: 15px;
    border-radius: 5px;
    background: rgba(171, 71, 188, 0.1);
    border: 1px solid #ab47bc;
    display: none;
}

.message.show {
    display: block;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ab47bc;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loader--small {
    width: 20px;
    height: 20px;
}

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

/* ========================================
   Футер
   ======================================== */
footer {
    background-color: #222;
    padding: 20px;
    text-align: center;
    font-size: 14px;
}

footer p {
    margin: 5px 0;
}

.pulse-text {
    color: #ab47bc;
    animation: pulse-color 1.5s ease-in-out infinite;
}

@keyframes pulse-color {
    0% {
        text-shadow: 0 0 5px #ab47bc;
    }
    50% {
        text-shadow: 0 0 20px #ab47bc;
    }
    100% {
        text-shadow: 0 0 5px #ab47bc;
    }
}

.support a {
    color: #FFD700; /* Золотой цвет, как у заголовков в .support */
    text-decoration: none; /* Убираем подчеркивание */
    font-weight: bold;
    transition: color 0.3s, text-shadow 0.3s;
}

.support a:hover {
    color: #ffffff; /* Белый при наведении */
    text-shadow: 0 0 10px #FFD700; /* Золотое свечение */
}


/* ========================================
   Адаптивность
   ======================================== */
@media (max-width: 768px) {
    /* Общие стили для мобильных устройств */
    header {
        flex-direction: column;
        padding: 10px;
    }

    nav { /* Добавили стили для nav */
        width: 100%; /* Заставим nav занять всю ширину */
    }

    nav ul {
        flex-direction: column;
        align-items: center; /* Это центрирует элементы списка по горизонтали */
        justify-content: center;
        gap: 10px;
        padding: 0; /* Убираем внутренние отступы у списка */
        margin: 0; /* Убираем внешние отступы у списка */
        width: 100%; /* Список также занимает всю ширину */
    }

    nav li { /* Добавили стили для li, если они существуют и влияют */
        width: 90%; /* Например, кнопки будут 90% ширины nav */
        max-width: 300px; /* И не более 300px, чтобы не были слишком широкими на планшетах */
        margin: 0 auto; /* Центрируем сам li, если он не на всю ширину */
    }

    nav a {
        display: block; /* Убедимся, что ссылка является блоком */
        width: 100%;    /* Занимает всю ширину родительского li */
        text-align: center;
        padding: 10px 0; /* Можете настроить вертикальные отступы по вкусу */
        box-sizing: border-box; /* Чтобы padding не влиял на общую ширину */
    }

    main {
        padding: 20px;
    }

    section {
        padding: 20px;
    }

    .logo {
        width: 200px; /* Логотип больше в 2 раза */
        height: auto;
    }

    img { /* Это общее правило для всех img в мобильной версии */
        display: block;
        margin: 0 auto 20px; /* auto для левого/правого margin центрирует блочный элемент */
        width: 100%; /* Изображения занимают 100% ширины родительского контейнера */
        max-width: 100%; /* Дополнительно для уверенности */
        height: auto; /* Сохраняет пропорции */
    }

h1 {
    font-size: 28px;
    text-align: center;
}
h2 {
    font-size: 22px;
    text-align: center;
}
h3 {
    text-align: center;
}

    /* Кнопка "получить помощь" по центру */
    .support button {
        display: block;
        margin: 0 auto;
    }

    /* Истории клиентов: полностью развернуты, без кнопок */
    .stories {
        grid-template-columns: 1fr;
    }
.story-content {
    max-height: none !important;
    overflow: visible !important;
}
.story-toggle {
    display: none !important;
}


    /* Проблемы ученых: картинки между заголовком и текстом */
    .problems-section {
        display: flex;
        flex-direction: column;
    }
    .problems-section h2 {
        order: 1;
    }
.problems-section img {
    width: 100% !important;
    height: auto !important;
    float: none !important;
    margin: 20px auto !important;
    display: block !important;
}
	
    .problems-section p {
        order: 3;
    }
	
/* ======== Иконки в .support-options на мобильных ======== */
.support-options p {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
}

.support-options .icon {
    width: 24px !important;
    top: -1px; /* может быть 0px или -2px в зависимости от результата */
}


    /* Дополнительные стили для сохранения текущего поведения */
    section:not(.support) img {
        float: none;
        max-width: 100%;
        margin: 0 auto 20px;
    }

    section:not(.support) p ~ p {
        display: block;
    }

    blockquote {
        max-width: 90%;
        padding: 20px;
        margin: 25px auto;
        font-size: 15px;
    }

    blockquote::before,
    blockquote::after {
        font-size: 2.5em;
    }

    .support img {
        width: 100%;
    }

    .hero-metaphor {
        padding: 40px 15px;
        margin: 30px 0;
    }

    .hero-metaphor h2 {
        font-size: 1.8em;
        padding: 0 10px;
    }

    .metaphor-text {
        max-width: 90%;
        padding: 20px;
        font-size: 1.05em;
    }

    .metaphor-image {
        max-width: 90%;
    }

    .video-container {
        grid-template-columns: 1fr;
    }
}