/* ============================================
   MODAL OVERLAY STYLES
   ============================================ */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    background: white;
    border-radius: 0;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalFadeIn 0.3s ease;
}

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

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-light);
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Modal Body */
.modal-body {
    padding: 24px;
}

/* Modal Form Group */
.modal-form-group {
    margin-bottom: 24px;
}

.modal-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark);
    font-size: 0.95rem;
}

.modal-form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.modal-form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Radio Group - уменьшенные отступы и вертикальное выравнивание */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 12px;
    transition: background 0.3s ease;
    min-height: 36px;
}

.radio-label:hover {
    background: var(--light);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    margin: 0;
    flex-shrink: 0;
}

.radio-label span {
    font-size: 0.95rem;
    color: var(--dark);
    line-height: 1.3;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-btn-cancel,
.modal-btn-submit {
    flex: 1;
    padding: 12px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
}

.modal-btn-cancel {
    background: var(--light);
    color: var(--gray);
}

.modal-btn-cancel:hover {
    background: var(--gray-light);
    transform: translateY(-1px);
}

.modal-btn-submit {
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

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

/* Modal Result */
.modal-result {
    padding: 24px;
}

.result-header {
    text-align: center;
    margin-bottom: 20px;
}

.result-header i {
    font-size: 48px;
    color: var(--secondary);
    margin-bottom: 12px;
}

.result-header h3 {
    font-size: 1.5rem;
    color: var(--dark);
    margin: 0;
}

.result-content {
    background: var(--light);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    line-height: 1.6;
    color: var(--gray);
    font-size: 0.95rem;
    max-height: 400px;
    overflow-y: auto;
}

.result-content p {
    margin-bottom: 12px;
}

.result-content p:last-child {
    margin-bottom: 0;
}

.result-content strong {
    color: var(--dark);
}

.result-content hr {
    margin: 12px 0;
    border: none;
    border-top: 1px solid var(--gray-light);
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 12px;
}

.modal-btn-close,
.modal-btn-detail {
    flex: 1;
    padding: 12px;
    border-radius: 40px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.modal-btn-close {
    background: var(--light);
    color: var(--gray);
    border: none;
}

.modal-btn-close:hover {
    background: var(--gray-light);
    transform: translateY(-1px);
}

.modal-btn-detail {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.modal-btn-detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Scrollbar for modal */
.modal-container::-webkit-scrollbar {
    width: 6px;
}

.modal-container::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 10px;
}

.modal-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsive */
@media (max-width: 480px) {
    .modal-container {
        width: 95%;
        border-radius: 0;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-form-group label {
        font-size: 0.85rem;
        gap: 6px;
    }
    
    .radio-label {
        padding: 4px 8px;
        min-height: 32px;
    }
    
    .radio-label span {
        font-size: 0.85rem;
    }
    
    .result-header h3 {
        font-size: 1.2rem;
    }
    
    .result-content {
        font-size: 0.85rem;
        padding: 16px;
    }
    
    .modal-btn-cancel,
    .modal-btn-submit,
    .modal-btn-close,
    .modal-btn-detail {
        padding: 10px;
        font-size: 0.85rem;
    }
}