/**
 * Стили для модального окна "Подобрать компанию"
 * findcert.ru
 */

/* Кнопка "Оформить документ" */
.btn-selection {
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-selection:hover {
    background: #000000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

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

.btn-selection-icon {
    font-size: 20px;
}

/* Оверлей модального окна */
.selection-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

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

/* Модальное окно */
.selection-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    z-index: 9999;
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.selection-modal.active {
    display: block;
}

/* Заголовок модального окна */
.selection-modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.selection-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.selection-modal-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.selection-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.selection-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Тело модального окна */
.selection-modal-body {
    padding: 30px;
}

/* Форма */
.selection-form-group {
    margin-bottom: 20px;
}

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

.selection-form-label-optional {
    font-weight: 400;
    color: #9ca3af;
    font-size: 12px;
}

.selection-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

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

.selection-form-input.error {
    border-color: #ef4444;
}

.selection-form-input::placeholder {
    color: #9ca3af;
}

/* Подсказка */
.selection-form-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 20px;
    padding: 12px;
    background: #f0f9ff;
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    font-size: 13px;
    color: #1e40af;
}

.selection-form-hint-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Сообщение об ошибке */
.selection-form-error {
    display: none;
    margin-top: 20px;
    padding: 12px 16px;
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    border-radius: 6px;
    color: #991b1b;
    font-size: 14px;
}

.selection-form-error.show {
    display: block;
    animation: shake 0.4s ease;
}

/* Сообщение об успехе */
.selection-form-success {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.selection-form-success.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.selection-form-success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.selection-form-success-title {
    font-size: 20px;
    font-weight: 700;
    color: #059669;
    margin: 0 0 10px 0;
}

.selection-form-success-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Футер модального окна */
.selection-modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.selection-btn-submit {
    flex: 1;
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.selection-btn-submit:hover:not(:disabled) {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

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

.selection-btn-cancel {
    background: #f3f4f6;
    color: #4b5563;
    border: none;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selection-btn-cancel:hover {
    background: #e5e7eb;
}

/* Спиннер загрузки */
.selection-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.selection-btn-submit.loading .selection-spinner {
    display: block;
}

.selection-btn-submit.loading .selection-btn-text {
    display: none;
}

/* Honeypot (скрытое поле для защиты от ботов) */
.selection-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .selection-modal {
        max-width: 100%;
        margin: 0 10px;
        border-radius: 12px;
    }
    
    .selection-modal-header {
        padding: 20px 20px 15px;
    }
    
    .selection-modal-title {
        font-size: 20px;
    }
    
    .selection-modal-body {
        padding: 20px;
    }
    
    .selection-modal-footer {
        padding: 15px 20px 20px;
        flex-direction: column;
    }
    
    .selection-btn-submit,
    .selection-btn-cancel {
        width: 100%;
    }
    
    .btn-selection {
        font-size: 14px;
        padding: 10px 20px;
    }
}

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

