/* ============================================================
   BIM-ПЛАТФОРМА — Дизайн-система
   Файл: css/styles.css
   Версия: 2.0
   Стиль: Современный, инженерный, премиальный B2B
   ============================================================ */

/* === CSS VARIABLES === */
:root {
    /* Основные цвета */
    --primary: #0f172a;
    --primary-light: #1e293b;
    --primary-dark: #020617;

    /* Акцентные цвета */
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-dark: #d97706;

    /* Вторичные */
    --secondary: #3b82f6;
    --secondary-light: #60a5fa;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Текст */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Фоны */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #0f172a;

    /* Границы */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;

    /* Тени */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Градиенты */
    --gradient-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e293b 100%);

    /* Радиусы */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Переходы */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Типографика */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--secondary-light);
}

/* === HEADER === */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header--scrolled {
    box-shadow: var(--shadow);
}

.header--hidden {
    transform: translateY(-100%);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    height: 72px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo::before {
    content: '';
    width: 32px;
    height: 32px;
    background: var(--gradient-accent);
    border-radius: var(--radius);
    display: inline-block;
}

.logo span {
    color: var(--text-muted);
    font-weight: 400;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

.nav a.active {
    color: var(--primary);
}

.nav-cta {
    background: var(--primary);
    color: var(--text-inverse) !important;
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
}

.nav-cta::after {
    display: none;
}

.nav-cta:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
    padding: 0.5rem;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: var(--transition);
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 72px;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: calc(100vh - 72px);
        background: var(--bg-primary);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: var(--shadow-xl);
        transition: var(--transition);
        z-index: 999;
    }

    .nav.active {
        right: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    body.menu-open {
        overflow: hidden;
    }
}

/* === HERO SECTION (УЛУЧШЕННАЯ ЧИТАЕМОСТЬ) === */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-inverse);
    padding: 8rem 0 6rem;
    position: relative;
    overflow: hidden;
}

/* Убираем лишний паттерн, оставляем только лёгкое свечение */
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero .subtitle {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 2rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.01em;
}

.hero-description {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto 3rem;
    opacity: 0.95;
    line-height: 1.8;
    color: #e2e8f0;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Улучшаем кнопки для лучшей видимости */
.hero .btn-primary {
    background: var(--accent);
    color: var(--primary);
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.hero .btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.5);
}

.hero .btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.hero .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.7);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .hero {
        padding: 5rem 0 4rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1.25rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero .btn {
        width: 100%;
    }
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--accent);
    color: var(--primary);
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--text-inverse);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-inverse);
}

/* === SECTIONS === */
.section {
    padding: 6rem 0;
}

.section-light {
    background: var(--bg-secondary);
}

.section-dark {
    background: var(--bg-dark);
    color: var(--text-inverse);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-dark .section-title {
    color: var(--text-inverse);
}

.section-subtitle {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 4rem;
    line-height: 1.7;
}

.section-dark .section-subtitle {
    color: var(--text-muted);
}

/* === CARDS === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    width: 80px;
    height: 80px;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.card-link:hover {
    gap: 0.75rem;
    color: var(--secondary-light);
}

/* === PROBLEM SECTION === */
.problem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.problem-card {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--danger);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.problem-card:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-lg);
}

