.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.modal-container {
    background: #fff;
    border-radius: 16px;
    max-width: 520px;
    width: 90%;
    position: relative;
    animation: modalFadeIn 0.4s ease-out;
    margin: 0;
    z-index: 999999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 30px;
    color: white;
    position: relative;
}

.modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
    font-size: 28px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    line-height: 1;
    padding: 5px;
    border-radius: 50%;
}

.modal-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.modal-body {
    padding: 30px;
}

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

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

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

.required {
    color: #e74c3c;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: #999;
    font-size: 16px;
    z-index: 2;
    transition: color 0.3s ease;
}

.input-wrapper:focus-within .input-icon {
    color: #667eea;
}

.modal-form input,
.modal-form textarea {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8fafc;
    box-sizing: border-box;
}

.modal-form input:focus,
.modal-form textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.modal-form textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    padding-top: 15px;
}

.submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-icon {
    transform: translateX(5px);
}

/* Анимация для загрузки */
.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .btn-icon {
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        margin: 20px 0;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 350px;
    border-left: 4px solid;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #e8f8f5 0%, #d5f4e6 100%);
}

.notification.success i {
    color: #27ae60;
}

.notification.error {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, #fdf2f2 0%, #fce8e6 100%);
}

.notification.error i {
    color: #e74c3c;
}

.notification i {
    font-size: 18px;
}

.notification span {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

/* Анимация фокуса для полей */
.input-wrapper.focused {
    transform: scale(1.01);
}

.input-wrapper {
    transition: transform 0.2s ease;
}

/* Дополнительные эффекты для мобильных */
@media (max-width: 480px) {
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
    
    .modal-form input,
    .modal-form textarea {
        font-size: 16px; /* Предотвращает зум на iOS */
    }
}
