/* ================================================
   МОДАЛЬНОЕ ОКНО С ФОРМОЙ ОБРАТНОЙ СВЯЗИ
   ================================================ */

/* Блокировка скролла при открытой модалке */
body.modal-open,
html.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9998;
    display: none;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: var(--radius);
    z-index: 1001;
    width: 90%;
    max-width: 550px;
}
.modal__content {
    position: relative;
    border-radius: var(--radius);
    padding: max(20px, 4rem);
}
.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: all .2s;

    &:hover {
        color: var(--primary-color);
    }

    & svg {
        width: 100%;
        height: 100%;
    }
}
.modal-form {
    margin-top: 30px;

    & .btn {
        width: 100%;
        border-radius: 16px;
        margin-top: 5rem;
    }
}
.input-wrapper,
.form-group {
    margin-bottom: 15px;

    & input,
    & textarea{
        width: 100%;
        height: 55px;
        border-radius: 16px;
        border: 1px solid transparent;
        padding: 0 20px;
        outline: none;
        font-size: 16px;
        font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        color: var(--text-color);
        background: #F4F4F4;
        transition: all .2s;

        &::placeholder {
            color: rgba(0,0,0, .5);
        }

        &:focus {
            border-color: var(--primary-color);
        }
    }
    & textarea {
        height: 250px;
        padding-top: 20px;
        resize: none;

        &::placeholder {
            color: rgba(0,0,0, .9);
        }
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: #f0f0f0;
    transform: rotate(90deg);
}

.modal-close svg {
    width: 24px;
    height: 24px;
    color: #666;
}

.modal-header {
    padding: 35px 35px 0;
}

.modal-header h2 {
    font-size: max(20px, 3rem);
    font-weight: 500;
    color: var(--text-color, #222);
}

.modal-header p {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

.modal-body {
    padding: 30px 40px 40px;
}

/* .form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color, #222);
    margin-bottom: 8px;
}

.form-group label .required {
    color: #e74c3c;
    margin-left: 4px;
} */

/* .form-input,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Google Sans', sans-serif;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color, #003366);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.form-input.error,
.form-textarea.error {
    border-color: #e74c3c;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
} */

.form-error {
    display: none;
    font-size: 13px;
    color: #e74c3c;
    margin-top: 6px;
}

.form-error.show {
    display: block;
}

.form-help {
    font-size: 13px;
    color: #999;
    margin-top: 6px;
}

/* Капча */
.captcha-container {
    margin: 24px 0;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Кнопка отправки */
.form-submit {
    width: 100%;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #141414;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-submit:hover:not(:disabled) {
    opacity: 0.8;
    transform: translateY(-2px);
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-submit.loading {
    position: relative;
    color: transparent;
}

.form-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Сообщение об успехе/ошибке */
.form-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    animation: slideDown 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
}

.form-message.show {
    display: block;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Чекбокс согласия */
.form-checkbox-group {
    margin: 20px 0;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
}

.form-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-right: 12px;
    margin-top: 2px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.form-checkbox input[type="checkbox"]:checked {
    background: #003366;
    border-color: #003366;
    outline: none;
}

.form-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 0;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-checkbox input[type="checkbox"]:focus {
    outline: 2px solid #003366;
    outline-offset: 2px;
}

.checkbox-label {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

.checkbox-label a {
    color: #003366;
    text-decoration: underline;
}

.checkbox-label a:hover {
    text-decoration: none;
}

.form-note {
    margin-top: 15px;
    text-align: center;
    color: #6b7280;
}

.form-note small {
    font-size: 12px;
    line-height: 1.5;
}

.form-note a {
    color: #003366;
    text-decoration: underline;
}

.form-note a:hover {
    text-decoration: none;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .modal-header,
    .modal-body {
        padding: 24px 20px;
    }

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

    .modal-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }
}
