/* --- GOOGLE FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Roboto+Mono:wght@500&display=swap');

/* --- CSS VARIABLES --- */
:root {
    --color-background: #F9FAFB;
    --color-text-primary: #111827;
    --color-text-secondary: #6B7280;
    --color-primary: #4338CA;
    --color-primary-hover: #3730A3;
    --color-border: #E5E7EB;

    --font-family-base: 'Inter', sans-serif;
    --font-family-accent: 'Roboto Mono', monospace;

    --container-width: 1140px;
    --container-padding: 1.5rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-accent);
    line-height: 1.3;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* --- HEADER --- */
.header {
    background-color: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background-color: rgba(249, 250, 251, 0.8);
}

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

.header__logo {
    font-family: var(--font-family-accent);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

.header__nav-list {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header__nav-link {
    font-size: 1rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    position: relative;
    padding: 0.25rem 0;
}

.header__nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.header__nav-link:hover::after {
    width: 100%;
}

.header__nav-link:hover {
    color: var(--color-text-primary);
}

.header__nav-link--cta {
    background-color: var(--color-primary);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.header__nav-link--cta:hover {
    background-color: var(--color-primary-hover);
    color: white;
}

.header__nav-link--cta::after {
    display: none;
}

/* --- FOOTER --- */
.footer {
    background-color: #111827;
    color: #9CA3AF;
    padding-top: 4rem;
}

.footer__container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding-bottom: 4rem;
}

.footer__column--brand {
    grid-column: span 1;
}

.footer__logo {
    font-family: var(--font-family-accent);
    font-size: 1.75rem;
    font-weight: 500;
    color: white;
    display: inline-block;
    margin-bottom: 1rem;
}

.footer__description {
    font-size: 0.9rem;
    max-width: 250px;
}

.footer__heading {
    font-family: var(--font-family-base);
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer__list--contacts li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer__list--contacts i {
    flex-shrink: 0;
    color: var(--color-primary);
}

.footer__link {
    color: #9CA3AF;
}

.footer__link:hover {
    color: white;
    text-decoration: underline;
}

.footer__bottom {
    background-color: #00000020;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.875rem;
}


/* --- RESPONSIVE ADAPTATIONS --- */
@media (max-width: 992px) {
    .footer__container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header__nav {
        display: none; /* Скроем для мобильных, в будущем здесь будет бургер-меню */
    }
}

@media (max-width: 576px) {
    .footer__container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer__column--brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .footer__list--contacts li {
       justify-content: center;
    }
}

/* --- BUTTONS --- */
.button {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s;
    border: none;
}

.button--primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.1);
}

.button--primary:hover {
    background-color: var(--color-primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(67, 56, 202, 0.3);
}

/* --- HERO SECTION --- */
.hero {
    padding: 6rem 0;
    overflow: hidden;
}

.hero__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero__content {
    max-width: 50%;
    flex: 1;
}

.hero__title {
    font-size: 3rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    min-height: 150px; /* Резервируем место под заголовок */
}

/* Эффект курсора для "печатающейся машинки" */
.hero__title::after {
    content: '|';
    animation: blink 1s infinite;
    font-weight: 700;
    color: var(--color-primary);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Стили для элементов, которые появятся после анимации */
.hero__description, .hero__cta {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Класс, который добавит JS для запуска анимации появления */
.hero--animated .hero__description {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s; /* Небольшая задержка для красоты */
}

.hero--animated .button {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.hero__visual {
    position: relative;
    max-width: 45%;
    flex: 1;
}

.hero__image {
    width: 100%;
    border-radius: 16px;
    position: relative;
    z-index: 2;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

/* Декоративные фоновые фигуры */
.hero__shape {
    position: absolute;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    z-index: 1;
    background: linear-gradient(45deg, var(--color-primary), #a855f7);
    animation: morph 8s ease-in-out infinite;
}

.hero__shape--1 {
    width: 200px;
    height: 200px;
    top: -50px;
    left: -50px;
    opacity: 0.3;
}

.hero__shape--2 {
    width: 250px;
    height: 250px;
    bottom: -80px;
    right: -80px;
    opacity: 0.4;
    animation-direction: reverse;
}

@keyframes morph {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    50% { border-radius: 60% 40% 30% 70% / 70% 50% 50% 30%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

/* --- HERO RESPONSIVE ADAPTATIONS --- */
@media (max-width: 992px) {
    .hero__title {
        font-size: 2.5rem;
        min-height: 120px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 4rem 0;
        text-align: center;
    }
    .hero__container {
        flex-direction: column;
    }
    .hero__content, .hero__visual {
        max-width: 100%;
    }
    .hero__visual {
        margin-top: 3rem;
    }
    .hero__title {
        min-height: 100px; /* Уменьшаем для мобильных */
    }
}

/* --- GLOBAL SECTION STYLES --- */
.section {
    padding: 5rem 0;
}

.section__header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3.5rem;
}

.section__title {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.section__subtitle {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* --- BASICS SECTION --- */
.basics {
    background-color: #F3F4F6; /* Слегка серый фон для визуального отделения */
}

.basics__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* --- CARD STYLES --- */
.card {
    background-color: var(--color-background);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.07);
}

.card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background-color: #E0E7FF; /* Светлый оттенок основного цвета */
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.card__icon i {
    color: var(--color-primary);
    width: 32px;
    height: 32px;
}

.card__title {
    font-family: var(--font-family-base);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.card__description {
    color: var(--color-text-secondary);
    line-height: 1.6;
}


/* --- BASICS RESPONSIVE ADAPTATIONS --- */
@media (max-width: 992px) {
    .basics__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 4rem 0;
    }
    .section__title {
        font-size: 2rem;
    }
    .section__subtitle {
        font-size: 1rem;
    }
}

/* --- PLATFORMS SECTION --- */
.platforms {
    padding-bottom: 3rem; /* Немного уменьшим нижний отступ */
}

.platforms__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-items: center;
    gap: 2rem;
}

.platform__item {
    text-align: center;
}

.platform__logo {
    max-width: 80px; /* Размер "логотипа" */
    height: 80px;
    object-fit: cover;
    border-radius: 16px;
    margin: 0 auto 1rem;
    filter: grayscale(100%) opacity(60%);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.platform__item:hover .platform__logo {
    filter: grayscale(0%) opacity(100%);
    transform: scale(1.1);
}

.platform__name {
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* --- PLATFORMS RESPONSIVE ADAPTATIONS --- */
@media (max-width: 992px) {
    .platforms__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

@media (max-width: 576px) {
    .platforms__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
    .platform__logo {
        max-width: 70px;
        height: 70px;
    }
}

/* --- AI INTEGRATION SECTION --- */
.ai {
    background-color: #F3F4F6; /* Тот же фон, что и у "Основ" */
}

.ai__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    gap: 4rem;
}

.ai__visual {
    position: relative;
}

.ai__image {
    width: 100%;
    border-radius: 16px;
    position: relative;
    z-index: 2;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.ai__content-title {
    font-family: var(--font-family-accent);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.ai__content-description {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.ai__features-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.feature-item__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.feature-item__icon i {
    color: var(--color-primary);
    width: 28px;
    height: 28px;
}

.feature-item__text h4 {
    font-family: var(--font-family-base);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.feature-item__text p {
    color: var(--color-text-secondary);
}

/* --- AI RESPONSIVE ADAPTATIONS --- */
@media (max-width: 992px) {
    .ai__grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .ai__visual {
        order: -1; /* На мобильных устройствах картинка будет сверху */
        max-width: 400px;
        margin: 0 auto;
    }
}

/* --- CASES SECTION (TABS) --- */
.cases__tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.cases__tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid var(--color-border);
    background-color: var(--color-background);
    color: var(--color-text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cases__tab-btn:hover {
    background-color: #E0E7FF;
    color: var(--color-primary);
    border-color: #C7D2FE;
}

.cases__tab-btn.is-active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 14px 0 rgba(67, 56, 202, 0.2);
}

.cases__content-panel {
    display: none; /* Скрываем все панели по умолчанию */
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    gap: 4rem;
    animation: fadeIn 0.6s ease;
}

.cases__content-panel.is-active {
    display: grid; /* Показываем только активную */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel__visual {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.panel__visual img {
    width: 100%;
    display: block;
}

.panel__text h3 {
    font-family: var(--font-family-accent);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.panel__text p {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

/* --- CASES RESPONSIVE ADAPTATIONS --- */
@media (max-width: 992px) {
    .cases__content-panel {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
}
@media (max-width: 576px) {
    .cases__tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* --- CONTACT SECTION --- */
.contact {
    background-color: #F3F4F6;
}

.contact__wrapper {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 4rem;
    background-color: var(--color-background);
    padding: 4rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.07);
}

.contact__info h3 {
    font-family: var(--font-family-accent);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.contact__info p {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact__details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.contact__details li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}
.contact__details i {
    color: var(--color-primary);
}

/* --- FORM STYLES --- */
.contact__form {
    position: relative;
}
.form__group {
    margin-bottom: 1.5rem;
}
.form__label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form__input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-family-base);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.form__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.15);
}
.form__input.is-invalid {
    border-color: #EF4444;
}

/* Captcha */
.captcha__wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}
#captcha-question {
    font-weight: 500;
}
#captcha {
    width: 100px;
}

/* Checkbox */
.form__checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.form__checkbox label {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

/* Submit button with loader */
.form__submit {
    width: 100%;
    position: relative;
}
.button__loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
    display: none;
}
.form__submit.is-loading .button__text {
    opacity: 0;
}
.form__submit.is-loading .button__loader {
    display: block;
}
@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success Message */
.form__success-message {
    display: none;
    text-align: center;
    padding: 2rem;
    border: 2px solid #10B981;
    background-color: #F0FDF4;
    border-radius: 8px;
    color: #065F46;
}
.form__success-message h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* --- CONTACT RESPONSIVE --- */
@media (max-width: 992px) {
    .contact__wrapper {
        grid-template-columns: 1fr;
        padding: 2rem;
        gap: 3rem;
    }
}

/* --- COOKIE POP-UP --- */
.cookie-popup {
    position: fixed;
    bottom: -100%; /* Скрыт по умолчанию */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 3rem);
    max-width: 800px;
    background-color: var(--color-text-primary);
    color: var(--color-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    z-index: 200;
    transition: bottom 0.5s ease-in-out;
}

.cookie-popup.is-visible {
    bottom: 1.5rem; /* Появляется снизу */
}

.cookie-popup__text {
    font-size: 0.9rem;
}

.cookie-popup__text a {
    color: white;
    text-decoration: underline;
}

.cookie-popup__btn {
    flex-shrink: 0;
    padding: 0.6rem 1.25rem;
}

/* --- STYLES FOR POLICY PAGES (privacy.html, etc.) --- */
.pages {
    padding: 5rem 0;
}

.pages .container {
    max-width: 800px; /* Ограничиваем ширину для читабельности */
}

.pages h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.pages h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

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

.pages a {
    text-decoration: underline;
}

.pages ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.pages li {
    margin-bottom: 0.75rem;
    color: var(--color-text-secondary);
}

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

/* --- RESPONSIVE FOR COOKIE POP-UP --- */
@media (max-width: 768px) {
    .cookie-popup {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}