:root {
    --primary-color: #295c7a;
    --secondary-color: #4c8daa;
    --accent-color: #78b9d7;
    --light-color: #e8f4fa;
    --dark-color: #1d3f54;
    --text-color: #333;
    --bg-light: #ffffff;
    --section-alt: #f5f9fc;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Raleway', sans-serif;
    color: var(--text-color);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--dark-color);
    border-color: var(--dark-color);
}

.bg-primary-custom {
    background-color: var(--primary-color);
}

.bg-light-custom {
    background-color: var(--bg-light);
}

.text-primary-custom {
    color: var(--primary-color);
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: white;
    padding: 100px 0;
}

.hero-section h1 {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 2.5rem;
    font-weight: 700;
}

.hero-section p.lead {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary-color);
    font-size: 2rem;
}

.feature-card {
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background-color: white;
    border: 1px solid rgba(0,0,0,0.08);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.feature-card-link,
.feature-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding-top: 8px;
    padding-bottom: 8px;
}

.navbar-brand img {
    height: 70px;
}

.navbar-nav {
    margin-left: 20px;
}

.navbar-nav .nav-item {
    margin: 0 10px;
}

.navbar-nav .nav-link {
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    white-space: nowrap;
    transition: color 0.3s ease, transform 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Переходный диапазон 992–1399px: лого + 7 пунктов в 1 строку */
@media (min-width: 992px) and (max-width: 1399px) {
    .navbar-brand img { height: 56px; }
    .navbar-nav { margin-left: 12px; }
    .navbar-nav .nav-item { margin: 0 2px; }
    .navbar-nav .nav-link { font-size: 1rem; padding: 0.5rem 0.6rem; }
}
@media (min-width: 1200px) and (max-width: 1399px) {
    .navbar-brand img { height: 60px; }
    .navbar-nav .nav-item { margin: 0 4px; }
    .navbar-nav .nav-link { font-size: 1.05rem; padding: 0.5rem 0.75rem; }
}

.navbar-toggler {
    border: none;
    padding: 10px;
    margin-right: 15px;
    outline: none !important;
    box-shadow: none !important;
}

.navbar-toggler:focus {
    box-shadow: none !important;
    outline: none !important;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(41, 92, 122, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.section-title {
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 50px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--accent-color);
}

.case-study-img {
    overflow: visible;
    box-shadow: none;
    background-color: transparent;
}

.case-study-img:hover {
    box-shadow: none;
    transform: none;
}

.case-study-img img {
    width: 100%;
    height: auto;
}

.about-img {
    border-radius: 10px;
    overflow: hidden;
}

.contact-form {
    border-radius: 10px;
    padding: 25px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border: 1px solid var(--accent-color);
}

.contact-form .form-control {
    border-radius: 5px;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.contact-form .form-control:focus {
    box-shadow: 0 0 0 3px rgba(120, 185, 215, 0.25);
    border-color: var(--accent-color);
}

footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 50px 0 20px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.1);
    color: white;
    margin-right: 10px;
    transition: all 0.3s;
}

.social-icon:hover {
    background-color: var(--accent-color);
    color: var(--dark-color);
}

.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s;
    z-index: 999;
}

.scroll-top.show {
    opacity: 1;
    cursor: pointer;
}

.hero-section .img-fluid {
    max-width: 100%;
    height: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    section {
        padding: 40px 0;
    }

    .section-title {
        margin-bottom: 30px;
    }
    
    .cta-section .btn-container {
        display: grid;
        gap: 1rem;
        justify-content: center;
        margin-left: auto;
        margin-right: auto;
        max-width: 350px;
    }

    .cta-section .btn {
        width: 100%;
    }
    
    .bg-light-custom .btn {
        display: block;
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .bg-light-custom .btn + .btn {
        margin-top: 1rem;
    }

    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .d-flex.gap-3 {
        gap: 1rem !important;
        margin-bottom: 0.5rem;
    }
    
    .hero-section .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .navbar-brand img {
        height: 60px;
    }
    
    .navbar-toggler {
        margin-right: 10px;
    }
    
    .navbar-nav .nav-item {
        margin: 5px 0;
    }
    
    .navbar-nav .nav-link {
        padding: 10px 15px;
        border-radius: 5px;
    }
    
    .navbar-nav .nav-link:hover {
        background-color: var(--light-color);
    }
}

/* Стили для секций */
section {
    padding: 80px 0;
    border-bottom: none;
    position: relative;
}

section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(to right, 
        transparent 0%, 
        var(--accent-color) 20%, 
        var(--accent-color) 80%, 
        transparent 100%
    );
}

