/* --- CSS VARIABLES --- */
:root {
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --bg-dark: #0f172a;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e5e7eb;
    --radius: 8px;
    --font-main: 'Inter', sans-serif;
    --font-header: 'Orbitron', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

ul {
    list-style: none;
}

/* --- UTILITIES --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn--primary {
    background-color: var(--text-main);
    color: #fff;
    border: 1px solid var(--text-main);
}

.btn--primary:hover {
    background-color: #333;
}

.btn--ghost {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.btn--ghost:hover {
    border-color: var(--text-main);
}

.btn--text {
    color: var(--accent);
    padding: 10px 0;
}

.btn--text:hover {
    color: var(--accent-hover);
}

.btn--full {
    width: 100%;
}

.btn--sm {
    padding: 8px 20px;
    font-size: 0.85rem;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: #eff6ff;
    color: var(--accent);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 24px;
    font-family: var(--font-mono);
}

/* --- Bank Badge Modifier --- */
.badge.badge--bank {
    background-color: #fef2f2;
    color: #d40000;
    border: 1px solid #fee2e2;
}

/* --- HEADER --- */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    height: 70px;
}

.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.05em;
    color: var(--text-main);
}

.nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav__link {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav__link:hover {
    color: var(--text-main);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.mobile-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    transition: all 0.3s ease;
}

.mobile-only-btn {
    display: none;
}

/* --- HERO --- */
.hero {
    padding: 120px 0 100px;
    background: radial-gradient(circle at 50% 0%, #f9fafb 0%, #ffffff 70%);
}

.hero__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero__title {
    font-size: 3rem;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    color: var(--text-main);
}

.hero__subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 500px;
}

.hero__actions {
    display: flex;
    gap: 24px;
    align-items: center;
}

/* --- CODE BLOCK VISUAL --- */
.code-window {
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border: 1px solid rgba(0,0,0,0.1);
    max-width: 100%;
}

.code-header {
    background: #2d2d2d;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.filename {
    margin-left: 12px;
    color: #999;
    font-size: 0.75rem;
}

pre {
    padding: 24px;
    color: #d4d4d4;
    overflow-x: auto;
}

.key { color: #9cdcfe; }
.string { color: #ce9178; }
.number { color: #b5cea8; }
.bool { color: #569cd6; }

/* --- SECTIONS --- */
.section {
    padding: 100px 0;
}

.section--light {
    background-color: var(--bg-light);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section__header {
    max-width: 700px;
    margin-bottom: 60px;
}

.section__title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.section__desc {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.about-text {
    max-width: 800px;
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.about-text p + p {
    margin-top: 20px;
}

/* --- SOLUTIONS GRID --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.05);
    border-color: #d1d5db;
}

.card__icon {
    margin-bottom: 24px;
    width: 48px;
    height: 48px;
    background: #eff6ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.card__tag {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.card__text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    flex-grow: 1;
}

.card__footer {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    font-family: var(--font-mono);
}

/* --- TECH SECTION --- */
.section--tech {
    background-color: var(--bg-dark);
    color: #fff;
}

.tech-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.text-white {
    color: #fff;
}

.tech-list {
    margin-top: 32px;
}

.tech-list li {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    display: flex;
    align-items: center;
}

.tech-list li::before {
    content: "✓";
    color: var(--accent);
    margin-right: 12px;
    font-weight: bold;
}

/* --- CONTACT FORM --- */
.contact-container {
    display: flex;
    justify-content: center;
}

.form-wrapper {
    width: 100%;
    max-width: 500px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: 12px;
}

.form-desc {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

/* Обновленный блок для полей ввода */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    
    /* ВАЖНО: Явно задаем шрифт, чтобы он не был "системным" */
    font-family: var(--font-main); 
    font-size: 1rem;
    color: var(--text-main);
    
    transition: border 0.2s, box-shadow 0.2s;
    background: #fff;
    
    /* Убираем стандартные стили браузера */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group textarea {
    resize: vertical; /* Можно тянуть только вниз */
    min-height: 100px;
    line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.form-status {
    margin-top: 16px;
    font-size: 0.9rem;
    text-align: center;
}

.success { color: #059669; }
.error { color: #dc2626; }

/* --- FOOTER --- */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer__links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.footer__links a {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer__links a:hover {
    color: var(--text-main);
}

.footer__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer__icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.footer__email {
    font-family: var(--font-mono);
}

.footer__copy {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* --- LEGAL PAGES STYLES --- */
.section--legal {
    padding-top: 140px;
    padding-bottom: 80px;
    min-height: 80vh;
    background-color: var(--bg-color);
}

.legal-container {
    max-width: 800px;
    margin: 0 auto;
}

.legal-text {
    font-family: var(--font-mono);
    color: #e5e7eb;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* --- COOKIE BANNER (Fixed) --- */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto; /* Важно: отключаем левое выравнивание */
    width: 400px;
    max-width: 90vw; /* Чтобы не вылезал на мобилке */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1);
    z-index: 2000;
    display: none; /* JS включит flex */
    flex-direction: column;
    gap: 16px;
    animation: slideUp 0.5s ease-out;
}

.cookie-content p {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
    margin: 0;
}

.cookie-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 8px;
}

.cookie-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: underline;
    margin-right: auto;
}

.cookie-link:hover {
    color: var(--text-main);
}

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

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    /* Header & Nav */
    .mobile-toggle {
        display: flex;
    }

    .desktop-only-btn {
        display: none;
    }

    .mobile-only-btn {
        display: inline-flex;
        margin-top: 20px;
        width: 100%;
    }

    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: 0;
        flex-direction: column;
        background-color: #fff;
        overflow: hidden;
        transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 0 20px;
        border-bottom: 1px solid var(--border);
        gap: 24px;
        align-items: flex-start;
    }

    .nav.is-open {
        height: calc(100vh - 70px);
        padding-top: 40px;
        overflow-y: auto;
    }

    .nav__link {
        font-size: 1.1rem;
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid #f3f4f6;
    }

    .mobile-toggle.is-active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .mobile-toggle.is-active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-toggle.is-active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Hero */
    .hero {
        padding: 60px 0 60px;
    }

    .hero__grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero__visual {
        order: -1;
        margin-bottom: 10px;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero__actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Solutions */
    .grid-3 {
        grid-template-columns: 1fr;
    }

    /* Tech Section */
    .tech-container {
        grid-template-columns: 1fr;
    }

    .tech-visual {
        width: 100%;
        margin-top: 24px;
        display: block;
    }

    .code-window {
        width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .code-window pre {
        padding: 16px;
        font-size: 0.75rem;
    }

    /* Form */
    .form-wrapper {
        padding: 24px;
        border: none;
        box-shadow: none;
        background: transparent;
    }
    
    .contact-container {
        padding: 0;
    }

    .section {
        padding: 60px 0;
    }

    /* Legal Pages Mobile */
    .section--legal {
        padding-top: 100px;
        padding-bottom: 60px;
    }
    
    .legal-text {
        font-size: 0.8rem;
    }

    /* Cookie Banner Mobile */
    .cookie-banner {
        width: auto;
        max-width: none;
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

}
/* --- CUSTOM SELECT DROPDOWN --- */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
}

.custom-select__trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-select__trigger:hover {
    border-color: #d1d5db;
}

.custom-select.open .custom-select__trigger {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.arrow {
    position: relative;
    height: 8px;
    width: 12px;
}

.arrow::before, .arrow::after {
    content: "";
    position: absolute;
    bottom: 0px;
    width: 0.1rem;
    height: 100%;
    transition: all 0.2s;
    background-color: var(--text-muted);
}

.arrow::before {
    left: -3px;
    transform: rotate(-45deg);
}

.arrow::after {
    left: 3px;
    transform: rotate(45deg);
}

.custom-select.open .arrow::before {
    left: -3px;
    transform: rotate(45deg);
}

.custom-select.open .arrow::after {
    left: 3px;
    transform: rotate(-45deg);
}

/* Выпадающий список */
.custom-options {
    position: absolute;
    display: block;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease-in-out;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    z-index: 100;
    margin-top: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.custom-option {
    position: relative;
    display: block;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.custom-option:hover {
    background-color: #f3f4f6;
    color: var(--accent);
}

.custom-option.selected {
    background-color: #eff6ff;
    color: var(--accent);
    font-weight: 500;
}
