/* ===== МОДАЛЬНОЕ ОКНО ОБРАТНОГО ЗВОНКА ===== */

.callback-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.callback-modal-overlay.active {
    opacity: 1;
}

.callback-modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease;
}

.callback-modal-overlay.active .callback-modal {
    transform: translateY(0) scale(1);
}

.callback-modal-header {
    padding: var(--content-spacing-sm) var(--content-spacing-md) 0 var(--content-spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: var(--content-spacing-sm);
    flex-shrink: 0;
    background: var(--white);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.callback-modal-header h3,
.callback-modal-header .card-title {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-900) !important;
    line-height: 1.2;
}

.callback-modal-close {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: var(--content-spacing-xs);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.callback-modal-close:hover {
    background: var(--primary) !important;
    color: var(--white) !important;
}

.callback-modal-close svg {
    width: 20px;
    height: 20px;
}

.callback-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.callback-modal-body {
    padding: var(--content-spacing-md);
    overflow-y: auto;
    max-height: 50vh;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--white);
}

.callback-modal-body > p {
    margin: 0 0 var(--component-spacing-md) 0;
    color: var(--gray-600);
    line-height: 1.6;
    font-size: var(--font-size-sm);
}

/* Состояния успеха и ошибки */
.callback-success,
.callback-error {
    text-align: center;
    padding: 40px 20px;
}

.success-icon,
.error-icon {
    margin-bottom: 20px;
}

.callback-success h3,
.callback-error h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 600;
}

.callback-success h3 {
    color: #10b981;
}

.callback-error h3 {
    color: #ef4444;
}

.callback-success p,
.callback-error p {
    margin: 0 0 24px 0;
    color: #6b7280;
    line-height: 1.6;
}

/* Анимация спиннера */
.icon-spinner {
    animation: spin 1s linear infinite;
}

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

/* Адаптивность */
@media (max-width: 640px) {
    .callback-modal-overlay {
        padding: 0;
    }
    
    .callback-modal {
        max-width: 100%;
        margin: 0;
        height: 100vh;
        border-radius: 0;
    }
    
    .callback-modal-header {
        padding: 16px;
        padding-bottom: 16px;
    }
    
    .callback-modal-body {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: auto !important;
    }
    
    .callback-modal-footer {
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
        padding-bottom: 8px !important;
        margin-bottom: 0 !important;
    }
    
    .callback-modal-header h3 {
        font-size: 18px;
    }
    
    .callback-form {
        display: flex;
        flex-direction: column;
    }

    .callback-modal .form-group {
        width: 100%;
        margin-bottom: 16px;
    }
    
    .callback-form input,
    .callback-form select,
    .callback-form textarea {
        width: 100%;
        font-size: 16px; /* Предотвращает зум на iOS */
    }

    .callback-modal .form-checkbox {
        margin-top: 8px;
    }

    .callback-modal .btn {
        width: 100%;
        margin: 0;
    }

    /* Успех и ошибка на мобильных */
    .callback-success,
    .callback-error {
        padding: 24px 16px;
    }
}

/* Темная тема (опционально) */
@media (prefers-color-scheme: dark) {
    .callback-modal {
        background: #1f2937;
        color: white;
    }
    
    .callback-modal-header h3 {
        color: white;
    }
    
    .callback-modal-header {
        border-bottom-color: #374151;
    }
    
    .callback-form input,
    .callback-form textarea {
        background: #374151;
        border-color: #4b5563;
        color: white;
    }
    
    .callback-form input:focus,
    .callback-form textarea:focus {
        border-color: #3b82f6;
    }
    
    .callback-modal-close {
        color: #9ca3af;
    }
    
    .callback-modal-close:hover {
        background: #374151;
        color: white;
    }
}

/* Анимации появления */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Принудительные стили для надежности */
body .callback-modal-overlay {
    position: fixed !important;
    z-index: 999999 !important;
}

body .callback-modal-overlay.active {
    display: flex !important;
}

body .callback-modal {
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

/* Использую .btn-modal для уникальных особенностей кнопок в модалке, если нужно */
.btn.btn-modal,
.btn-primary.btn-modal {
    /* Добавьте необходимые стили для .btn.btn-modal и .btn-primary.btn-modal */
}

.callback-modal .form-control,
.callback-modal input,
.callback-modal select,
.callback-modal textarea {
  background: var(--white);
  color: var(--gray-900);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--content-spacing-md);
  font-size: var(--font-size-base);
  transition: all var(--transition-fast);
  width: 100%;
  box-sizing: border-box;
}

.callback-modal .form-control:focus,
.callback-modal input:focus,
.callback-modal select:focus,
.callback-modal textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
  background: var(--white);
  color: var(--gray-900);
}

.callback-modal-footer {
  padding: var(--content-spacing-sm) var(--content-spacing-sm);
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: var(--content-spacing-sm);
} 