/* Общие стили */
:root {
    --accent: #FFC700;
    --accent-dark: #e0a800;
    --ink: #14171f;
    --ink-soft: #4b4f5a;
    --dark: #2f3640;
    --dark-soft: #3d4450;
    --paper: #f7f8fb;
    --border: #e6e8ef;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; }

button { cursor: pointer; border: none; font-family: inherit; }

h1, h2, h3 { line-height: 1.15; }

code {
    background: #eef0f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 50px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 20;
}

.logo {
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.02em;
}

.logo span { color: var(--accent-dark); }

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Казахские пункты меню длиннее русских ("Как это работает" → "Бұл қалай
       жұмыс істейді"): переносим меню целиком, а не рвём отдельные пункты по
       словам на три строки. */
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav a:not(.btn) {
    margin: 0 12px;
    font-weight: 500;
    color: var(--ink-soft);
    white-space: nowrap;
}

.nav a:not(.btn):hover { color: var(--ink); }

.user-menu {
    margin: 0 10px;
    font-weight: 600;
    color: var(--ink-soft);
}

.inline-form { display: inline; margin: 0; }

/* Переключатель языка (main/base.html). Это форма с двумя кнопками-сабмитами,
   а не ссылки, — выбор сохраняется в сессии через set_language. */
.lang-switch {
    display: inline-flex;
    margin: 0 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.lang-option {
    padding: 7px 11px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.lang-option:hover { color: var(--ink); background: rgba(0,0,0,0.04); }

.lang-option.is-active {
    background: var(--accent-dark);
    color: #fff;
    cursor: default;
}

.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
    /* Казахские подписи длиннее русских ("Подключить терминал" →
       "Терминалды қосу", "Оставить заявку" → "Өтінім қалдыру"), поэтому
       кнопка тянется по содержимому и не режет текст. */
    text-align: center;
    overflow-wrap: break-word;
}

.btn-start {
    background-color: var(--accent);
    color: var(--ink);
}

.btn-start:hover { background-color: var(--accent-dark); }

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--paper); }

.btn-lg { padding: 14px 30px; font-size: 15px; }

/* Hero */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    padding: 90px 50px;
    max-width: 1280px;
    margin: 0 auto;
}

.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-dark);
    margin-bottom: 14px;
}

.hero-text { max-width: 560px; }

.hero-text h1 {
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
}

.hero-text p {
    font-size: 18px;
    color: var(--ink-soft);
    margin-bottom: 30px;
}

.hero-text .btn { margin-right: 10px; margin-bottom: 10px; }

