/* /assets/css/modal.css - Стили для модального окна и компактной капчи */

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal__content {
    position: relative;
    background: var(--white);
    padding: 35px 30px;
    border-radius: var(--radius);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}

.modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary);
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal__close:hover {
    background: var(--light);
    color: var(--danger);
}

.modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 25px;
    text-align: center;
    padding-right: 20px;
}

/* ===== ФОРМА В МОДАЛКЕ ===== */
.modal-form__group {
    margin-bottom: 15px;
}

.modal-form__input,
.modal-form__textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--white);
    font-family: inherit;
}

.modal-form__input:focus,
.modal-form__textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 125, 225, 0.1);
}

.modal-form__textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.modal-form__input.error,
.modal-form__textarea.error {
    border-color: var(--danger);
}

/* Счетчик символов */
.modal-form__counter {
    text-align: right;
    font-size: 12px;
    color: var(--secondary);
    margin-top: 5px;
}

.modal-form__counter .current-count {
    font-weight: 600;
    color: var(--primary);
    transition: color 0.3s ease;
}

.modal-form__counter.warning .current-count {
    color: var(--warning);
}

.modal-form__counter.danger .current-count {
    color: var(--danger);
}

/* ===== КОМПАКТНАЯ КАПЧА ===== */
.modal-form__captcha {
    background: #f8faff;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(42, 125, 225, 0.1);
}

.modal-captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.modal-captcha-image {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.captcha-img {
    width: 140px;
    height: 44px;
    border-radius: 8px;
    border: 2px solid var(--gray);
    cursor: pointer;
    object-fit: cover;
    transition: all 0.3s ease;
}

.captcha-img:hover {
    border-color: var(--primary);
}

.modal-captcha-refresh {
    width: 44px;
    height: 44px;
    border: 2px solid var(--gray);
    border-radius: 8px;
    background: var(--white);
    color: var(--primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.modal-captcha-refresh:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: rotate(180deg);
}

.modal-captcha-refresh:active {
    animation: rotate 0.3s ease;
}

.modal-captcha-input {
    flex: 1;
}

.modal-captcha-input .modal-form__input {
    height: 44px;
    padding: 10px 16px;
}

.modal-form__hint {
    font-size: 11px;
    color: var(--secondary);
    margin-top: 5px;
    text-align: left;
    padding-left: 2px;
}

/* ===== ЧЕКБОКС ===== */
.modal-form__checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--secondary);
    line-height: 1.4;
}

.modal-form__checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray);
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
}

.modal-form__checkbox input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.modal-form__checkbox a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.modal-form__checkbox a:hover {
    text-decoration: underline;
}

/* ===== КНОПКА ===== */
.modal-form__btn {
    width: 100%;
    height: 48px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-form__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(42, 125, 225, 0.25);
}

.modal-form__btn:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== АНИМАЦИИ ===== */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 15px 25px;
    color: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: slideIn 0.3s ease;
    max-width: 350px;
    font-size: 14px;
    line-height: 1.5;
}

.notification--success {
    background: linear-gradient(135deg, var(--success) 0%, #218838 100%);
}

.notification--error {
    background: linear-gradient(135deg, var(--danger) 0%, #c82333 100%);
}

.notification--info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.notification.fade-out {
    animation: slideOut 0.3s ease forwards;
}

/* ===== ПОЛЯ С ОШИБКАМИ ===== */
.field-error {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 5px;
    display: none;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 480px) {
    .modal__content {
        padding: 25px 20px;
    }
    
    .modal__title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .modal-captcha-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-captcha-image {
        justify-content: space-between;
    }
    
    .captcha-img {
        width: calc(100% - 50px);
    }
    
    .modal-form__btn {
        height: 44px;
        font-size: 14px;
    }
    
    .modal-form__input,
    .modal-form__textarea {
        padding: 10px 14px;
    }
}

@media (max-width: 360px) {
    .modal-form__checkbox {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}