.problem-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--danger);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.problem-label {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* === ARCHITECTURE === */
.architecture-diagram {
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin: 3rem 0;
    border: 1px solid var(--border);
}

.arch-flow {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 2rem 0;
}

.arch-item {
    text-align: center;
    flex: 1;
    min-width: 150px;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.arch-item:hover {
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

.arch-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.arch-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.arch-center {
    background: var(--gradient-primary) !important;
    color: var(--text-inverse);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.arch-center::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: var(--radius-full);
}

/* === STAGES === */
.stage-card {
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stage-card:hover {
    box-shadow: var(--shadow-lg);
}

.stage-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stage-number {
    background: var(--gradient-accent);
    color: var(--primary);
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stage-title {
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: 700;
}

.stage-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2.5rem 0;
}

.feature-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.feature-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature-content h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.feature-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.business-argument {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid var(--secondary);
    padding: 2rem;
    border-radius: var(--radius-md);
    margin-top: 2.5rem;
}

.business-argument h4 {
    color: var(--secondary);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.business-argument p {
    color: var(--text-primary);
    line-height: 1.7;
}

/* === TIMELINE === */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 4rem auto;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--border);
}

.timeline-item {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    position: relative;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -3.5rem;
    top: 2.5rem;
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    border: 4px solid var(--bg-primary);
    box-shadow: var(--shadow);
    z-index: 1;
}

.timeline-item--active {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.timeline-number {
    background: var(--gradient-accent);
    color: var(--primary);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.timeline-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.timeline-item ul {
    list-style: none;
    padding-left: 0;
}

.timeline-item li {
    padding: 0.75rem 0;
    padding-left: 2rem;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}

.timeline-item li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
    font-size: 1.25rem;
}

/* === TABS === */
.tabs {
    margin: 3rem 0;
}

.tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === ACCORDION === */
.accordion-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: var(--transition);
}

.accordion-item:hover {
    border-color: var(--border-dark);
}

.accordion-item.open {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.accordion-header {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition);
}

.accordion-header:hover {
    background: var(--bg-secondary);
}

.accordion-header::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--accent);
    transition: var(--transition);
}

.accordion-item.open .accordion-header::after {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.open .accordion-content {
    max-height: 1000px;
}

.accordion-body {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* === CONTACT FORM === */
.contact-form {
    max-width: 600px;
    margin: 3rem auto;
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: var(--transition);
    background: var(--bg-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group.has-error input,
.form-group.has-error textarea {
    border-color: var(--danger);
}

.form-error {
    display: block;
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-global-error {
    background: #fee2e2;
    color: var(--danger);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--danger);
}

.form-success {
    text-align: center;
    padding: 2rem;
}

.form-success__icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1.5rem;
}

.form-success h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.form-success p {
    color: var(--text-secondary);
}

/* === SCROLL TO TOP === */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--primary-light);
    transform: translateY(-4px);
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal__content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-secondary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal__close:hover {
    background: var(--bg-tertiary);
    transform: rotate(90deg);
}

/* === COOKIE BANNER === */
.cookie-banner {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 600px;
    width: calc(100% - 2rem);
    z-index: 1500;
    transition: var(--transition-slow);
    border: 1px solid var(--border);
}

.cookie-banner.visible {
    bottom: 2rem;
}

.cookie-banner p {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.cookie-banner a {
    color: var(--secondary);
    text-decoration: underline;
}

/* === FAMILY CARDS (Библиотека) === */
.family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.family-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.family-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

/* === FILTER BUTTONS === */
.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.filter-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

/* === SEARCH INPUT === */
.search-input {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 2rem;
    position: relative;
}

.search-input input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-input::before {
    content: '🔍';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
}

/* === FOOTER === */
.footer {
    background: var(--bg-dark);
    color: var(--text-inverse);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: var(--text-inverse);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-section a:hover {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* === PRELOADER === */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: var(--transition-slow);
}

.preloader--hidden {
    opacity: 0;
    visibility: hidden;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .section {
        padding: 4rem 0;
    }

    .hero {
        padding: 5rem 0 4rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .arch-flow {
        flex-direction: column;
    }

    .timeline {
        padding-left: 2rem;
    }

    .timeline::before {
        left: 0;
    }

    .timeline-item::before {
        left: -2.5rem;
    }

    .contact-form {
        padding: 2rem;
    }

    .cookie-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* === UTILITY CLASSES === */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.hidden { display: none; }
.visible { display: block; }

/* === ОБНОВЛЁННЫЙ БЛОК АРХИТЕКТУРЫ === */
.architecture-diagram {
    background: var(--bg-primary);
    padding: 4rem 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin: 3rem 0;
    border: 1px solid var(--border);
    position: relative;
}

.arch-flow {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 2rem 0;
}

.arch-item {
    text-align: center;
    flex: 1;
    min-width: 160px;
    max-width: 200px;
    padding: 2rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    position: relative;
}

.arch-item:hover {
    background: var(--bg-tertiary);
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.arch-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: var(--transition);
}

.arch-item:hover .arch-icon {
    color: var(--accent);
    transform: scale(1.1);
}

.arch-icon svg {
    width: 100%;
    height: 100%;
}

.arch-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.4;
}

.arch-center {
    background: var(--gradient-primary) !important;
    color: var(--text-inverse);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    min-width: 200px;
    max-width: 240px;
    transform: scale(1.05);
}

.arch-center:hover {
    transform: scale(1.1);
}

.arch-center .arch-icon {
    color: var(--accent);
    width: 100px;
    height: 100px;
}

.arch-center::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent);
    border-radius: var(--radius-full);
}

/* Стрелки между блоками */
.arch-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.arch-arrow {
    display: block;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .arch-flow {
        gap: 1.5rem;
    }

    .arch-item {
        min-width: 140px;
    }

    .arch-arrows {
        display: none;
    }
}

@media (max-width: 768px) {
    .architecture-diagram {
        padding: 2rem 1.5rem;
    }

    .arch-flow {
        flex-direction: column;
        gap: 1.5rem;
    }

    .arch-item {
        width: 100%;
        max-width: 100%;
    }

    .arch-center {
        transform: scale(1);
        order: -1;
    }

    .arch-icon {
        width: 64px;
        height: 64px;
    }

    .arch-center .arch-icon {
        width: 80px;
        height: 80px;
    }
}

/* === ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ ТАБОВ С SVG === */
/* Добавьте этот блок в конец css/styles.css */

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.tab-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: var(--transition);
}

.tab-btn:hover .tab-icon {
    transform: scale(1.1);
}

.tab-btn.active .tab-icon {
    color: var(--accent);
}

/* Адаптивность для табов с иконками */
@media (max-width: 768px) {
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .tab-icon {
        width: 20px;
        height: 20px;
    }
}

/* === ФОНОВЫЙ ЧЕРТЁЖ В HERO === */
.hero-bg-drawing {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.hero-bg-drawing svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: slowDrift 60s ease-in-out infinite;
}

/* Основная группа чертежа — одна точка контроля прозрачности */
.hero-drawing-group {
    opacity: 0.12;
    animation: subtlePulse 8s ease-in-out infinite;
}

@keyframes slowDrift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(-15px, -10px) scale(1.02);
    }
    50% {
        transform: translate(10px, -20px) scale(1.01);
    }
    75% {
        transform: translate(-10px, 10px) scale(1.02);
    }
}

@keyframes subtlePulse {
    0%, 100% {
        opacity: 0.10;
    }
    50% {
        opacity: 0.16;
    }
}

@media (max-width: 768px) {
    .hero-bg-drawing {
        opacity: 0.6;
    }
    .hero-bg-drawing svg {
        animation: none;
    }
    .hero-drawing-group {
        animation: none;
        opacity: 0.12;
    }
}

/* === СТРОГИЙ БЛОК ВЫДЕЛЕНИЯ (для итогов, ключевых выводов) === */
.highlight-block {
    background: var(--bg-secondary);
    border: 2px solid var(--border-dark);
    border-left: 6px solid var(--accent);
    padding: 2.5rem 3rem;
    border-radius: var(--radius-md);
    margin: 3rem auto;
    max-width: 900px;
    position: relative;
    box-shadow: var(--shadow-md);
}

.highlight-block::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 4px;
    background: var(--gradient-accent);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.highlight-block h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.highlight-block h4::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
}