/* Убираем разделитель перед и после CTA блока на страницах услуг */
.content-section.pt-0::after,
section:has(+ .content-section.pt-0)::after,
section:has(> div > .cta-section)::after {
    content: none;
}

section:has(> div > .cta-section) {
    background-color: var(--section-alt);
}

section:nth-child(even) {
    background-color: var(--section-alt);
}

section:nth-child(odd) {
    background-color: var(--bg-light);
}

.bg-white-force {
    background-color: var(--bg-light) !important;
}

.footer-logo {
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

.footer-logo:hover {
    filter: brightness(0) invert(0.9);
}

footer a {
    transition: all 0.3s ease;
}

footer a:hover {
    color: var(--accent-color) !important;
}

/* 
==============================================
    SERVICE PAGE STYLES
==============================================
*/

.service-hero-section {
    position: relative;
    padding: 60px 0;
    color: white;
    /* background-size: cover; */
    /* background-position: center; */
    min-height: 300px;
    display: flex;
    align-items: center;
}

.service-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    z-index: 1;
}

.service-hero-section .container {
    position: relative;
    z-index: 2;
}

.service-hero-section h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 5px rgba(0,0,0,0.4);
    margin-bottom: 0.5rem;
}

.service-hero-section .lead {
    font-size: 1.3rem;
    font-weight: 400;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    opacity: 0.9;
}

.content-section {
    padding: 80px 0;
}

.content-section .content-img {
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.content-section h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.icon-list {
    list-style: none;
    padding-left: 0;
}

.icon-list li {
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.icon-list i {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-right: 15px;
    margin-top: 5px;
    width: 20px;
    text-align: center;
}

.feature-card {
    padding: 30px;
    text-align: left;
    transition: all 0.3s ease;
    height: 100%;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    background-color: white;
    border: none;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(41, 92, 122, 0.15);
}

.feature-card .feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 0 20px;
    background-color: var(--light-color);
    color: var(--primary-color);
    font-size: 1.8rem;
    border-radius: 12px;
}

.feature-card h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.cta-section {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    padding: 60px 40px;
    border-radius: 15px;
    color: white;
}

.cta-section h3 {
    color: white;
    font-weight: 700;
}

.cta-section .btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--dark-color);
    font-weight: 600;
}

.cta-section .btn-primary:hover {
    background-color: #fff;
    border-color: #fff;
}

.cta-section .btn-outline-secondary {
    border-color: var(--accent-color);
    color: white;
    font-weight: 600;
}

.cta-section .btn-outline-secondary:hover {
    background-color: var(--accent-color);
    color: var(--dark-color);
}

@media (max-width: 768px) {
    .service-hero-section {
        padding: 60px 0;
        min-height: 300px;
    }
    .service-hero-section h1 {
        font-size: 2.2rem;
    }
    .service-hero-section .lead {
        font-size: 1.1rem;
    }
    .content-section {
        padding: 60px 0;
    }
}

/* 
==============================================
    MODAL STYLES
==============================================
*/

.modal-header {
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 1rem;
}

.modal-title {
    color: var(--primary-color);
    font-weight: 600;
}

.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body .contact-form {
    padding: 0 !important;
    box-shadow: none;
    border: none;
}

.modal-body .contact-info a {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.modal-body .contact-info a:hover {
    color: var(--primary-color);
}

/* Скрываем дополнительную полосу прокрутки при открытии модального окна */
.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
}

.modal-open body {
    overflow: hidden !important;
    padding-right: 0 !important;
}

/* Убираем отступ справа, который Bootstrap добавляет для компенсации скрытой полосы прокрутки */
.modal-open .navbar,
.modal-open .fixed-top {
    padding-right: 0 !important;
}

/* Изменяем цвет фона модального окна на цвет сайта */
.modal-backdrop {
    background-color: var(--dark-color) !important;
    opacity: 0.7 !important;
}

.modal-backdrop.show {
    opacity: 0.7 !important;
}

@media (max-width: 768px) {
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-body .row {
        flex-direction: column-reverse;
    }

    .modal-body .col-md-6:first-child {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--accent-color);
    }
}

/*
==============================================
    AI CHAT (на главной)
==============================================
*/

.ai-chat {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    min-height: 540px;
}

