/* Основные переменные */
:root { 
    --primary-blue: #2563eb; 
    --primary-green: #10b981; 
    --header-bg: #ffffff;
    --footer-bg: #0f172a;
}

/* Базовые стили */
* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body { 
    font-family: 'Inter', sans-serif; 
    background-color: #f8fafc; 
    color: #1e293b;
    overflow-x: hidden; 
    -webkit-font-smoothing: antialiased; 
    scroll-behavior: smooth;
}

/* Скроллбар */
::-webkit-scrollbar { 
    width: 10px; 
    height: 10px; 
}

::-webkit-scrollbar-track { 
    background: #f1f5f9; 
    border-radius: 10px; 
}

::-webkit-scrollbar-thumb { 
    background: linear-gradient(180deg, var(--primary-blue), #1d4ed8); 
    border-radius: 10px; 
    border: 2px solid #f1f5f9; 
}

/* Херо секция */
.hero-gradient {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(16, 185, 129, 0.05) 50%, rgba(255, 255, 255, 1) 100%);
    position: relative; 
    overflow: hidden;
}

.hero-gradient::before { 
    content: ''; 
    position: absolute; 
    width: 600px; 
    height: 600px; 
    border-radius: 50%; 
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0) 70%); 
    top: -300px; 
    right: -200px; 
    z-index: 0; 
}

/* Навигация */
.tab-nav-container { 
    display: flex; 
    overflow-x: auto; 
    scrollbar-width: none; 
    flex-wrap: nowrap; 
}

.tab-nav-container::-webkit-scrollbar { 
    display: none; 
}

.tab-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    color: #64748b; 
    padding: 0.75rem 1.5rem;
    font-weight: 700; 
    border-radius: 12px; 
    background: #f1f5f9; 
    margin: 0 4px; 
    white-space: nowrap;
    cursor: pointer;
    border: none;
    outline: none;
}

.tab-btn.active { 
    color: white; 
    background: linear-gradient(135deg, var(--primary-blue), #1d4ed8); 
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3); 
    transform: translateY(-2px); 
}

/* Виджеты */
.widget-loader {
    position: absolute; 
    inset: 0; 
    background: rgba(255, 255, 255, 0.98);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 50; 
    border-radius: 20px; 
    transition: opacity 0.5s;
}

.widget-loader.hidden { 
    opacity: 0; 
    visibility: hidden; 
    pointer-events: none; 
}

.widget-container { 
    opacity: 0; 
    visibility: hidden; 
    height: 0; 
    overflow: hidden; 
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
}

.widget-container.active { 
    opacity: 1; 
    visibility: visible; 
    height: auto; 
    position: relative; 
    min-height: 800px; 
    animation: fadeIn 0.5s ease-out; 
}

.widget-frame { 
    width: 100%; 
    height: 850px; 
    border: none; 
    display: block; 
    background: white; 
    border-radius: 20px; 
}

/* Анимации */
@keyframes fadeIn { 
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    } 
    to { 
        opacity: 1; 
        transform: translateY(0); 
    } 
}

@keyframes tada {
    0% { transform: scale(1); }
    10%, 20% { transform: scale(0.9) rotate(-3deg); }
    30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
    40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Ползунок */
.range-slider {
    -webkit-appearance: none; 
    appearance: none;
    background: linear-gradient(to right, #e2e8f0 0%, var(--primary-blue) 3%, #e2e8f0 100%);
    height: 14px; 
    border-radius: 10px; 
    width: 100%; 
    outline: none; 
    background-size: 3% 100%; 
    background-repeat: no-repeat;
    cursor: pointer;
}

.range-slider::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    height: 40px; 
    width: 40px; 
    background: white; 
    border: 4px solid var(--primary-blue); 
    border-radius: 50%; 
    cursor: pointer; 
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

.range-slider::-moz-range-thumb {
    height: 40px; 
    width: 40px; 
    background: white; 
    border: 4px solid var(--primary-blue); 
    border-radius: 50%; 
    cursor: pointer; 
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

/* Карточки */
.feature-card { 
    transition: all 0.3s ease; 
    background: white; 
    border: 1px solid #e2e8f0; 
    border-radius: 16px; 
    cursor: pointer;
}

.feature-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); 
    border-color: var(--primary-blue); 
}

/* Градиенты */
.text-gradient { 
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-green)); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    background-clip: text;
}

