/* --- Общие настройки и переменные --- */
:root {
    --primary-color: #ffffff;
    --background-color: #000000;
    --accent-color: #0d8cff;
    --glass-bg: rgba(25, 25, 28, 0.8); 
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --glass-blur: 15px;
    --glass-border-radius: 12px;
    --crm-color: #8a5cda;
    --excel-color: #4CAF50;
    --mes-color: #FFC107;

    /* --- ИЗМЕНЕНИЕ: Новые переменные для стеклянной подложки --- */
    --hero-glass-bg: radial-gradient(circle, rgba(25, 25, 28, 0.6) 0%, rgba(25, 25, 28, 0.2) 100%);
    --hero-glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-image: url('../assets/images/photo-1614852207179-f21528f68aa0.jpg');
    background-color: var(--background-color);
    background-size: cover;
    background-position: center;
    background-attachment: scroll; 
    color: var(--primary-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    margin-top: 0;
    font-weight: 600;
    color: var(--primary-color);
}

p {
    color: #eee;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

section {
    padding: 60px 0;
}

html {
    scroll-behavior: smooth;
}

/* --- Шапка (Header) --- */
.header {
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 12, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    z-index: 1001;
    background: linear-gradient(90deg, #4f80c2, #8a5cda, #d65b8d, #f9a87d, #f9a87d);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: gradient-animation 8s ease-in-out infinite;
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

main {
    margin-top: 0;
    position: relative;
    z-index: 1;
}

/* --- Мобильное меню --- */
.navigation {
    position: fixed;
    top: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    background: #0c0c0c;
    display: flex;
    flex-direction: column;
    padding: 100px 20px 40px;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    visibility: hidden;
}

.navigation.nav-active {
    transform: translateX(0);
    visibility: visible;
}

.navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.navigation li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    font-size: 20px;
    font-weight: 500;
    border-bottom: 1px solid #333;
    transition: color 0.3s ease;
    color: var(--primary-color);
}

.navigation li:first-child a {
    border-top: 1px solid #333;
}

.navigation li a:hover {
    color: var(--accent-color);
}

.navigation li a::after {
    content: '>';
    font-size: 20px;
    color: #555;
}


.cta-button {
    display: none;
}

.mobile-nav-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 10px;
    position: relative;
    width: 45px;
    height: 45px;
}

.mobile-nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: white;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
}

.nav-active .mobile-nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-active .mobile-nav-toggle span:nth-child(2) { opacity: 0; }
.nav-active .mobile-nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Остальные секции --- */
.hero {
    display: flex;
    align-items: flex-end;
    height: 100vh;
    padding-bottom: 80px;
    position: relative; 
    overflow: hidden; 
}

#hero-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; 
    opacity: 0.4;
}

.hero .container {
    text-align: left;
    margin: 0;
    position: relative; 
    z-index: 2; 
}

.hero-content-box {
    background: var(--hero-glass-bg);
    border: var(--hero-glass-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--glass-border-radius);
    padding: 40px;
    max-width: 700px;
}

.hero h1 {
    font-size: 36px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    max-width: 800px;
}

.hero p {
    font-size: 18px;
    color: #eee;
    margin-bottom: 40px;
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
    max-width: 600px;
}

