/* home-agreement.css - согласия, валидация и модалки соглашений */

/* ==================== 26. БЛОК СОГЛАСИЯ НА ОБРАБОТКУ ДАННЫХ ==================== */
.privacy-agreement {
    width: 100%;
    padding: 0.75rem 0;
    border-radius: var(--border-radius);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    order: 2;
    margin: 0.25rem 0 0.5rem;
}

.privacy-agreement:hover {
    border-color: var(--gray-300);
    background: var(--white);
    box-shadow: var(--shadow-soft);
}

.privacy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    padding: 0.125rem 1rem;
    border-radius: 6px;
    width: 100%;
    position: relative;
}

.privacy-checkbox:hover {
    background: rgba(59, 130, 246, 0.05);
}

.privacy-checkbox-input {
    display: none;
}

.privacy-checkbox-custom {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin-top: 1px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.privacy-checkbox-input:checked + .privacy-checkbox-custom {
    background: var(--gradient-primary);
    border-color: var(--primary-blue);
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.privacy-checkbox-input:checked + .privacy-checkbox-custom::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.privacy-text {
    font-size: 0.85rem;
    color: var(--gray-700);
    line-height: 1.4;
    flex: 1;
    transition: color 0.2s ease;
}

.privacy-checkbox:hover .privacy-text {
    color: var(--text-dark);
}

.privacy-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid transparent;
    padding: 0 1px;
    position: relative;
}

.privacy-link:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-blue);
}

.privacy-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-blue);
    transition: width 0.3s ease;
}

.privacy-link:hover::after {
    width: 100%;
}

/* РЕЖИМ ГРУЗЧИКОВ - ЧЕКБОКС НАД КНОПКОЙ */
.calculator-mode-loaders .total-price-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.calculator-mode-loaders .privacy-agreement {
    order: 1;
    margin: 0 0 0.25rem 0;
    width: 100%;
}

.calculator-mode-loaders .order-now-btn {
    order: 2;
    width: 100%;
    margin-left: 0;
    margin-top: 0;
}

/* ==================== 27. ВАЛИДАЦИЯ ФОРМЫ ЗАКАЗА ==================== */

/* Уведомление об ошибках валидации - БЕЗ ЗАГОЛОВКА */
.validation-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    width: 90%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

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

.validation-content {
    padding: 20px;
}

/* Заголовок удален - начинаем сразу со списка ошибок */
.validation-errors-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 0;
}

.validation-content--compact {
    cursor: pointer;
}

.validation-error-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    background: #fef2f2;
    border-radius: 8px;
    font-weight: 600;
    color: #dc2626;
    font-size: 15px;
    border-left: 4px solid #dc2626;
}

.validation-error-header i {
    margin-right: 10px;
    font-size: 16px;
}

.validation-error-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    color: #374151;
    font-size: 14px;
    margin-bottom: 8px;
    border-left: 3px solid #2563eb;
    background: #f8fbff;
    border-radius: 0 6px 6px 0;
    transition: background-color 0.2s;
}

.validation-error-item:hover {
    background: #eef5ff;
}

.validation-error-item:last-child {
    margin-bottom: 0;
}

.validation-error-item i {
    color: #2563eb;
    font-size: 12px;
    margin-right: 10px;
    margin-top: 3px;
    flex-shrink: 0;
}


/* Полоса прокрутки для списка ошибок */
.validation-errors-list::-webkit-scrollbar {
    width: 6px;
}

.validation-errors-list::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 3px;
}

.validation-errors-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.validation-errors-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Загрузка отправки заказа */
.order-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-loading-content {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.loading-spinner.large {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    color: #1f2937;
    font-weight: 600;
    font-size: 18px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== 28. СТИЛИ ДЛЯ МОДАЛЬНЫХ ОКОН СОГЛАШЕНИЙ ==================== */
.agreement-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
}

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

.agreement-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.agreement-modal__content {
    position: relative;
    z-index: 1101;
    width: 90%;
    max-width: 800px;
    margin: 40px auto;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-large);
    transform: translateY(30px);
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.agreement-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--gradient-primary);
    color: var(--white);
    min-height: 60px;
    flex-shrink: 0;
}

.agreement-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.agreement-modal__title i {
    font-size: 1.1rem;
}

.agreement-modal__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
}

.agreement-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.agreement-modal__body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 120px);
}

.agreement-content {
    font-family: 'Inter', sans-serif;
    color: #374151;
    line-height: 1.6;
    font-size: 14px;
}

.agreement-content p {
    margin-bottom: 0.75rem;
    text-align: justify;
    color: #374151;
    font-weight: 400;
}

/* Скроллбар */
.agreement-modal__body::-webkit-scrollbar {
    width: 8px;
}

.agreement-modal__body::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.agreement-modal__body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.agreement-modal__body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}


/* ===== v4/v5 validation style alignment ===== */
.validation-notification {
    border: 1px solid var(--notice-border);
    box-shadow: var(--notice-shadow);
}

.validation-error-header {
    background: #eff6ff;
    color: var(--notice-title);
    border-left-color: var(--notice-border-strong);
}

.validation-error-item {
    border-left-color: var(--notice-border-strong);
    background: #f8fbff;
}

.validation-error-item:hover {
    background: #eef5ff;
}

.validation-error-item i {
    color: var(--notice-icon-color);
}
