:root {
    --brand: #5A63EA;
    --brand-2: #8E5CF7;
    --brand-dark: #454dc4;
    --ink: #23233b;
    --muted: #5b5b70;
    --surface: #ffffff;
    --bg: #f6f6fb;
    --ring: rgba(90, 99, 234, 0.4);
    --shadow-soft: 0 2px 12px rgba(35, 35, 59, 0.06);
    --shadow-lift: 0 12px 32px rgba(35, 35, 59, 0.10);
    --radius: 16px;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--ink);
    background-color: var(--bg);
}

.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
}

.shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---------- Шапка ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(246, 246, 251, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(35, 35, 59, 0.07);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.brand:hover { color: var(--ink); }

.brand-mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: #fff;
    font-weight: 900;
    background-image: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    box-shadow: 0 4px 12px rgba(90, 99, 234, 0.35);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.header-link {
    padding: 0.45rem 0.8rem;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.header-link:hover {
    color: var(--ink);
    background: rgba(90, 99, 234, 0.08);
}

.header-link.active {
    color: var(--brand);
    background: rgba(90, 99, 234, 0.10);
}

.btn-ghost {
    border: none;
    background: none;
    color: var(--muted);
    padding: 0.45rem 0.8rem;
    border-radius: 10px;
    font-weight: 500;
}

.btn-ghost:hover {
    color: var(--ink);
    background: rgba(90, 99, 234, 0.08);
}

/* ---------- Hero ---------- */

.hero {
    padding: 4.5rem 0 3.5rem;
    background:
        radial-gradient(60rem 30rem at 85% -10%, rgba(142, 92, 247, 0.14), transparent 60%),
        radial-gradient(50rem 26rem at 0% 110%, rgba(90, 99, 234, 0.12), transparent 55%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand);
    background: rgba(90, 99, 234, 0.10);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: clamp(2.1rem, 4.5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.12;
}

.grad {
    background-image: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    color: var(--muted);
    font-size: 1.12rem;
    margin: 1.1rem 0 1.75rem;
    max-width: 34rem;
}

.hero-cta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Диалог-мокап */

.chat {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1.4rem;
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--shadow-lift);
}

.bubble {
    max-width: 88%;
    padding: 0.65rem 0.95rem;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.bubble.user {
    align-self: flex-end;
    background-image: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.bubble.alice {
    align-self: flex-start;
    background: #f1f1f8;
    border-bottom-left-radius: 6px;
}

/* ---------- Карусель примеров ---------- */

.section-title {
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: 1.7rem;
    margin-bottom: 1.5rem;
}

.strip { padding: 3rem 0 1rem; }

.carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.25rem 0.25rem 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(90, 99, 234, 0.35) transparent;
}

.slide {
    flex: 0 0 min(320px, 82vw);
    scroll-snap-align: start;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.25rem 1.35rem;
    transition: transform .15s ease, box-shadow .15s ease;
}

.slide:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lift);
}

.slide-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand);
    background: rgba(90, 99, 234, 0.10);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    margin-bottom: 0.7rem;
}

.slide .q { font-weight: 600; margin-bottom: 0.35rem; }
.slide .a { color: var(--muted); margin-bottom: 0; font-size: 0.95rem; }

/* ---------- Фичи и шаги ---------- */

.features { padding: 2.5rem 0; }

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

.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.6rem 1.5rem;
}

.feature-icon { font-size: 1.8rem; margin-bottom: 0.6rem; }

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.feature-card p { color: var(--muted); margin-bottom: 0; font-size: 0.97rem; }

.steps { padding: 1.5rem 0 4rem; }

.step-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 46rem;
}

.step-list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.1rem 1.3rem;
}

.step-num {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    background-image: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}

/* ---------- Подвал ---------- */

.site-footer {
    border-top: 1px solid rgba(35, 35, 59, 0.07);
    padding: 1.4rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--brand); }

/* ---------- Внутренние страницы (кабинет, Identity) ---------- */

.page-pad {
    padding-top: 1.6rem;
    padding-bottom: 3rem;
}

a, .btn-link { color: var(--brand); }
a:hover { color: var(--brand-dark); }

h1 { font-weight: 700; letter-spacing: -0.01em; }

.btn { border-radius: 10px; }

.btn-primary {
    color: #fff;
    background-image: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    border: none;
    box-shadow: 0 4px 14px rgba(90, 99, 234, 0.25);
    transition: transform .06s ease, box-shadow .15s ease;
}

.btn-primary:hover, .btn-primary:focus {
    color: #fff;
    background-image: linear-gradient(135deg, var(--brand-dark) 0%, #7a45e0 100%);
    box-shadow: 0 6px 18px rgba(90, 99, 234, 0.35);
}

.btn-primary:active { transform: translateY(1px); }

.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background-color: var(--brand); border-color: var(--brand); }

.form-control { border-radius: 10px; }
.form-control:focus { border-color: var(--brand); }

.alert-success {
    background-color: #e9fbf2;
    border-color: #b6ecd2;
    color: #12734a;
}

.table {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.table > thead { background-color: #f2f1fb; }

.table > thead th {
    border-bottom: none;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #7a7a90;
}

.lead { color: var(--muted); }

.card { border: none; border-radius: var(--radius); box-shadow: var(--shadow-soft); }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--ring);
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    border-radius: 10px;
    color: white;
}

.blazor-error-boundary::after { content: "Произошла ошибка." }

.darker-border-checkbox.form-check-input { border-color: #929292; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ---------- Вход с Яндексом ---------- */

.btn-yandex {
    color: #fff;
    background: #000;
    border: none;
    font-weight: 600;
}

.btn-yandex:hover, .btn-yandex:focus { color: #fff; background: #222; }

.btn-yandex::before {
    content: "Я";
    display: inline-grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.6rem;
    border-radius: 50%;
    background: #fc3f1d;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    vertical-align: -0.35rem;
}

.or-divider {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.or-divider::before, .or-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid rgba(35, 35, 59, 0.12);
}

/* ---------- Плашка потери соединения ----------
   Скрыта по умолчанию; blazor.web.js сам показывает её инлайн-стилем при ошибке.
   Стили глобальные (не scoped), потому что div есть в обоих лейаутах. */

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
    padding: 0.6rem 2.5rem 0.7rem 1.25rem;
    background: #fff8e6;
    border-top: 1px solid #f0dfae;
    color: var(--ink);
    font-size: 0.95rem;
    box-shadow: 0 -4px 16px rgba(35, 35, 59, 0.08);
}

#blazor-error-ui .reload { color: var(--brand); font-weight: 600; }

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.85rem;
    top: 0.55rem;
}

/* ---------- Адаптив ---------- */

@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
    .feature-grid { grid-template-columns: 1fr; }
    .hero { padding-top: 2.5rem; }
    .header-link { padding: 0.4rem 0.55rem; }
}