.bg-gradient { 
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-green)); 
}

/* Цвета для элементов */
header { 
    background-color: var(--header-bg); 
}

footer { 
    background-color: var(--footer-bg); 
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .hero-gradient::before { 
        display: none; 
    }
    
    .widget-frame { 
        height: 750px; 
    }
    
    .tab-btn {
        padding: 0.5rem 1rem; 
        font-size: 0.875rem; 
    }
    
    .fixed-cta {
        bottom: 1rem; 
        right: 1rem; 
        left: 1rem; 
        width: calc(100% - 2rem); 
        display: flex !important; 
    }
    
    .mobile-widget-padding {
        padding: 0.5rem !important;
    }
    
    .widget-container.active {
        min-height: 700px;
    }
}

/* Бэйджи */
.badge { 
    display: inline-flex; 
    align-items: center; 
    padding: 4px 12px; 
    border-radius: 20px; 
    font-weight: 700; 
    font-size: 0.75rem; 
    text-transform: uppercase; 
}

.badge-success { 
    background: rgba(16, 185, 129, 0.1); 
    color: var(--primary-green); 
    border: 1px solid rgba(16, 185, 129, 0.3); 
}

/* FAQ */
.faq-item { 
    border: 1px solid #e2e8f0; 
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.faq-item:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.faq-question { 
    cursor: pointer; 
    padding: 1.5rem; 
    font-weight: 700; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

.faq-answer { 
    max-height: 0; 
    overflow: hidden; 
    transition: all 0.4s ease; 
    padding: 0 1.5rem;
    opacity: 0;
}

.faq-item.active { 
    border-color: var(--primary-blue);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
}

.faq-item.active .faq-answer { 
    max-height: 500px; 
    padding: 0 1.5rem 1.5rem 1.5rem;
    opacity: 1;
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
    min-width: 20px;
    text-align: center;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

/* Кнопка фиксированная */
.fixed-cta { 
    position: fixed; 
    bottom: 2rem; 
    right: 2rem; 
    z-index: 999; 
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.4); 
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.125rem;
    padding: 1rem 2rem;
    border-radius: 1rem;
    color: white;
}

.fixed-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(37, 99, 235, 0.5);
}

.fixed-cta.animate-tada {
    animation: tada 1s ease-in-out;
}

/* Cookie баннер */
#cookie-banner { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    z-index: 1000; 
    transform: translateY(100%); 
    transition: transform 0.5s ease;
    padding: 1rem;
}

#cookie-banner.show { 
    transform: translateY(0); 
}

/* Exit модалка */
#exit-modal {
    position: fixed; 
    inset: 0; 
    z-index: 2000; 
    display: none;
    background: rgba(15, 23, 42, 0.75); 
    backdrop-filter: blur(8px);
    align-items: center; 
    justify-content: center; 
    padding: 1rem;
}

#exit-modal.active { 
    display: flex; 
}

.gift-scroll-container {
    max-height: 400px; 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
    border-radius: 1.5rem;
    background: white;
}

/* Дополнительные стили */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Кнопки */
button:not(.tab-btn):not(.fixed-cta) {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    transition: all 0.3s ease;
}

button:not(.tab-btn):not(.fixed-cta):hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Улучшенные стили для кнопок действия */
.bg-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-green));
    color: white;
    font-weight: bold;
}

.bg-gradient:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.3);
}

/* Стили для контейнера виджетов */
.mobile-widget-padding {
    padding: 1.5rem;
}