.hero-stats {
    display: flex;
    gap: 36px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.hero-stat { display: flex; flex-direction: column; }

.hero-stat strong { font-size: 28px; font-weight: 800; }

.hero-stat span { font-size: 13px; color: var(--ink-soft); }

.hero-stats-note {
    margin-top: 14px;
    font-size: 14px;
    color: var(--ink-soft);
    font-style: italic;
}

/* Hero graphic */
.hero-graphic {
    position: relative;
    flex-shrink: 0;
    width: 380px;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terminal-mock {
    width: 190px;
    height: 320px;
    background: linear-gradient(160deg, var(--dark), var(--dark-soft));
    border-radius: 22px;
    box-shadow: 0 30px 60px rgba(20, 23, 31, 0.25);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.terminal-mock-screen {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.terminal-mock-line {
    height: 8px;
    border-radius: 4px;
    background: #e6e8ef;
    width: 100%;
}

.terminal-mock-line.short { width: 60%; }

.terminal-mock-dot {
    margin-top: auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
}

.terminal-mock-slot {
    height: 14px;
    border-radius: 7px;
    background: rgba(255,255,255,0.15);
}

.floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(20,23,31,0.12);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.floating-card svg { width: 18px; height: 18px; fill: var(--accent-dark); }

.floating-card-1 { top: 10px; right: -10px; }
.floating-card-2 { bottom: 30px; left: -30px; }

/* Sections */
.section {
    padding: 80px 50px;
    max-width: 1280px;
    margin: 0 auto;
}

.section-dark {
    max-width: none;
    background: var(--dark);
    color: #fff;
    padding: 80px 50px;
}

.section-dark .eyebrow { color: var(--accent); }

.section-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 48px;
}

.section-head h2 {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    /* Казахские заголовки заметно длиннее русских — не даём длинному слову
       вылезти за карточку, лучше перенос. Тот же приём в .btn и .hero-stat. */
    overflow-wrap: break-word;
}

.section-head .section-sub {
    margin: 14px 0 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-soft);
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.step-card {
    background: var(--paper);
    border-radius: var(--radius);
    padding: 32px 26px;
    border: 1px solid var(--border);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--accent);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.step-card h3 { margin: 0 0 10px; font-size: 18px; }

.step-card p { margin: 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; }

/* Benefits */
.benefit-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
}

.benefit-card {
    background: var(--dark-soft);
    border-radius: var(--radius);
    padding: 28px 22px;
}

.benefit-card svg { width: 30px; height: 30px; fill: var(--accent); margin-bottom: 16px; }

.benefit-card h3 { margin: 0 0 10px; font-size: 16px; }

.benefit-card p { margin: 0; color: #c7cad1; font-size: 14px; line-height: 1.55; }

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.pricing-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 26px;
    display: flex;
    flex-direction: column;
}

.pricing-card-featured {
    border-color: var(--ink);
    box-shadow: 0 20px 40px rgba(20,23,31,0.12);
    transform: translateY(-8px);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    right: 24px;
    background: var(--accent);
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
}

.pricing-card h3 { margin: 0 0 8px; font-size: 20px; }

.pricing-desc { color: var(--ink-soft); font-size: 14px; margin: 0 0 20px; }

.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 26px;
    flex: 1;
}

.pricing-card li {
    padding: 8px 0 8px 24px;
    position: relative;
    font-size: 14px;
    color: var(--ink-soft);
    border-top: 1px solid var(--border);
}

.pricing-card li:first-child { border-top: none; }

.pricing-card li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-dark);
}

.pricing-card .btn { text-align: center; }

/* CTA */
.cta-section {
    text-align: center;
    background: var(--paper);
    border-radius: var(--radius);
    max-width: 1280px;
    padding: 70px 40px;
    margin-bottom: 80px;
}

.cta-section h2 { font-size: 30px; margin: 0 0 12px; }

.cta-section p { color: var(--ink-soft); margin: 0 0 28px; }

.contact-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 24px;
    min-width: 160px;
}

.contact-label { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }

.contact-item a { font-weight: 600; color: var(--ink); text-decoration: none; }

.contact-item a:hover { color: var(--accent-dark); }

.contact-todo { color: var(--ink-soft); }

/* Footer */
.site-footer {
    background: var(--ink);
    color: #c7cad1;
    padding: 50px 50px 20px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    max-width: 1280px;
    margin: 0 auto 30px;
    flex-wrap: wrap;
}

.footer-brand { max-width: 380px; }

.footer-brand p { font-size: 13.5px; line-height: 1.6; margin-top: 12px; }

.footer-links { display: flex; flex-direction: column; gap: 10px; }

.footer-links a { font-size: 14px; }

