/* Custom overrides — add your styles here */
html {
    overflow-y: scroll;
}

.navbar-default .navbar-nav > .active > a, 
.navbar-default .navbar-nav > .active > a:hover, 
.navbar-default .navbar-nav > .active > a:focus {
    background-color: transparent !important;
    color: #5F6CFB !important;
}

/* Fix navbar "dancing" alignment */
@media (min-width: 768px) {
    .navbar-default .container {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
    }
    .navbar-header {
        display: flex !important;
        align-items: center;
        float: none !important;
    }
    .navbar-brand {
        padding: 0 !important;
        height: auto !important;
        display: flex;
        align-items: center;
    }
    .navbar-phone {
        padding-top: 0 !important;
        margin-top: 0 !important;
        margin-left: 30px !important;
    }
    .navbar-collapse {
        display: flex !important;
        align-items: center;
        padding: 0 !important;
        float: none !important;
    }
    .navbar-nav {
        display: flex !important;
        align-items: center;
        margin: 0 !important;
        float: none !important;
    }
    .navbar-nav > li {
        float: none !important;
    }
    .navbar-nav > li > a {
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }
    /* Fix inline padding on the Audit button */
    .navbar-nav > li[style*="padding-top"] {
        padding-top: 0 !important;
        padding-left: 15px !important;
    }
}

/* ================================================
   GLOBAL: Полный запрет italics на всём сайте
   ================================================ */
p, li, span, div, h1, h2, h3, h4, h5, h6,
em, i:not(.fa), blockquote, .lead,
.hero-sub, .excerpt, .text-muted,
.article-card p, .service-card p,
.case-card p, .value-card p, .step-content p,
.sidebar-toc a, .blog-cta p, .about-cta p {
    font-style: normal !important;
}

/* ================================================
   NAVBAR: плавный transition padding при скролле
   ================================================ */
.navbar-default {
    transition: padding-top 0.3s ease, padding-bottom 0.3s ease, background-color 0.3s ease;
}
/* Состояние при скролле вниз */
.navbar-default.navbar-shrink {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}
/* Состояние наверху — возврат к исходному */
.navbar-default:not(.navbar-shrink) {
    padding-top: 15px;
    padding-bottom: 15px;
}

/* ================================================
   MOBILE: Базовые overflow-фиксы
   ================================================ */
body { overflow-x: hidden; }

/* Все картинки и медиа не вылезают за экран */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* Таблицы в статьях — горизонтальный скролл внутри блока */
.article-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-collapse: collapse;
}
.article-body table th,
.article-body table td {
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
    font-size: 14px;
}
.article-body table tr:nth-child(even) { background: #f7f7f9; }

/* Заголовки не вылезают */
h1, h2, h3, h4, h5, h6 {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Кнопки на мобилке не вылезают */
.btn {
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    /* Hero H1 уменьшаем */
    .u-page-hero h1 { font-size: 22px !important; }

    /* Статья: убираем большой боковой padding */
    .article-body-wrap { padding: 22px 16px !important; }

    /* Кейс: Sidebar отступы */
    .case-sidebar { padding: 20px 16px; }

    /* Кнопки CTA */
    .btn-xl {
        padding: 12px 20px !important;
        font-size: 13px !important;
        width: 100%;
        display: block;
    }
    /* Кнопки рядом — не в ряд а стопкой */
    .btn + .btn { margin-top: 10px; margin-left: 0 !important; }

    /* Floating кнопки — уменьшаем и сдвигаем */
    .float-cta-wrap { bottom: 70px !important; right: 12px !important; }
    .float-cta-btn { width: 44px !important; height: 44px !important; font-size: 16px !important; }

    /* Хлебные крошки — перенос */
    .u-breadcrumb { flex-wrap: wrap !important; }
}

/* ================================================
   ЭФФЕКТ 1: Scroll-reveal — элементы плавно
   появляются при попадании в viewport
   ================================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.65s cubic-bezier(0.4,0,0.2,1),
                transform 0.65s cubic-bezier(0.4,0,0.2,1);
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
/* Задержки для дочерних элементов */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ================================================
   ЭФФЕКТ 2: Button shimmer — переливание на CTA
   ================================================ */
.btn-xl, .btn-primary, button.btn[data-toggle="modal"] {
    position: relative;
    overflow: hidden;
}
.btn-xl::after,
button.btn[data-toggle="modal"]::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.25) 50%,
        transparent 100%);
    transform: skewX(-20deg);
    transition: none;
    pointer-events: none;
}
.btn-xl:hover::after,
button.btn[data-toggle="modal"]:hover::after {
    left: 160%;
    transition: left 0.55s ease;
}

/* ================================================
   ЭФФЕКТ 3: Animated gradient border на тарифе
   ================================================ */
@keyframes rotate-gradient {
    0%   { --angle: 0deg; }
    100% { --angle: 360deg; }
}
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
.pricing-popular-card {
    position: relative;
    border-radius: 16px;
    background: #fff;
}
.pricing-popular-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: conic-gradient(
        from var(--angle),
        #5F6CFB, #fed136, #5F6CFB, #3a45d4, #5F6CFB
    );
    z-index: -1;
    animation: rotate-gradient 4s linear infinite;
}

/* ================================================
   БЕЛЫЕ БЛОКИ: Dot-grid паттерн (.dot-bg)
   CSS-only, без анимации — лёгкая текстура
   ================================================ */
.dot-bg {
    background-image:
        radial-gradient(circle, rgba(95,108,251,0.10) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* Белые секции с dot-bg чуть темнее точки */
section.dot-bg, div.dot-bg {
    position: relative;
}

/* ── Декоративный угловой акцент на белых карточках ── */
.service-card,
.article-card,
.case-card {
    position: relative;
}
.service-card::after,
.article-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 0; height: 0;
    border-style: solid;
    border-width: 0 36px 36px 0;
    border-color: transparent rgba(95,108,251,0.12) transparent transparent;
    border-radius: 0 12px 0 0;
    pointer-events: none;
    transition: border-color 0.3s ease;
}
.service-card:hover::after,
.article-card:hover::after {
    border-color: transparent rgba(95,108,251,0.28) transparent transparent;
}

/* ── Фоновые большие числа в секциях процесса ── */
.step-number-bg {
    position: absolute;
    top: -20px; left: -10px;
    font-size: 120px;
    font-weight: 900;
    font-family: 'Montserrat', sans-serif;
    color: rgba(95,108,251,0.06);
    line-height: 1;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* ── CTA neural: убеждаемся что overflow скрыт ── */
.cta-neural {
    overflow: hidden;
}

/* ── Белые карточки: subtle top-border gradient ── */
.service-card,
.article-card {
    border-top: 3px solid transparent;
    background-clip: padding-box;
    position: relative;
}
/* pseudo-element для градиентного top-border */
.service-card::before {
    content: '';
    position: absolute;
    top: -3px; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #5F6CFB 0%, #fed136 100%);
    border-radius: 12px 12px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.service-card:hover::before {
    opacity: 1;
}