/* Стили для текста */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

/* Стили для ссылок */
a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

/* Стили для полей ввода */
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Стили для иконок */
svg {
    fill: currentColor;
}

/* Стили для скрытия элементов */
.hidden {
    display: none !important;
}

/* Стили для видимости */
.visible {
    visibility: visible;
}

.invisible {
    visibility: hidden;
}

/* Стили для позиционирования */
.absolute-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Стили для скролла */
.overflow-x-auto {
    overflow-x: auto;
}

.overflow-y-auto {
    overflow-y: auto;
}

/* Стили для теней */
.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Стили для закруглений */
.rounded-\[2rem\] {
    border-radius: 2rem;
}

.rounded-\[3rem\] {
    border-radius: 3rem;
}

/* Стили для z-index */
.z-\[90\] {
    z-index: 90;
}

.z-\[100\] {
    z-index: 100;
}

.z-\[999\] {
    z-index: 999;
}

.z-\[1000\] {
    z-index: 1000;
}

.z-\[2000\] {
    z-index: 2000;
}

.z-\[9999\] {
    z-index: 9999;
}

/* Стили для backdrop */
.backdrop-blur-md {
    backdrop-filter: blur(12px);
}

/* Стили для transition */
.transition-all {
    transition: all 0.3s ease;
}

/* Стили для transform */
.-translate-y-2 {
    transform: translateY(-2px);
}

/* Стили для hover эффектов */
.hover\:scale-105:hover {
    transform: scale(1.05);
}

.hover\:scale-\[1\.02\]:hover {
    transform: scale(1.02);
}

/* Стили для анимаций */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Стили для градиентного текста с поддержкой Firefox */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Стили для улучшения производительности */
.will-change-transform {
    will-change: transform;
}

/* Стили для улучшения доступности */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Стили для focus состояния */
:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Стили для selection */
::selection {
    background-color: rgba(37, 99, 235, 0.2);
    color: #1e293b;
}

/* Стили для placeholder */
::placeholder {
    color: #94a3b8;
    opacity: 1;
}

/* Стили для disabled элементов */
:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Стили для print */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Стили для high contrast mode */
@media (prefers-contrast: high) {
    .tab-btn.active {
        outline: 2px solid white;
    }
    
    .range-slider::-webkit-slider-thumb {
        border: 3px solid black;
    }
}

/* Стили для reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
/* Добавьте эти стили в конец файла */

/* Стили для счетчика займов */
.stat-item {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    text-align: center;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-item .text-5xl,
.stat-item .text-7xl {
    font-weight: 900;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.stat-item .text-xl {
    font-weight: 600;
    opacity: 0.9;
}

/* Анимации для счетчика */
@keyframes count-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.8);
    }
}

.animate-count-up {
    animation: count-up 0.5s ease-out forwards;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Стили для exit-intent модалки */
#exit-modal {
    transition: opacity 0.3s ease;
    display: none;
}

#exit-modal:not(.hidden) {
    display: flex !important;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gift-scroll-container {
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 1rem;
    background: white;
}

.gift-scroll-container iframe {
    min-height: 500px;
    border: none;
}

/* Таймер обратного отсчета */
#exit-timer {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

/* Уведомления */
.custom-notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOutUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* Адаптивность для счетчика */
@media (max-width: 768px) {
    .stat-item {
        padding: 1.5rem;
    }
    
    .stat-item .text-5xl {
        font-size: 2.5rem;
    }
    
    .stat-item .text-7xl {
        font-size: 3.5rem;
    }
    
    .gift-scroll-container {
        max-height: 50vh;
    }
    
    .gift-scroll-container iframe {
        min-height: 400px;
    }
}

/* Стили для админ-панели */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

.main-content {
    margin-left: 260px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    margin: 0.25rem 1rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-link.active {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border-left: 4px solid #3b82f6;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
}