﻿/* ========================================
   BASE STYLES
   Базовые стили: reset, типографика, layout, кнопки, скроллбар
   Подключается на всех страницах
======================================== */

/* ----------------------------------------
   RESET
---------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: 108px;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-main);
    /* Тонкая инженерная сетка на светлом фоне */
    background-image:
        linear-gradient(rgba(27, 58, 107, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(27, 58, 107, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    overflow-x: hidden;
    position: relative;
    overflow-y: auto;
}

/* ----------------------------------------
   DARK SECTION — переиспользуемый тёмный фон
   Применяется к: .advantages, .for-who, .contact-form, .partnership
---------------------------------------- */
.section-dark-bg {
    background:
        /* Золотой блик сверху-справа */
        radial-gradient(ellipse 60% 40% at 85% -10%, rgba(201,168,76,0.12) 0%, transparent 60%),
        /* Синий блик снизу-слева */
        radial-gradient(ellipse 50% 50% at -5% 110%, rgba(42,82,152,0.25) 0%, transparent 55%),
        /* Основной градиент */
        linear-gradient(160deg, #0F1E3D 0%, #0A1628 55%, #111E3F 100%);
    position: relative;
    overflow: hidden;
}

/* Точечный паттерн */
.section-dark-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
    z-index: 0;
}

/* Золотая диагональная линия-акцент */
.section-dark-bg::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(201,168,76,0.4) 30%,
        rgba(201,168,76,0.6) 50%,
        rgba(201,168,76,0.4) 70%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 0;
}

.section-dark-bg > .container,
.section-dark-bg > * { position: relative; z-index: 1; }


::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(42, 82, 152, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 10px;
    border: 2px solid rgba(250, 247, 245, 0.5);
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(42, 82, 152, 0.1);
}

/* ----------------------------------------
   TYPOGRAPHY
---------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1, h2 {
    text-transform: uppercase;
    letter-spacing: 1px;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1.1rem, 2vw, 1.25rem); }
h6 { font-size: clamp(1rem, 1.5vw, 1.1rem); }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

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

a:hover {
    color: var(--primary-dark);
}

/* ----------------------------------------
   LAYOUT
---------------------------------------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

main {
    margin-top: 36px;
    min-height: calc(100vh - 36px);
}

.section {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

/* ----------------------------------------
   SECTION HEADER — новый дизайн
---------------------------------------- */
.section-header-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(27, 58, 107, 0.3);
    transition: all var(--transition-normal);
}

.section-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 58, 107, 0.4);
}

.section-badge svg {
    width: 16px;
    height: 16px;
    animation: sparkle 2s ease-in-out infinite;
}

.section-title-new {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradientShift 4s ease-in-out infinite;
}

.section-subtitle-new {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    padding: 0 2rem;
}

.section-subtitle-new::before,
.section-subtitle-new::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    transform: translateY(-50%);
}

.section-subtitle-new::before { left: 0; }
.section-subtitle-new::after  { right: 0; }

.section-title {
    color: var(--text-primary);
    margin-bottom: 1rem;
    position: relative;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    padding-top: 1.5rem;
}

.section-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 2px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 40px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-header.aos-animate .section-title::after {
    transform: translateX(-50%) scaleX(1);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    font-style: italic;
    position: relative;
}

.section-subtitle::before,
.section-subtitle::after {
    content: '"';
    font-size: 1.5rem;
    color: var(--primary-color);
    font-family: var(--font-heading);
    opacity: 0.6;
}

.section-subtitle::before { margin-right: 0.5rem; }
.section-subtitle::after  { margin-left: 0.5rem; }

/* ----------------------------------------
   BUTTONS — единый источник стилей кнопок
   Не переопределять в других файлах!
---------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 11px 24px;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    transition: background 0.28s ease, color 0.28s ease,
                border-color 0.28s ease, box-shadow 0.28s ease,
                transform 0.2s ease;
    /* Запрет растягивания */
    width: fit-content;
    flex-shrink: 0;
}

/* Shimmer при наведении */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.45s ease;
}
.btn:hover::after { transform: translateX(100%); }

/* ── btn-primary: золотой с переливом при hover ── */
.btn-primary {
    background: linear-gradient(
        135deg,
        var(--accent-dark)   0%,
        var(--accent-color)  35%,
        var(--accent-light)  60%,
        var(--accent-color)  100%
    );
    background-size: 250% 250%;
    background-position: 0% 50%;
    color: var(--primary-dark);
    border-color: transparent;
    box-shadow: var(--btn-primary-shadow);
    transition: background-position 0.6s ease, box-shadow 0.28s ease,
                transform 0.2s ease, filter 0.28s ease;
}
.btn-primary:hover,
.btn-primary:focus-visible {
    background-position: 100% 50%;
    color: var(--primary-dark);
    box-shadow: var(--btn-primary-hover-shadow);
    transform: translateY(-2px);
    filter: brightness(1.08);
}
.btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

/* ── btn-outline: прозрачный с синей рамкой → заливка ── */
.btn-outline {
    background: transparent;
    color: var(--btn-outline-color);
    border-color: var(--btn-outline-border);
}
.btn-outline:hover,
.btn-outline:focus-visible {
    background: var(--btn-outline-hover-bg);
    color: var(--btn-outline-hover-text);
    border-color: var(--btn-outline-hover-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* ── btn-secondary: белый фон с синей рамкой (alias outline) ── */
.btn-secondary {
    background: var(--background-white);
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: var(--primary-color);
    color: var(--text-on-dark);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* ── btn-ghost: для тёмных фонов (белая рамка) ── */
.btn-ghost {
    background: transparent;
    color: var(--btn-ghost-color);
    border-color: var(--btn-ghost-border);
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
    background: var(--btn-ghost-hover-bg);
    color: var(--text-on-dark);
    border-color: rgba(255,255,255,0.7);
    transform: translateY(-2px);
}

/* ── btn-gold: золотая CTA ── */
.btn-gold {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    color: var(--text-on-accent);
    border-color: transparent;
    font-weight: 700;
    box-shadow: var(--shadow-gold);
}
.btn-gold:hover,
.btn-gold:focus-visible {
    background: linear-gradient(135deg, var(--accent-light), var(--accent-color));
    color: var(--text-on-accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(201, 168, 76, 0.55);
}

/* ── Размеры ── */
.btn-sm    { padding: 7px 16px; font-size: 0.85rem; }
.btn-large { padding: 14px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; flex-shrink: unset; }

/* ── Состояния ── */
.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-pulse { animation: pulse 2s infinite; }

.btn svg { flex-shrink: 0; transition: transform var(--transition-fast); }
.btn:hover svg { transform: translateY(-1px); }

/* ----------------------------------------
   FIXED ELEMENTS (кнопка наверх)
---------------------------------------- */
.fixed-cta {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 500;
}

.fixed-cta .btn {
    box-shadow: 0 8px 25px rgba(27, 58, 107, 0.4);
}

.scroll-to-top {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(27, 58, 107, 0.3);
    transition: all var(--transition-normal);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 499;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 58, 107, 0.4);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    color: white;
}

/* ----------------------------------------
   KEYFRAMES
---------------------------------------- */
@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    50%       { transform: scale(1.1) rotate(180deg); opacity: 1; }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}

@keyframes pulse {
    0%   { box-shadow: 0 4px 15px rgba(27, 58, 107, 0.3); }
    50%  { box-shadow: 0 4px 25px rgba(27, 58, 107, 0.5); }
    100% { box-shadow: 0 4px 15px rgba(27, 58, 107, 0.3); }
}