.footer-links a:hover { color: #fff; }

.footer-bottom {
    text-align: center;
    font-size: 12.5px;
    color: #7d818c;
    border-top: 1px solid #3a3f4a;
    padding-top: 18px;
    max-width: 1280px;
    margin: 0 auto;
}

/* Формы (вход/регистрация) */
.auth-wrap {
    display: flex;
    flex: 1;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 20px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.auth-card h1 {
    font-size: 24px;
    margin: 0 0 20px;
}

.auth-card .field {
    margin-bottom: 16px;
}

.auth-card label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

.auth-card input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.auth-card .errorlist {
    color: #c0392b;
    font-size: 13px;
    margin: 0 0 8px;
    padding-left: 18px;
}

.auth-card .helptext {
    font-size: 12px;
    color: #888;
}

.auth-card .btn-start {
    width: 100%;
    text-align: center;
    margin-top: 8px;
}

.auth-card .auth-note {
    margin-top: 18px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.auth-card .switch {
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
}

.auth-card .switch a {
    font-weight: 600;
    color: #b8860b;
}

/* Печать файлов (клиентская страница терминала) */
.print-page {
    display: flex;
    justify-content: center;
    padding: 50px 20px 90px;
}

.print-card {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 1px 3px rgba(20,23,31,0.04);
}

.print-head { margin-bottom: 22px; }

.print-head h1 { font-size: 26px; margin: 0 0 8px; }

.print-sub { margin: 0; color: var(--ink-soft); font-size: 14px; }

.print-terminal-pill {
    display: inline-block;
    margin: 0;
    background: var(--paper);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 34px 20px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.15s;
}

.dropzone:hover, .dropzone-active {
    border-color: var(--accent-dark);
    background: #fffaf0;
}

.dropzone-icon { width: 34px; height: 34px; fill: var(--accent-dark); }

.dropzone p { margin: 4px 0 0; font-size: 14.5px; }

.dropzone-hint { font-size: 12px; color: var(--ink-soft); }

.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--paper);
    border-radius: 8px;
    padding: 10px 12px;
}

.file-row-icon { width: 20px; height: 20px; fill: var(--ink-soft); flex-shrink: 0; }

.file-row-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.file-row-name {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-row-size { font-size: 11.5px; color: var(--ink-soft); }

.file-row-remove {
    background: none;
    color: var(--ink-soft);
    font-size: 18px;
    line-height: 1;
    padding: 4px;
}

.file-row-remove:hover { color: #c0392b; }

.print-options { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }

.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
}

.segmented {
    display: flex;
    background: var(--paper);
    border-radius: 8px;
    padding: 3px;
}

.segmented-btn {
    background: none;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

.segmented-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,23,31,0.12); }

.stepper {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--paper);
    border-radius: 8px;
    padding: 4px 6px;
}

.stepper button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(20,23,31,0.12);
}

.stepper span { min-width: 16px; text-align: center; font-weight: 700; }

.print-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--ink-soft);
}

.print-total strong { font-size: 18px; color: var(--ink); }

.print-submit { width: 100%; text-align: center; margin-top: 18px; }

.print-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.print-card-done .dropzone,
.print-card-done .file-list,
.print-card-done .print-options,
.print-card-done .print-total,
.print-card-done .print-submit,
.print-card-done .print-error {
    display: none;
}

.print-error {
    color: #c0392b;
    font-size: 13px;
    margin: 12px 0 0;
    text-align: center;
}

.print-success { text-align: center; padding: 20px 0; }

.print-success-icon {
    width: 52px;
    height: 52px;
    fill: #1a9e5c;
    background: #e3f9ec;
    border-radius: 50%;
    padding: 12px;
    margin-bottom: 14px;
}

.print-success h2 { margin: 0 0 8px; font-size: 20px; }

.print-success p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* Responsive */
@media (max-width: 900px) {
    .header { padding: 16px 20px; flex-wrap: wrap; gap: 10px; }
    .nav { flex-wrap: wrap; justify-content: center; }
    .nav a:not(.btn) { margin: 0 8px; }

    .hero { flex-direction: column; padding: 50px 20px; text-align: center; }
    .hero-text { max-width: 100%; }
    .hero-text h1 { font-size: 34px; }
    .hero-stats { justify-content: center; flex-wrap: wrap; }
    .hero-graphic { width: 100%; height: 260px; }
    .floating-card { display: none; }

    .section, .section-dark { padding: 50px 20px; }
    .steps, .benefit-grid, .pricing-grid { grid-template-columns: 1fr; }
    .pricing-card-featured { transform: none; }

    .footer-inner { flex-direction: column; }
}
