/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1e40af; /* основной фирменный */
    --primary-rgb: 30, 64, 175;
    --ink: #334155; /* основной текст */
    --ink-rgb: 51, 65, 85;
    --surface: #ffffff; /* базовые поверхности */
    --surface-rgb: 255, 255, 255;
    --success: #10b981; /* успех */
    --success-rgb: 16, 185, 129;
    --danger: #ef4444; /* ошибка */
    --danger-rgb: 239, 68, 68;
    --border: rgba(0, 0, 0, 0.12); /* единые границы */
    --shadow-1: 0 10px 25px rgba(0, 0, 0, 0.12); /* единая тень */
    --text-secondary: rgba(var(--ink-rgb), 0.7); /* вторичный текст */
    --overlay-dark: rgba(0, 0, 0, 0.5); /* затемнение */
    --overlay-weak: rgba(0, 0, 0, 0.04); /* мягкие фоны */
    --fs-xxl: 2.5rem;    /* hero */
    --fs-xl: 2rem;       /* разделы, логотип */
    --fs-lg: 1.5rem;     /* заголовки карточек */
    --fs-base: 1rem;     /* базовый текст */
    --fs-sm: 0.875rem;   /* подписи */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'IBM Plex Sans', 'Manrope', 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: var(--ink);
    background: var(--surface);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.25rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: var(--surface);
}

.btn-primary:hover {
    background: color-mix(in srgb, var(--primary) 88%, black);
    color: var(--surface);
}

@supports not (color: color-mix(in srgb, white, black)) {
    .btn-primary:hover {
        filter: brightness(0.92); /* fallback затемнение */
    }

    .nav-menu a:hover,
    .product-link:hover {
        color: var(--primary); /* fallback оттенок */
    }

    .footer-contacts a:hover {
        color: var(--primary); /* fallback оттенок */
    }

    .social-links a:hover {
        background: var(--primary); /* fallback фон */
        color: var(--surface);
    }
}

.btn-large {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: var(--fs-base); /* унифицированный размер */
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    padding: 0.5rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo-text {
    font-size: var(--fs-xl); /* общий крупный размер */
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: color-mix(in srgb, var(--primary) 88%, black);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--ink);
    transition: all 0.3s;
    border-radius: 2px;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero Section */
.hero {
    background: var(--surface);
    padding: 4rem 0;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: flex-end; /* выравнивание по нижней границе для совпадения с кнопкой */
}

.badge-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.badge-group img {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
}

.hero-title {
    font-size: var(--fs-xxl); /* 40px */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--ink);
}