.highlight-block p {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.125rem;
    font-weight: 500;
}

.highlight-block strong {
    color: var(--accent-dark);
    font-weight: 700;
}

/* Альтернативный вариант: тёмный строгий блок */
.highlight-block-dark {
    background: var(--gradient-primary);
    border: 2px solid var(--primary-light);
    border-left: 6px solid var(--accent);
    padding: 2.5rem 3rem;
    border-radius: var(--radius-md);
    margin: 3rem auto;
    max-width: 900px;
    color: var(--text-inverse);
    box-shadow: var(--shadow-lg);
}

.highlight-block-dark h4 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.highlight-block-dark p {
    color: var(--text-inverse);
    line-height: 1.8;
    font-size: 1.125rem;
    font-weight: 500;
    opacity: 0.95;
}

.highlight-block-dark strong {
    color: var(--accent-light);
    font-weight: 700;
}

/* Адаптивность */
@media (max-width: 768px) {
    .highlight-block,
    .highlight-block-dark {
        padding: 2rem 1.5rem;
        margin: 2rem 1rem;
    }
    
    .highlight-block h4,
    .highlight-block-dark h4 {
        font-size: 1.25rem;
    }
    
    .highlight-block p,
    .highlight-block-dark p {
        font-size: 1rem;
    }
}
/* === FOOTER === */
.footer {
    background: var(--bg-dark);
    color: var(--text-inverse);
    padding: 5rem 0 0;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-accent);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 3rem;
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-inverse);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--accent);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 0.95rem;
    display: inline-block;
}

.footer-section a:hover {
    color: var(--accent);
    transform: translateX(3px);
}

/* Логотип в футере */
.footer-logo .logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.footer-logo .logo::before {
    width: 28px;
    height: 28px;
}

/* Бейджи стандартов */
.footer-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.footer-badge {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Контакты с иконками */
.footer-contacts li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-contacts svg {
    color: var(--accent);
    flex-shrink: 0;
    opacity: 0.8;
}

.footer-contacts span {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Нижняя часть футера */
.footer-bottom {
    padding: 1.5rem 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-bottom-links {
    display: flex;
    gap: 2rem;
}

.footer-bottom-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.footer-bottom-links a:hover {
    color: var(--accent);
}

/* Адаптивность */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 3rem 0 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-bottom: 2rem;
    }
    
    .footer-section h3 {
        margin-bottom: 1rem;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* === ЛОГОТИП В ФУТЕРЕ === */
.footer-logo .logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-inverse);
    text-decoration: none;
    line-height: 1;
}

.footer-logo .logo::before {
    content: '';
    width: 32px;
    height: 32px;
    background: var(--gradient-accent);
    border-radius: var(--radius);
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}

.footer-logo .logo span {
    color: var(--text-muted);
    font-weight: 400;
    display: inline;
    vertical-align: middle;
}

/* Если нужно ещё точнее выровнять */
.footer-logo {
    display: flex;
    align-items: center;
}