:root {
    --lm-primary: #4b5563;
    --lm-secondary: #64748b;
    --lm-surface: #ffffff;
    --lm-background: #f6f7f8;
    --lm-text: #1f2937;
    --lm-muted: #6b7280;
    --lm-line: #e2e5e9;
    --lm-accent: #2f7d4f;
    --lm-warning: #b45309;
    --lm-danger: #b91c1c;
    --lm-danger-surface: #fef2f2;
    --lm-danger-text: #7f1d1d;
    --lm-radius: 16px;
    --lm-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--lm-background);
    color: var(--lm-text);
    font-family: var(--lm-font);
    line-height: 1.55;
}
a { color: inherit; }
img { display: block; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px clamp(18px, 5vw, 64px);
    background: rgba(246, 247, 248, .88);
    border-bottom: 1px solid var(--lm-line);
    backdrop-filter: blur(14px);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -.02em;
    text-decoration: none;
}
.nav {
    display: flex;
    gap: 20px;
    margin-left: auto;
    font-size: .95rem;
}
.nav a { text-decoration: none; color: var(--lm-muted); }
.nav a:hover { color: var(--lm-text); }
.nav-login {
    padding: 8px 16px;
    border: 1px solid var(--lm-line);
    border-radius: 999px;
    color: var(--lm-text) !important;
    background: var(--lm-surface);
}
.lang {
    border: 1px solid var(--lm-line);
    background: var(--lm-surface);
    color: var(--lm-text);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    font: inherit;
}

main {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 0 clamp(18px, 5vw, 64px);
}
.hero { padding: clamp(56px, 10vw, 128px) 0 64px; max-width: 820px; }
.eyebrow {
    margin: 0 0 18px;
    color: var(--lm-accent);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
/* Шкала та же, что в приложении: раньше h1 доходил до 6.4rem, кнопки были пилюлями,
   а поля выше стандарта темы — один продукт выглядел как два разных. */
h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.6rem);
    line-height: 1.08;
    letter-spacing: -.03em;
    font-weight: 700;
}
.lead {
    max-width: 620px;
    margin: 28px 0 0;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    color: var(--lm-muted);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 650;
    transition: transform .15s ease, opacity .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--lm-primary); color: #fff; }
.button.ghost { background: var(--lm-surface); border: 1px solid var(--lm-line); }
.button { border: 0; cursor: pointer; font: inherit; }

/* Одна ширина для форм входа: раньше карточка была 460 px, форма внутри — 440 px,
   а у .auth-form стояло max-width: none. Теперь ширина задаётся карточкой. */
form { max-width: none; }
form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 16px;
    font-size: .9rem;
    font-weight: 600;
}
form input,
form select,
form textarea {
    width: 100%;
    min-height: 44px;
    font-size: 1rem;
    padding: 10px 14px;
    border: 1px solid var(--lm-line);
    border-radius: 12px;
    background: var(--lm-surface);
    color: var(--lm-text);
    font: inherit;
}
form input:focus-visible,
form select:focus-visible,
form textarea:focus-visible,
.button:focus-visible {
    outline: 2px solid var(--lm-primary);
    outline-offset: 2px;
}
form .button { width: 100%; margin-top: 8px; }

.auth-page {
    display: flex;
    justify-content: center;
    padding: clamp(24px, 6vw, 72px) 16px 48px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: clamp(22px, 4vw, 32px);
    background: var(--lm-surface);
    border: 1px solid var(--lm-line);
    border-radius: var(--lm-radius);
    box-shadow: 0 18px 50px rgba(31, 41, 55, .08);
}

.auth-head { margin-bottom: 22px; }
.auth-logo { width: 56px; height: 56px; margin-bottom: 10px; }
.auth-head h1 {
    margin: 6px 0 0;
    font-size: 1.5rem;
    line-height: 1.25;
    letter-spacing: 0;
}
.auth-card .lead { margin-top: 8px; font-size: 1rem; }
.auth-form { max-width: none; }
.auth-card .eta { margin-top: 18px; text-align: center; }

/* Результат входа: раньше разметка выводила .form-result.error, а стилей для этих классов
   не существовало ни в одном CSS — сообщение об ошибке выглядело как обычный текст. */
.form-result {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--lm-line);
    border-left: 3px solid var(--lm-primary);
    border-radius: var(--lm-radius);
    background: var(--lm-background);
    font-size: .9375rem;
    line-height: 1.45;
    color: var(--lm-text);
}