.hero-description {
    font-size: var(--fs-base);
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.call-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.call-info p {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

.call-info a {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-bottom: -0.875rem; /* компенсируем разницу для выравнивания нижней границы с кнопкой (~14px) */
}

/* Clients Section */
.clients-section {
    background: var(--overlay-weak);
    padding: 2rem 0;
    overflow: hidden;
}

.clients-title {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.clients-carousel {
    overflow: hidden;
}

.clients-track {
    display: flex;
    gap: 4rem;
    animation: scroll 30s linear infinite;
}

.clients-track img {
    flex-shrink: 0;
    height: 40px;
    width: auto;
    opacity: 0.7;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Features Section */
.features-section {
    background: var(--overlay-weak);
    padding: 4rem 0;
}

.section-title {
    font-size: var(--fs-xl);
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--ink);
}

.section-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--fs-base);
    margin-bottom: 3rem;
}

.tabs-container {
    max-width: 1000px;
    margin: 0 auto;
}

.tabs-list {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
}

.tab-btn {
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--fs-base); /* базовый размер */
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--ink);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tabs-content {
    position: relative;
    min-height: 180px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-pane.active {
    display: block;
}

.tab-pane p {
    font-size: var(--fs-base);
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.tab-pane img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* Двухколоночная структура для табов в секции how-it-works */
.how-it-works .tab-content-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.how-it-works .tab-text {
    flex: 1;
    min-width: 0;
}

.how-it-works .tab-image {
    flex: 1;
    min-width: 0;
}

.how-it-works .tab-image img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .how-it-works .tab-content-wrapper {
        flex-direction: column;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Roles Section */
.roles-section {
    background: var(--overlay-weak);
    padding: 4rem 0;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.role-card {
    background: var(--surface);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s;
}

.role-card:hover {
    transform: translateY(-5px);
}

.role-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.role-card h3 {
    font-size: var(--fs-lg);
    font-weight: 700;
    padding: 1.5rem 1.5rem 0.5rem;
    color: var(--ink);
}

.role-card p {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-secondary);
}

/* How It Works */
.how-it-works {
    background: var(--surface);
    padding: 4rem 0;
}

/* Case Studies */
.case-studies {
    background: var(--overlay-weak);
    padding: 4rem 0;
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.case-card {
    background: var(--surface);
    border-radius: 0.5rem;
    overflow: hidden;
}

.case-card > img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.case-content {
    padding: 1.5rem;
}

.company-logo {
    height: 40px;
    margin-bottom: 1rem;
}

.case-quote {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.case-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.case-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.author-name {
    font-weight: 600;
    color: var(--ink);
}

.author-role {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

/* Command Center */
.command-center {
    background: var(--surface);
    padding: 4rem 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.product-card {
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    transition: box-shadow 0.2s;
}

.product-card:hover {
    box-shadow: var(--shadow-1);
}

.product-icon {
    margin-bottom: 1.5rem;
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-icon::before {
    content: '';
    position: absolute;
    width: 64px;
    height: 64px;
    background: #1e40af;
    opacity: 0.1;
    border-radius: 8px;
}

.product-icon i {
    font-size: 64px;
    color: #1e40af;
    position: relative;
    z-index: 1;
}

.product-card h3 {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--ink);
}

.product-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.product-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.product-link:hover {
    color: color-mix(in srgb, var(--primary) 88%, black);
}

/* Contact Section */
.contact-section {
    background: linear-gradient(var(--overlay-dark), var(--overlay-dark)), var(--primary);
    padding: 4rem 0;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start; /* выравнивание по верху для совпадения с первым инпутом */
}

.form-section h2 {
    color: var(--surface);
    margin-bottom: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form select {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-size: var(--fs-base);
    background: var(--surface);
}

.contact-form input:focus,
.contact-form select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.privacy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--surface);
    cursor: pointer;
    user-select: none;
}

.privacy-checkbox input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.privacy-checkbox span {
    font-size: var(--fs-sm);
    line-height: 1.5;
}

.form-image {
    padding-top: 2rem; /* компенсируем margin-bottom пустого h2 для выравнивания с первым инпутом */
}

.form-image img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* Modal */
body.modal-open {
    overflow: hidden; /* блокируем фон */
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.modal.is-open {
    display: flex;
}

.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65); /* затемнение */
}

.modal__dialog {
    position: relative;
    background: var(--surface);
    border-radius: 0.25rem;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
    padding: 2rem;
    width: min(540px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
}

.modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal__close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: var(--ink);
}

#contactModal h3 {
    font-size: var(--fs-lg);
    margin-bottom: 0.5rem;
    color: var(--ink);
}

.modal-subtitle {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.modal .contact-form {
    gap: 0.75rem; /* чуть плотнее */
}

.modal .privacy-checkbox {
    color: var(--ink); /* темный текст для модалки */
}

@media (max-width: 640px) {
    .modal__dialog {
        padding: 1.75rem 1.5rem;
        width: 90vw;
        max-height: 92vh;
    }

    .modal__close {
        top: 0.75rem;
        right: 0.75rem;
    }
}

/* Footer */
.footer {
    background: linear-gradient(var(--overlay-dark), var(--overlay-dark)), var(--primary);
    color: var(--surface);
    padding: 3rem 0 1.5rem;
}

.footer-top {
    margin-bottom: 2rem;
}

.footer-logo .logo-text {
    color: var(--surface);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-contacts h4,
.footer-social h4,
.footer-address h4 {
    font-size: var(--fs-base);
    margin-bottom: 1rem;
    color: var(--surface);
}

.footer-contacts p,
.footer-address p {
    margin-bottom: 0.5rem;
}

.footer-contacts a {
    color: var(--surface);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-contacts a:hover {
    color: color-mix(in srgb, var(--surface) 80%, var(--primary) 20%);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    color: var(--surface);
    transition: background 0.2s;
}

.social-links a:hover {
    background: color-mix(in srgb, var(--surface) 20%, var(--primary) 80%);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-container,
    .contact-container {
        grid-template-columns: 1fr;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 65px;
        right: -100%;
        width: 100%;
        max-width: 300px;
        background: var(--surface);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow-1);
        transition: right 0.3s;
        z-index: 99;
        height: calc(100vh - 65px);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        margin-bottom: 1rem;
    }

    .nav-actions {
        display: none;
    }

    .hero-title {
        font-size: var(--fs-xl); /* ступень xl */
    }

    .tabs-list {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: var(--fs-lg); /* ступень lg */
    }

    .roles-grid,
    .cases-grid,
    .products-grid {
        grid-template-columns: 1fr;
    }

    .tabs-list {
        flex-direction: column;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}



/* --- Added by ChatGPT: logo and hero image placement --- */
.nav-logo .logo-img {
  height: 69px;
  width: auto;
  display: block;
}
/* If the logo link wrapper is used */
.logo-link { display: inline-flex; align-items: center; }

/* Arrange hero text and image side-by-side on wide screens */
.hero .hero-container {
  display: flex;
  align-items: flex-end; /* выравнивание по нижней границе для совпадения с кнопкой */
  gap: 2.5rem;
}
.hero .hero-content { flex: 1 1 50%; }
.hero .hero-image { flex: 1 1 50%; text-align: center; }
.hero .hero-image img {
  width: 100%;
  height: auto;
  display: inline-block;
}

/* SVG primary sync */
svg [fill="#1e40af"],
svg [stroke="#1e40af"] {
    fill: var(--primary) !important; /* привязка к палитре */
    stroke: var(--primary) !important;
}

/* Stack on mobile */
@media (max-width: 768px) {
  .hero .hero-container { flex-direction: column; }
  .nav-logo .logo-img { height: 69px; }
}
/* --- End additions --- */

/* Notification Popup */
.notification-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.notification-popup.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.notification-content {
    background: var(--surface);
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-1);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
}

.notification-popup.success .notification-content {
    border-left: 4px solid var(--success);
}

.notification-popup.error .notification-content {
    border-left: 4px solid var(--danger);
}

.notification-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-popup.success .notification-icon::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--success);
    color: var(--surface);
    border-radius: 50%;
    font-weight: bold;
    font-size: var(--fs-sm);
}

.notification-popup.error .notification-icon::before {
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--danger);
    color: var(--surface);
    border-radius: 50%;
    font-weight: bold;
    font-size: var(--fs-sm);
}

.notification-message {
    flex: 1;
    color: var(--ink);
    font-size: var(--fs-sm);
    line-height: 1.5;
}

.notification-close {
    background: none;
    border: none;
    font-size: var(--fs-lg);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
    line-height: 1;
}

.notification-close:hover {
    color: var(--ink);
}

/* Alert стили для формы */
.alert {
    padding: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.alert.error {
    background: rgba(var(--danger-rgb), 0.08);
    border: 1px solid rgba(var(--danger-rgb), 0.3);
    color: var(--danger);
}

.alert.success {
    background: rgba(var(--success-rgb), 0.08);
    border: 1px solid rgba(var(--success-rgb), 0.3);
    color: var(--success);
}

@media (max-width: 768px) {
    .notification-popup {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }

    .notification-popup.show {
        transform: translateY(0);
    }
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, rgba(var(--primary-rgb), 0.02) 100%);
    padding: 2rem 1rem;
}

.login-form-wrapper {
    background: var(--surface);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-1);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo {
    margin-bottom: 2.5rem;
    text-align: center;
}

.login-logo img {
    max-width: 200px;
    height: auto;
}

.login-form {
    width: 100%;
}

.login-error {
    background: rgba(var(--danger-rgb), 0.08);
    border: 1px solid rgba(var(--danger-rgb), 0.3);
    color: var(--danger);
    padding: 0.875rem 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1.5rem;
    font-size: var(--fs-sm);
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--ink);
    font-size: var(--fs-sm);
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-size: var(--fs-base);
    font-family: inherit;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.login-form .btn {
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .login-form-wrapper {
        padding: 2rem 1.5rem;
    }

    .login-logo {
        margin-bottom: 2rem;
    }

    .login-logo img {
        max-width: 150px;
    }
}

