/* Сброс стилей для модальных окон */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    overflow: hidden !important;
}

.modal-open {
    display: flex !important;
    animation: modalFadeIn 0.3s ease-out;
}

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

.modal-container {
    width: 100%;
    max-width: 500px;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background-color: #2c3e50;
    color: white;
    flex-shrink: 0;
}

.modal-content {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(90vh - 73px);
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Специальные стили для демо-модального окна */
#demoModal .modal-container {
    max-width: 1200px !important;
    height: 90vh !important;
    width: 95% !important;
    margin: 5vh auto !important;
}

#demoModal .modal-content {
    padding: 0 !important;
    height: calc(100% - 73px) !important;
}

/* Стили для демо-портала */
#portalContainer {
    background: white;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    height: 100% !important;
    min-height: 400px;
    position: relative;
}

/* Стили для модального окна цен */
.pricing-card {
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.pricing-card.popular {
    border-color: #4f46e5;
}

/* Стили для FAQ модалки */
.faq-question {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.faq-question:hover {
    border-left-color: #3b82f6;
    background-color: #f8fafc;
}

/* Стили для политики безопасности */
.policy-content h2 {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.policy-content h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    border-radius: 3px;
}

/* Анимация для загрузки */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.policy-content section {
    animation: fadeIn 0.5s ease-out;
}

/* Стили для таблицы в политике */
table {
    border-collapse: separate;
    border-spacing: 0;
}

table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

table td, table th {
    padding: 12px 16px;
}

table tbody tr {
    transition: background-color 0.2s ease;
}

table tbody tr:hover {
    background-color: #f8fafc;
}

/* Стили для модалки "О нас" */
.about-stat {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Стили для основного сайта */
.hero-section {
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: #4f46e5;
    color: white;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn-primary:hover {
    background-color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.2);
}

.btn-secondary {
    background-color: white;
    color: #4f46e5;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
    border: 2px solid #4f46e5;
    cursor: pointer;
    font-size: 16px;
}

.btn-secondary:hover {
    background-color: #f8fafc;
    transform: translateY(-2px);
}

/* Формы */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.required::after {
    content: " *";
    color: #ef4444;
}

/* Плавный скролл */
html {
    scroll-behavior: smooth;
}

/* Улучшаем отображение текста в модалках */
.modal-content p, .modal-content li, .modal-content span {
    line-height: 1.6;
}

/* Улучшаем доступность фокуса */
button:focus-visible, 
a:focus-visible, 
input:focus-visible, 
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ============ ФИКСЫ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ ============ */

/* Фикс для скролла на мобильных */
html, body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

/* Убираем подсветку при тапе на мобильных */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Предотвращаем масштабирование на double tap на мобильных */
* {
    touch-action: pan-y;
}

/* Специальные стили для мобильных кнопок */
#openDemoBtnMobile {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    background-color: #4f46e5 !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
}

#openDemoBtnMobile:active {
    background-color: #4338ca !important;
    transform: scale(0.95) !important;
}

/* Фикс для кнопок на мобильных устройствах */
@media (hover: none) and (pointer: coarse) {
    .btn-primary:hover, .btn-secondary:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .feature-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .pricing-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .faq-question:hover {
        background-color: inherit !important;
        border-left-color: transparent !important;
    }
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    /* ============ КРИТИЧЕСКИЕ ФИКСЫ ДЛЯ МОДАЛЬНЫХ ОКОН ============ */
    
    /* ПЕРЕОПРЕДЕЛЯЕМ ВСЕ МОДАЛЬНЫЕ ОКНА ДЛЯ МОБИЛЬНЫХ */
    .modal-overlay {
        all: unset !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.95) !important;
        display: none !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 999999 !important;
        padding: 15px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    .modal-overlay.modal-open {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .modal-container {
        all: unset !important;
        display: block !important;
        width: 100% !important;
        max-width: 500px !important;
        background: white !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
        max-height: 85vh !important;
        animation: mobileModalAppear 0.3s ease !important;
    }
    
    @keyframes mobileModalAppear {
        0% {
            opacity: 0;
            transform: translateY(50px) scale(0.9);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    .modal-header {
        all: unset !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 15px 20px !important;
        background: #2c3e50 !important;
        color: white !important;
    }
    
    .modal-content {
        all: unset !important;
        display: block !important;
        padding: 20px !important;
        max-height: calc(85vh - 70px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .close-modal {
        all: unset !important;
        background: none !important;
        border: none !important;
        color: white !important;
        font-size: 24px !important;
        cursor: pointer !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }
    
    /* Демо-модалка на весь экран */
    #demoModal .modal-container {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }
    
    #demoModal .modal-content {
        height: calc(100vh - 60px) !important;
        max-height: none !important;
    }
    
    #portalContainer {
        min-height: 300px;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* ============ ОБЩИЕ СТИЛИ ДЛЯ МОБИЛЬНЫХ ============ */
    
    .btn-primary, .btn-secondary {
        padding: 12px 24px !important;
        font-size: 14px !important;
        min-height: 44px !important;
        min-width: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Улучшаем шапку для мобильных */
    nav .hidden.md\\:flex {
        display: none !important;
    }
    
    /* Показываем мобильные кнопки */
    .md\\:hidden {
        display: flex !important;
    }
    
    /* Скрываем десктопные кнопки */
    .hidden.md\\:inline-flex {
        display: none !important;
    }
    
    /* Уменьшаем логотип на мобильных */
    nav .text-2xl {
        font-size: 1.25rem !important;
    }
    
    /* Улучшаем отступы на мобильных */
    .hero-section {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
    
    section {
        padding: 40px 0 !important;
    }
    
    /* Улучшаем features-grid на мобильных */
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* Улучшаем таблицы на мобильных */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Улучшаем формы на мобильных */
    .form-input {
        font-size: 16px !important;
        padding: 14px 16px !important;
        min-height: 44px !important;
    }
    
    /* Увеличиваем область клика для всех интерактивных элементов */
    button, 
    a.btn-primary, 
    a.btn-secondary, 
    .form-input,
    .close-modal,
    nav a,
    footer a {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    /* Улучшаем навигационные ссылки */
    nav a, footer a {
        display: flex !important;
        align-items: center !important;
        padding: 10px 0 !important;
    }
    
    /* Улучшаем отображение pricing cards на мобильных */
    .pricing-card {
        margin-bottom: 20px;
    }
    
    /* Улучшаем кнопку демо в навигации */
    #openDemoBtnMobile {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 12px !important;
        margin-right: 0 !important;
        margin-left: 10px !important;
    }
    
    /* Улучшаем все кнопки в герое */
    .hero-section button {
        width: 100% !important;
        margin-bottom: 10px !important;
        justify-content: center !important;
    }
    
    /* Улучшаем кнопки в футере */
    footer button {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    /* Улучшаем навигацию на мобильных */
    nav .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Убедимся, что кнопки кликабельны */
    button {
        z-index: 10 !important;
        position: relative !important;
        pointer-events: auto !important;
    }
    
    /* Отключаем возможные перекрытия */
    .hero-section button,
    #features button,
    section button {
        z-index: 100 !important;
    }
    
    /* Увеличиваем зону клика для всех кнопок */
    .btn-primary, .btn-secondary {
        padding: 12px 20px !important;
        min-height: 48px !important;
        font-size: 16px !important;
    }
    
    /* Стили для ссылок в футере и навигации на мобильных */
    footer a, nav a {
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(79, 70, 229, 0.1) !important;
    }
}

/* Предотвращаем всплывающую клавиатуру на iOS при фокусе на кнопках */
button, [role="button"] {
    -webkit-user-select: none;
    user-select: none;
}

/* Улучшаем отклик кнопок на тач-устройствах */
@media (hover: none) and (pointer: coarse) {
    .btn-primary:active,
    .btn-secondary:active,
    #openDemoBtnMobile:active,
    button:active {
        transform: scale(0.95) !important;
        transition: transform 0.1s !important;
        opacity: 0.9 !important;
    }
}

/* Улучшаем видимость активных состояний на мобильных */
@media (max-width: 768px) {
    .btn-primary:active,
    .btn-secondary:active,
    button:active,
    #openDemoBtnMobile:active {
        opacity: 0.8;
        transform: scale(0.98);
    }
    
    /* Улучшаем видимость нажатия на ссылки */
    nav a:active,
    footer a:active {
        color: #4f46e5 !important;
        background-color: rgba(79, 70, 229, 0.1) !important;
        border-radius: 4px !important;
    }
}

/* Фикс для body при открытом модальном окне */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Фикс для iOS Safari */
@supports (-webkit-touch-callout: none) {
    html, body {
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-content,
    #portalContainer {
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Предотвращаем zoom в формах на iOS */
    input.form-input,
    textarea.form-input,
    select.form-input {
        font-size: 16px !important;
    }
    
    /* Фикс для fixed элементов на iOS */
    .modal-overlay {
        position: fixed;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Фикс для кнопок на iOS */
    button {
        cursor: pointer !important;
    }
    
    /* Улучшаем отображение кнопки демо на iOS */
    #openDemoBtnMobile {
        -webkit-tap-highlight-color: rgba(79, 70, 229, 0.3) !important;
    }
}

/* Фикс для старых Android */
@media screen and (-webkit-min-device-pixel-ratio:0) and (max-width: 768px) {
    .modal-content {
        overflow-y: scroll !important;
    }
}

/* Фикс для скроллбаров на десктопе */
@media (min-width: 769px) {
    .modal-content::-webkit-scrollbar {
        width: 8px;
    }
    
    .modal-content::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .modal-content::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    
    .modal-content::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

/* Дополнительные стили для улучшения UX на мобильных */
.mobile-device .btn-primary,
.mobile-device .btn-secondary {
    touch-action: manipulation;
}

.mobile-device a[href="#"] {
    cursor: pointer;
}

/* Улучшение видимости активных элементов на мобильных */
@media (max-width: 768px) {
    :focus {
        outline: 2px solid #4f46e5 !important;
        outline-offset: 2px !important;
    }
    
    button:focus-visible,
    a:focus-visible {
        outline: 2px solid #4f46e5 !important;
        outline-offset: 2px !important;
    }
}
/* Добавьте в конец файла styles.css */

/* ============ КРАСИВЫЕ УВЕДОМЛЕНИЯ ============ */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
    width: 90%;
}

.notification {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-left: 5px solid #4f46e5;
    animation: slideInRight 0.3s ease forwards;
    transform: translateX(120%);
    position: relative;
    overflow: hidden;
}

.notification.success {
    border-left-color: #10b981;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.warning {
    border-left-color: #f59e0b;
}

.notification.info {
    border-left-color: #3b82f6;
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5, transparent);
}

.notification.success::before {
    background: linear-gradient(90deg, #10b981, transparent);
}

.notification-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.notification.success .notification-icon {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.notification.info .notification-icon {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 5px;
    color: #1f2937;
}

.notification-message {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    margin-left: 10px;
    transition: color 0.2s;
}

.notification-close:hover {
    color: #6b7280;
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.notification-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #8b5cf6);
    animation: progressBar 4s linear forwards;
}

.notification.success .notification-progress-bar {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.notification.info .notification-progress-bar {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.notification.closing {
    animation: slideOutRight 0.3s ease forwards;
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
    
    .notification {
        padding: 15px;
    }
    
    .notification-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Модальное окно с конфирмацией */
.confirmation-modal {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.confirmation-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.3s ease;
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
}

.confirmation-icon.success {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    animation: bounceIn 0.6s ease;
}

.confirmation-icon.info {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
    animation: bounceIn 0.6s ease;
}

.confirmation-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1f2937;
}

.confirmation-message {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirmation-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Пульсация для успешной отправки */
.pulse-success {
    animation: pulseSuccess 2s infinite;
}

@keyframes pulseSuccess {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}