.form-result::before {
    content: "i";
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--lm-primary);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.form-result.error {
    border-left-color: var(--lm-danger);
    background: var(--lm-danger-surface);
    color: var(--lm-danger-text);
}

.form-result.error::before {
    content: "!";
    background: var(--lm-danger);
}

@media (prefers-color-scheme: dark) {
    .form-result {
        border-color: #343434;
        background: #1f1f1f;
        color: #e5e7eb;
    }

    .form-result.error {
        border-left-color: #f87171;
        background: #2a1616;
        color: #fecaca;
    }
}

.profile-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    margin-bottom: 18px;
    border: 1px solid var(--lm-line);
    border-radius: 12px;
    background: var(--lm-background);
}
.profile-summary p { margin: 0; overflow-wrap: anywhere; }
.auth-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 0; }
.auth-actions .button { width: 100%; }

@media (max-width: 480px) {
    .auth-card { border-radius: 14px; }
}
.eta { margin: 20px 0 0; color: var(--lm-muted); font-size: .9rem; }
.eta a { color: var(--lm-text); }

.products { padding: 48px 0 72px; }
.section-head { margin-bottom: 24px; }
h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.03em; }
.section-head p { margin: 8px 0 0; color: var(--lm-muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card {
    display: flex;
    flex-direction: column;
    min-height: 280px;
    padding: 26px;
    background: var(--lm-surface);
    border: 1px solid var(--lm-line);
    border-radius: var(--lm-radius);
}
.card-top { display: flex; align-items: center; justify-content: space-between; }
.icon { font-size: 1.7rem; color: var(--lm-primary); }
.status {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.status.ready { background: #e7f3eb; color: #25633b; }
.status.soon { background: #eef0f3; color: var(--lm-muted); }
.card h3 { margin: 22px 0 8px; font-size: 1.8rem; letter-spacing: -.04em; }
.card p { margin: 0; color: var(--lm-muted); }
.card-link { margin-top: auto; padding-top: 24px; font-weight: 650; text-decoration: none; }
.card-link.muted { color: var(--lm-muted); }

.about {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 40px;
    padding: 56px 0 72px;
    border-top: 1px solid var(--lm-line);
}
.about p { max-width: 560px; color: var(--lm-muted); }
.principles { margin: 0; padding: 0; list-style: none; }
.principles li {
    padding: 13px 0;
    border-bottom: 1px solid var(--lm-line);
    color: var(--lm-muted);
}
.principles li:last-child { border-bottom: 0; }

.site-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    padding: 28px clamp(18px, 5vw, 64px);
    border-top: 1px solid var(--lm-line);
    color: var(--lm-muted);
    font-size: .9rem;
}
.site-footer a { text-decoration: none; }

@media (max-width: 760px) {
    .nav a:not(.nav-login) { display: none; }
    .grid, .about { grid-template-columns: 1fr; }
    .hero { padding-top: 56px; }
    .card { min-height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .button { transition: none; }
}

/* Responsive hardening: no horizontal overflow on narrow screens. */
html, body { max-width: 100%; overflow-x: hidden; }
main { width: 100%; max-width: 1120px; box-sizing: border-box; }
.hero, .actions, .grid, .about, .card, .site-header, .nav { min-width: 0; max-width: 100%; }
.lead, h1, h2, h3, p { overflow-wrap: anywhere; }

@media (max-width: 760px) {
    .site-header { gap: 12px; }
    .nav { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .actions { flex-direction: column; align-items: stretch; }
    .actions .button { width: 100%; }
    .hero h1 { font-size: clamp(1.9rem, 7vw, 2.4rem); }
    .card, .grid { width: 100%; }
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 12px;
    z-index: 2000;
    padding: 10px 14px;
    border-radius: 8px;
    background: #1f2937;
    color: #fff;
    text-decoration: none;
}

.skip-link:focus {
    top: calc(8px + env(safe-area-inset-top));
}

main :is(a, button):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --lm-surface: #1e1e1e;
        --lm-background: #0f0f0f;
        --lm-text: #f1f1f1;
        --lm-muted: #b5b5b5;
        --lm-line: #343434;
        --lm-accent: #8fbf9f;
    }

    .site-header {
        background: rgba(23, 23, 23, .88);
    }

    .auth-card {
        box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
    }

    .profile-summary {
        background: #171717;
    }

    .skip-link {
        background: #f1f1f1;
        color: #111;
    }
}