.ai-chat__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 13px;
    margin-bottom: 13px;
    border-bottom: 1px solid var(--light-color);
    font-size: 14px;
    color: #6c757d;
}
.ai-chat__head strong {
    color: var(--primary-color);
    font-size: 1.05rem;
    font-weight: 700;
}
.ai-chat__subtitle {
    font-size: 12.5px;
    color: #8a96a3;
    margin-left: 4px;
}
.ai-chat__status {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4caf50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.18);
    flex: 0 0 9px;
}
.ai-chat__dots {
    display: inline-flex;
    gap: 5px;
    margin-left: auto;
}
.ai-chat__dots i {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent-color);
    display: inline-block;
}
.ai-chat__dots i:nth-child(1) { background: #FF8576; }
.ai-chat__dots i:nth-child(2) { background: #F4C264; }
.ai-chat__dots i:nth-child(3) { background: #6FCC7A; }

.ai-chat__log {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 4px;
    min-height: 320px;
    max-height: 460px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

.msg {
    display: flex;
    width: 100%;
    min-width: 0;
}
.msg--bot { justify-content: flex-start; }
.msg--user { justify-content: flex-end; }
.msg__bubble {
    max-width: min(560px, 92%);
    padding: 11px 15px;
    border-radius: 16px;
    font-size: 14.5px;
    line-height: 1.5;
    background: var(--light-color);
    color: var(--text-color);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.msg--user .msg__bubble {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: #fff;
    border-bottom-right-radius: 5px;
}
.msg--bot .msg__bubble {
    border-bottom-left-radius: 5px;
}
.msg--err .msg__bubble {
    background: #fdecea;
    color: #8a2a0e;
}

.typing { display: inline-flex; gap: 4px; }
.typing span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: .35;
    animation: tpulse 1.2s infinite ease-in-out;
    display: inline-block;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .30s; }
@keyframes tpulse {
    0%, 100% { opacity: .25; transform: translateY(0); }
    50%      { opacity: 1;   transform: translateY(-3px); }
}

.ai-chat__form {
    display: flex;
    gap: 8px;
    margin-top: 13px;
    padding: 5px 5px 5px 16px;
    background: #fff;
    border-radius: 999px;
    border: 1px solid var(--light-color);
    transition: border-color .2s, box-shadow .2s;
}
.ai-chat__form:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(120, 185, 215, 0.25);
}
.ai-chat__form input {
    flex: 1;
    min-width: 0;
    padding: 10px 0;
    border: 0;
    background: transparent;
    font-size: 14.5px;
    outline: none;
    color: var(--text-color);
    box-shadow: none;
    margin: 0;
}
.ai-chat__form input:focus {
    box-shadow: none;
    border: 0;
}
.ai-chat__form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    min-width: 48px;
    padding: 0;
    border-radius: 999px;
    margin: 0;
    line-height: 1;
}

.ai-chat__hints {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.ai-chat__hints .chip {
    border: 1px solid var(--light-color);
    background: #fff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all .2s;
}
.ai-chat__hints .chip:hover {
    border-color: var(--accent-color);
    background: var(--light-color);
    transform: translateY(-1px);
}

.ai-chat__disclaimer a {
    color: var(--primary-color);
    text-decoration: none;
}
.ai-chat__disclaimer a:hover {
    color: var(--dark-color);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .ai-chat {
        min-height: 460px;
    }
    .ai-chat__log {
        min-height: 240px;
        max-height: 50vh;
    }
    .ai-chat__subtitle { display: none; }
    .ai-chat__dots { display: none; }
    .ai-chat__form {
        align-items: center;
        gap: 8px;
        padding: 4px 4px 4px 14px;
    }
    .ai-chat__form input {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        height: 42px;
        padding: 8px 0;
    }
    .ai-chat__form .btn {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        min-width: 44px;
        display: inline-flex;
        padding: 0;
    }
    .msg__bubble { font-size: 13.5px; padding: 10px 13px; }
}

/*
==============================================
    ARTICLE PAGE STYLES
==============================================
*/

.article-body {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-color);
}
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5 {
    color: var(--dark-color);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.article-body h2 { font-size: 1.75rem; }
.article-body h3 { font-size: 1.4rem; }
.article-body h4 { font-size: 1.2rem; }
.article-body p {
    margin-bottom: 1.1rem;
}
.article-body ul,
.article-body ol {
    margin-bottom: 1.2rem;
    padding-left: 1.4rem;
}
.article-body li {
    margin-bottom: 0.4rem;
}
.article-body a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article-body a:hover {
    color: var(--dark-color);
}
.article-body code {
    background: var(--light-color);
    color: var(--dark-color);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.92em;
}
.article-body pre {
    background: var(--section-alt);
    border: 1px solid var(--light-color);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 1.2rem 0;
}
.article-body pre code {
    background: transparent;
    padding: 0;
    color: var(--text-color);
}
.article-body strong {
    color: var(--dark-color);
}

/* Бейдж "Свежее" поверх белого фона */
.bg-primary-custom { color: #fff; }

@media (max-width: 768px) {
    .article-body {
        font-size: 1rem;
        line-height: 1.65;
    }
    .article-body h2 { font-size: 1.5rem; }
    .article-body h3 { font-size: 1.25rem; }
}
