/* ========================================
   ОБЩИЕ СТИЛИ МОДАЛЬНЫХ ОКОН
   ======================================== */

/* Оверлей модального окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    overflow-y: auto;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* Контейнер модального окна */
.modal {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    position: relative;
    margin: auto;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    z-index: 10000;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

/* Кнопка закрытия */
.modal__close {
    width: 30px;
    height: 30px;
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease;
    display: block;
}

.modal__close:hover {
    transform: rotate(90deg);
}

.modal__close::before,
.modal__close::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 2px;
    background-color: #333;
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.modal__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.modal__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.modal__close:hover::before,
.modal__close:hover::after {
    background-color: #e74c3c;
}

/* ========================================
   КОНТЕНТ МОДАЛЬНЫХ ОКОН
   ======================================== */

/* Общие стили заголовков */
.modal__content h2,
.modal h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #222;
    text-align: center;
}

.modal-subtitle {
    font-size: 16px;
    color: #666;
    text-align: center;
    margin-bottom: 25px;
}

/* Стили для модального окна политики */
.modal__politics {
    padding: 20px;
}

.modal__politics h2 {
    font-size: 27px;
    text-align: center;
    margin-bottom: 20px;
}

.modal__politics h3 {
    font-size: 20px;
    text-align: center;
    margin-top: 19px;
    margin-bottom: 7px;
}

.modal__politics p {
    font-size: 16px;
    margin-bottom: 3px;
    line-height: 1.5;
}

/* ========================================
   ПРЕИМУЩЕСТВА В МОДАЛЬНОМ ОКНЕ
   ======================================== */

.modal-benefits {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.modal-benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-benefit-item:last-child {
    margin-bottom: 0;
}

.modal-benefit-item svg {
    flex-shrink: 0;
}

.modal-benefit-item span {
    font-size: 15px;
    color: #333;
}

/* ========================================
   ФОРМЫ В МОДАЛЬНЫХ ОКНАХ
   ======================================== */

.modal-form {
    width: 100%;
}


.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.form-group .input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    margin-bottom: 0;
}

.form-group .input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ffd54f;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.required {
    color: #e74c3c;
}

.btn-block {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    cursor: pointer;
}

/* ========================================
   ПОЛИТИКА КОНФИДЕНЦИАЛЬНОСТИ
   ======================================== */

.policy {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.policy input[type="checkbox"] {
    display: none;
}

.policy__check {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.policy__check img {
    width: 12px;
    height: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.policy input:checked + .policy__check {
    background: #ffd54f;
    border-color: #ffd54f;
}

.policy input:checked + .policy__check img {
    opacity: 1;
}

.policy__text a {
    color: #ffd54f;
    text-decoration: underline;
}

/* ========================================
   СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ АКЦИЙ
   ======================================== */

.promo-badge-modal {
    display: inline-block;
    background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
    color: #333;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.promo-conditions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.promo-conditions h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #222;
}

.promo-conditions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.promo-conditions li {
    padding-left: 24px;
    margin-bottom: 10px;
    position: relative;
    font-size: 14px;
    color: #555;
}

.promo-conditions li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #48a43f;
    font-weight: 700;
}

/* ========================================
   СТИЛИ ДЛЯ ДИАГНОСТИКИ
   ======================================== */

.diagnostic-info {
    margin-bottom: 25px;
}

.diagnostic-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
}

.diagnostic-item:last-child {
    margin-bottom: 0;
}

.diagnostic-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.diagnostic-item h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #222;
}

.diagnostic-item p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* ========================================
   АДАПТИВНОСТЬ: ПЛАНШЕТЫ (до 1024px)
   ======================================== */

@media screen and (max-width: 1024px) {
    .modal {
        max-width: 540px;
        width: 85%;
        padding: 35px 25px;
    }

    .modal__content h2,
    .modal h2 {
        font-size: 24px;
    }

    .modal-subtitle {
        font-size: 15px;
    }

    .modal__close {
        width: 28px;
        height: 28px;
        top: 18px;
        right: 18px;
    }

    .modal__close::before,
    .modal__close::after {
        width: 18px;
    }

    .modal__politics h2 {
        font-size: 24px;
        margin-bottom: 18px;
    }

    .modal__politics h3 {
        font-size: 18px;
        margin-top: 16px;
        margin-bottom: 6px;
    }

    .modal__politics p {
        font-size: 15px;
    }
}

/* ========================================
   АДАПТИВНОСТЬ: МОБИЛЬНЫЕ (до 768px)
   ======================================== */

@media screen and (max-width: 768px) {
    .modal-overlay {
        padding: 15px;
        align-items: flex-start;
    }

    .modal {
        max-width: 100%;
        width: 95%;
        padding: 30px 20px;
        margin-top: 20px;
    }

    .modal__content h2,
    .modal h2 {
        font-size: 22px;
    }

    .modal-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .modal__close {
        width: 28px;
        height: 28px;
        top: 12px;
        right: 12px;
    }

    .modal__close::before,
    .modal__close::after {
        width: 16px;
    }

    .modal-benefits {
        padding: 15px;
    }

    .modal-benefit-item {
        font-size: 14px;
    }

    .form-group .input,
    .form-group select,
    .form-group textarea {
        font-size: 14px;
        padding: 10px 12px;
    }

    .btn-block {
        padding: 12px 18px;
        font-size: 15px;
    }

    .promo-conditions {
        padding: 15px;
    }

    .diagnostic-item {
        padding: 12px;
        gap: 12px;
    }

    .diagnostic-icon {
        font-size: 28px;
    }

    .modal__politics h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .modal__politics h3 {
        font-size: 16px;
        margin-top: 12px;
        margin-bottom: 5px;
    }

    .modal__politics p {
        font-size: 14px;
        margin-bottom: 2px;
    }
}

/* ========================================
   АДАПТИВНОСТЬ: МАЛЫЕ МОБИЛЬНЫЕ (до 480px)
   ======================================== */

@media screen and (max-width: 480px) {
    .modal {
        width: 98%;
        padding: 25px 15px;
    }

    .modal__content h2,
    .modal h2 {
        font-size: 20px;
    }

    .modal__close {
        width: 30px;
        height: 30px;
        top: 10px;
        right: 10px;
    }

    .modal__close::before,
    .modal__close::after {
        width: 16px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .diagnostic-item {
        flex-direction: column;
        text-align: center;
    }

    .modal__politics h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .modal__politics h3 {
        font-size: 15px;
        margin-top: 10px;
        margin-bottom: 4px;
    }

    .modal__politics p {
        font-size: 13px;
        line-height: 1.4;
    }
}

/* ========================================
   ДОПОЛНИТЕЛЬНЫЕ УТИЛИТЫ
   ======================================== */

/* Скрытие скролла body при открытом модальном окне */
body.modal-open {
    overflow: hidden;
}

/* Анимация появления */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-overlay.active .modal {
    animation: modalFadeIn 0.3s ease;
}