.cta-button-main { 
    background-color: var(--accent-color); 
    color: var(--primary-color); 
    padding: 15px 30px; 
    border-radius: var(--glass-border-radius); 
    font-size: 18px; 
    font-weight: bold; 
    border: none; 
    cursor: pointer; 
    transition: background-color 0.3s ease; 
    display: inline-block;
}
h2 { text-align: center; font-size: 32px; margin-bottom: 40px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.section-subtitle { text-align: center; max-width: 600px; margin: -20px auto 40px; color: #ccc; font-size: 16px; }

/* --- Стили для BI-блока --- */
.bi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}

.bi-text-content {
    text-align: center;
}
.bi-text-content h3 {
    font-size: 28px;
    margin-bottom: 15px;
}
.bi-text-content p {
    max-width: 500px;
    margin: 0 auto 30px;
    color: #ccc;
}

.bi-device-flipper { 
    position: relative; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 450px;
    padding: 0 10px; /* ИСПРАВЛЕНИЕ: Немного уменьшен отступ для мобильной версии */
}
.flipper-viewport { 
    position: relative; 
    width: 100%; 
    max-width: 480px; 
    height: 450px; 
    overflow: hidden; 
}

.device-mockup { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.6s; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    transform: translate(-50%, -50%) translateX(200%);
    opacity: 0;
}
.device-mockup.active { 
    transform: translate(-50%, -50%) translateX(0); 
    z-index: 2; 
    opacity: 1;
}

.device-screen { padding: 10px; background: #1a1d21; overflow: hidden; }
.device-mockup.laptop .device-screen { width: 100%; height: 100%; border-radius: 15px 15px 0 0; }
.device-mockup.smartphone .device-screen { width: 100%; height: 100%; border-radius: 25px; }
.device-mockup.tablet .device-screen { width: 100%; height: 100%; border-radius: 10px; }

.device-mockup.smartphone { width: 200px; height: 400px; background: #111; border: 8px solid #333; border-radius: 40px; padding: 15px; }
.device-mockup.tablet { width: 300px; height: 400px; background: #111; border: 10px solid #333; border-radius: 20px; padding: 10px; }
.device-mockup.laptop { width: 440px; height: 275px; flex-direction: column; }
.device-mockup.laptop .device-screen { background: #111; border: 10px solid #333; border-bottom: none; }
.laptop-bottom { width: 480px; height: 12px; background: #444; border-radius: 0 0 10px 10px; }

.flipper-arrow { 
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    color: white; 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    font-size: 20px; 
    cursor: pointer; 
    z-index: 10; 
    transition: background 0.3s ease; 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    display: flex;
    align-items: center;
    justify-content: center;
}
.flipper-arrow:hover { background: rgba(255, 255, 255, 0.2); }
.arrow-left { left: 0; } 
.arrow-right { right: 0; }

/* --- Стили для дашбордов на экранах --- */
.dashboard-grid { display: grid; gap: 8px; width: 100%; height: 100%; }
.laptop-grid { grid-template-columns: repeat(2, 1fr); } .mobile-grid { grid-template-columns: repeat(2, 1fr); } .tablet-grid { grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; }
.tablet-grid .bar-chart { grid-column: 1 / 4; }

.chart-widget { background: rgba(40, 44, 52, 0.7); border-radius: 8px; padding: 10px; opacity: 0; }
.bar-chart { display: flex; justify-content: space-around; align-items: flex-end; }
.bar { width: 15%; background: var(--accent-color); border-radius: 3px 3px 0 0; transform: scaleY(0); transform-origin: bottom; }
.line-chart .line-svg { width: 100%; height: 100%; } .line-chart .line { stroke: #8a5cda; stroke-dasharray: 250; stroke-dashoffset: 250; }
.pie-chart { border-radius: 50%; background: conic-gradient( #8a5cda 0deg 0deg, #4CAF50 0deg 0deg, #FFC107 0deg 360deg ); }
.kpi { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.kpi span { font-size: 24px; font-weight: bold; color: var(--primary-color); } .kpi p { font-size: 12px; color: #ccc; margin: 0; }

/* --- Анимации дашбордов --- */
@keyframes fade-in { to { opacity: 1; } }
@keyframes grow-bar { to { transform: scaleY(1); } }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes fill-pie { 100% { background: conic-gradient( #8a5cda 0deg 120deg, #4CAF50 120deg 220deg, #FFC107 220deg 360deg ); } }

/* --- Запуск анимаций, когда устройство активно --- */
.device-mockup.active .chart-widget { animation: fade-in 0.5s ease forwards; }
.device-mockup.active .bar { animation: grow-bar 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
.device-mockup.active .line { animation: draw-line 1.2s ease-out forwards; }
.device-mockup.active .pie-chart { animation: fill-pie 1s ease-in-out forwards; }
.device-mockup.active .chart-widget:nth-child(2) { animation-delay: 0.2s; } .device-mockup.active .chart-widget:nth-child(3) { animation-delay: 0.4s; } .device-mockup.active .chart-widget:nth-child(4) { animation-delay: 0.6s; }
.device-mockup.active .bar:nth-child(2) { animation-delay: 0.1s; } .device-mockup.active .bar:nth-child(3) { animation-delay: 0.2s; } .device-mockup.active .bar:nth-child(4) { animation-delay: 0.3s; } .device-mockup.active .bar:nth-child(5) { animation-delay: 0.4s; }
.device-mockup.active .line { animation-delay: 0.3s; } .device-mockup.active .pie-chart { animation-delay: 0.5s; }

.devices-animation { position: relative; max-width: 500px; height: 300px; margin: 0 auto; }
.device { position: absolute; border: 2px solid rgba(255, 255, 255, 0.7); background: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; color: #999; animation: float 4s ease-in-out infinite; }
.desktop { width: 80%; height: 100%; top: 0; left: 0; border-radius: 15px; z-index: 1; font-size: 18px; }
.mobile { width: 30%; height: 70%; top: 15%; right: 0; border-radius: 20px; z-index: 2; animation-delay: -2s; font-size: 16px; }
.bot { width: 50%; height: 20%; bottom: 0; left: 5%; border-radius: 10px; font-size: 18px; color: var(--accent-color); animation-delay: -1s; z-index: 2; }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-15px); } 100% { transform: translateY(0px); } }

.contact-form-section .container { max-width: 800px; background: var(--glass-bg); border: var(--glass-border); backdrop-filter: blur(var(--glass-blur)); padding: 30px; border-radius: var(--glass-border-radius); }
.contact-form { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.contact-form input, .contact-form textarea { background-color: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.3); color: var(--primary-color); padding: 15px; border-radius: var(--glass-border-radius); font-size: 16px; }
.footer { padding: 30px 0; margin-top: 20px; background: var(--glass-bg); border-top: var(--glass-border); backdrop-filter: blur(var(--glass-blur)); }
.footer .container { display: flex; flex-direction: column; align-items: center; gap: 15px; }


/* ===== КОД ДЛЯ СЛАЙДЕРА ===== */
.slider-wrapper {
    position: relative;
}

.slider-viewport {
    overflow: hidden;
}

.slider-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

a.service-card {
    color: inherit;
    text-decoration: none;
}

.service-card {
    flex: 0 0 100%;
    min-width: 0;
    background: var(--glass-bg);
    border: var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--glass-border-radius);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    flex-shrink: 0;
}

.service-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
}

.service-card p {
    font-size: 15px;
    color: #ccc;
    line-height: 1.5;
    flex-grow: 1;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 22px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
    display: none; 
    align-items: center;
    justify-content: center;
}

.slider-arrow:hover {
    background: rgba(255, 255, 255, 0.25);
}

.slider-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.slider-prev {
    left: 0;
}

.slider-next {
    right: 0;
}

/* --- Адаптивность --- */
@media (min-width: 768px) {
    section { padding: 80px 0; }
    h1 { font-size: 48px; }
    h2 { font-size: 38px; margin-bottom: 60px; }

    .header .container,
    .hero .container {
        padding-left: 80px;
        padding-right: 80px;
    }
    
    .bi-grid { 
        grid-template-columns: 1fr 1.2fr; 
        text-align: left;
    }

    .bi-text-content {
        text-align: left;
    }
    .bi-text-content p {
        margin: 0 0 30px 0;
    }
    
    .bi-device-flipper {
        padding: 0;
    }
    /* ИСПРАВЛЕНИЕ: Финальная корректировка отступов для стрелок */
    .bi-device-flipper .arrow-left {
        left: -45px; 
    }
    .bi-device-flipper .arrow-right {
        right: -45px;
    }


    .mobile-nav-toggle { display: none; }
    .header .navigation { position: static; height: auto; width: auto; background: none; backdrop-filter: none; opacity: 1; visibility: visible; display: block; transform: none; padding: 0; }
    
    .header .navigation ul {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 30px;
        width: auto;
        padding: 0;
        margin: 0;
        list-style: none;
    }
    
    .header .navigation li a {
        background: none;
        border: none;
        padding: 0;
        font-size: 16px;
        font-weight: 400;
        background: linear-gradient(90deg, #4f80c2, #8a5cda, #d65b8d, #f9a87d);
        background-size: 200% auto;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: white;
        transition: color 0.4s ease;
    }
    
    .header .navigation li:first-child a { border-top: none; }
    .header .navigation li a::after { content: ''; }
    
    .header .navigation li a:hover {
        -webkit-text-fill-color: transparent;
        color: transparent;
    }
    
    .header .cta-button { display: block; border: 1px solid var(--primary-color); padding: 10px 20px; border-radius: var(--glass-border-radius); transition: all 0.3s ease; }
    .header .cta-button:hover { background-color: var(--primary-color); color: var(--background-color); }
    
    .slider-viewport {
        margin: 0 50px;
    }
    .service-card {
        flex-basis: calc((100% - 40px) / 3);
    }
    .slider-arrow {
        display: flex;
    }

    .devices-animation { height: 350px; }
    .footer .container { flex-direction: row; justify-content: space-between; }
}

@media (min-width: 1024px) {
    h1 { font-size: 56px; }
    .bi-grid { max-width: 1000px; margin: 0 auto; }
}