/* Основные шрифты и переменные */
:root {
    --primary-color: #dc2626;
    --primary-dark: #b91c1c;
    --secondary-color: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --gradient-secondary: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
}

/* Скролл прогресс бар */
#progress-bar {
    transition: width 0.3s ease-out;
}

/* Экран загрузки */
#loading-screen {
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-logo {
    animation: pulse 2s ease-in-out infinite;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Кнопка "Вернуться наверх" */
#back-to-top {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#back-to-top.show {
    transform: translateY(0);
    opacity: 1;
}

/* Навигация */
#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero секция */
.hero-section {
    min-height: 100vh;
    background-color: rgb(17, 24, 39);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 200px;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.9;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(2, 17, 41, 0.85) 0%, rgba(10, 41, 84, 0.85) 100%);
    z-index: 1;
}

.hero-pattern {
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    z-index: 2;
}

.hero-content {
    animation: heroFadeIn 1.2s ease-out;
}

.hero-title {
    animation: heroSlideDown 1s ease-out 0.2s both;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    animation: heroSlideDown 1s ease-out 0.4s both;
}

.hero-description {
    animation: heroSlideDown 1s ease-out 0.6s both;
}

.hero-buttons {
    animation: heroSlideUp 1s ease-out 0.8s both;
}

@keyframes heroFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes heroSlideDown {
    from { 
        opacity: 0;
        transform: translateY(-30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroSlideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Плавающие иконки */
.floating-icon {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Индикатор прокрутки */
.scroll-indicator {
    animation: fadeInUp 1s ease-out 1s both;
}

.scroll-arrow {
    width: 2px;
    height: 30px;
    background: white;
    position: relative;
    animation: scrollBounce 2s infinite;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 0;
    border: 4px solid transparent;
    border-top-color: white;
    transform: translateX(-50%);
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Секции */
.section-header {
    animation: fadeInUp 0.8s ease-out;
}

.section-title {
    position: relative;
    display: inline-block;
}

.section-divider {
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.section-header:hover .section-divider {
    width: 6rem !important;
}

/* Анимации при прокрутке */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Карточки */
.feature-card,
.service-card,
.advantage-card,
.case-card,
.model-card,
.expertise-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
}

.feature-card:hover,
.service-card:hover,
.advantage-card:hover,
.case-card:hover,
.model-card:hover,
.expertise-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.feature-icon,
.service-icon,
.advantage-icon,
.component-icon,
.model-icon {
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon,
.service-card:hover .service-icon,
.advantage-card:hover .advantage-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Кнопки */
.cta-button,
.outline-button,
.submit-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-button::before,
.outline-button::before,
.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.cta-button:hover::before,
.outline-button:hover::before,
.submit-btn:hover::before {
    left: 100%;
}

/* УТП секция */
.utp-main {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-lg);
    transform: perspective(1000px) rotateX(2deg);
    transition: transform 0.3s ease;
}

.utp-main:hover {
    transform: perspective(1000px) rotateX(0deg) scale(1.02);
}

.utp-components .component-icon {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-md);
}

/* Капча */
.captcha {
    display: inline-block;
    border: 2px solid #D1D5DB;
    border-radius: 0.5rem;
    padding: 0.25rem;
    background-color: #f9fafb;
    height: 48px;
    vertical-align: middle;
    margin-right: 0.5rem;
}

input[name="captcha_1"] {
    border: 2px solid #D1D5DB;
    border-radius: 0.5rem;
    padding: 0.5rem;
    height: 48px;
    width: 10rem;
    vertical-align: middle;
}

input[name="captcha_1"]:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

/* Гарантии */
.guarantee-card {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
    transition: all 0.3s ease;
}

.guarantee-card:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(255, 255, 255, 1) 100%);
    box-shadow: var(--shadow-lg);
}

/* Сравнительная таблица */
.comparison-table {
    overflow: hidden;
    border-radius: 12px;
}

.table-row:hover {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.02) 0%, rgba(34, 197, 94, 0.02) 100%);
}

.problem-icon,
.solution-icon,
.benefit-icon {
    transition: all 0.3s ease;
}

.table-row:hover .problem-icon {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
}

.table-row:hover .solution-icon {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.table-row:hover .benefit-icon {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

/* Статистика */
.stat-circle {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(255, 255, 255, 1) 100%);
    transition: all 0.3s ease;
    position: relative;
}

.stat-circle::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: 50%;
    z-index: -1;
}

/* Форма контактов */
.contact-form {
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.95) 100%);
}

.form-input {
    transition: all 0.3s ease;
    border-radius: 8px;
}

.form-input:focus {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Теги безопасности */
.security-tag {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.95) 100%);
}

.security-tag:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
}

/* Сертификация */
.certification-card {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.certification-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

/* Бейджи результатов */
.result-badge {
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.2);
    transition: all 0.3s ease;
}

.result-badge:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    transform: scale(1.02);
}

/* Мобильное меню */
#mobile-menu {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.98) 100%);
    backdrop-filter: blur(10px);
}

body.mobile-menu-open {
    overflow: hidden;
}

/* Адаптивность */
@media (max-width: 768px) {
    .hero-section {
        background-attachment: scroll;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .floating-icon {
        display: none;
    }
    
    .utp-main {
        transform: none;
    }
    
    .comparison-table {
        font-size: 0.875rem;
    }
    
    .stat-circle {
        width: 100px;
        height: 100px;
    }
    
    .expertise-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stat-circle {
        width: 80px;
        height: 80px;
    }
    
    .stat-circle .text-3xl {
        font-size: 1.5rem;
    }
}

/* Дополнительные эффекты */
.hover-glow:hover {
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.3);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Кастомные скроллбары */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Плавные переходы для всех элементов */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

/* Специальные стили для статистики */
.stat-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.stat-circle::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}