/* BusinessPilot KZ · дизайн-система «Navy & Gold» */

:root {
    --bp-navy: #1B2A4A;
    --bp-navy-dark: #12203A;
    --bp-navy-deep: #0F1A30;
    --bp-gold: #C9A227;
    --bp-gold-dark: #A8861B;
    --bp-gold-light: #E4C45A;
    --bp-emerald: #128C63;
    --bp-radius: 12px;
    --bp-radius-sm: 8px;
    --bp-shadow-card: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
    --bp-shadow-hover: 0 6px 18px rgba(16, 24, 40, .10);
    --bp-nav-active: rgba(201, 162, 39, .14);
    --bp-nav-hover: rgba(255, 255, 255, .06);
}

html, body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1:focus { outline: none; }

*:focus-visible {
    outline: 2px solid var(--bp-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Оболочка ---------- */

.bp-appbar {
    border-bottom: 1px solid var(--mud-palette-lines-default);
    backdrop-filter: saturate(160%) blur(8px);
}

.bp-appbar .mud-toolbar { gap: 4px; }

.bp-drawer {
    border-right: 0;
    background: linear-gradient(180deg, var(--bp-navy-deep) 0%, #0B1428 100%);
}

.bp-drawer .mud-drawer-content { display: flex; flex-direction: column; }

.bp-brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 14px;
    color: #FFFFFF;
}

.bp-brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    line-height: 1.1;
    white-space: nowrap;
}

.bp-brand-name span { color: var(--bp-gold-light); }

.bp-brand-tagline {
    font-size: 0.7rem;
    color: #8B9BB8;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bp-business-card {
    margin: 4px 12px 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #E6EAF3;
}

.bp-business-card-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8B9BB8;
}

.bp-business-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bp-nav { padding: 6px 12px 16px; flex: 1; }

.bp-nav-group {
    display: block;
    padding: 16px 12px 6px;
    color: #6F7F9C;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.bp-nav .mud-nav-link {
    border-radius: 10px;
    padding: 9px 12px;
    margin-bottom: 2px;
    color: #C9D2E3;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background .15s ease, color .15s ease;
    position: relative;
}

.bp-nav .mud-nav-link .mud-nav-link-icon { color: #8B9BB8; margin-right: 12px; }

.bp-nav .mud-nav-link:hover { background: var(--bp-nav-hover); color: #FFFFFF; }

.bp-nav .mud-nav-link.active,
.bp-nav .mud-nav-link.active .mud-nav-link-text,
.bp-nav .mud-nav-link.active:hover {
    background: var(--bp-nav-active);
    color: #FFFFFF !important;
    font-weight: 600;
}

.bp-nav .mud-nav-link.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--bp-gold);
}

.bp-nav .mud-nav-link.active .mud-nav-link-icon { color: var(--bp-gold-light) !important; }

.bp-nav .mud-nav-link.mud-nav-link-disabled { opacity: .45; }

.bp-nav-footer {
    padding: 12px 20px 16px;
    color: #6F7F9C;
    font-size: 0.72rem;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.bp-main { min-height: 100vh; background: var(--mud-palette-background); }

.bp-content { max-width: 1440px; }

.bp-business-switch { max-width: 280px; border-radius: 999px; padding: 4px 10px 4px 6px; }

.bp-business-switch .mud-button-label { gap: 8px; }

.bp-business-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.bp-ai-button { border-radius: 999px; }

.bp-menu-button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 16px;
    border: 0;
    background: transparent;
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.bp-menu-button:hover { background: var(--mud-palette-action-default-hover); }

.bp-menu-button-current { font-weight: 600; }

.bp-menu-button-text { display: flex; flex-direction: column; line-height: 1.25; }

.bp-menu-button-caption { font-size: 0.75rem; color: var(--mud-palette-text-secondary); font-weight: 400; }

/* ---------- Заголовок страницы ---------- */

.bp-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 24px;
}

.bp-page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bp-gold-dark);
    margin-bottom: 6px;
}

.bp-page-title { margin: 0; }

.bp-page-subtitle { color: var(--mud-palette-text-secondary); max-width: 760px; margin-top: 4px; }

.bp-page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Карточки и панели ---------- */

.bp-card {
    border-radius: var(--bp-radius) !important;
    border: 1px solid var(--mud-palette-lines-default) !important;
    box-shadow: var(--bp-shadow-card) !important;
    background: var(--mud-palette-surface);
    transition: box-shadow .2s ease, transform .2s ease;
}

.bp-card-hover:hover { box-shadow: var(--bp-shadow-hover) !important; transform: translateY(-1px); }

.bp-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.bp-card-title .mud-icon-root { color: var(--bp-gold-dark); }

.bp-hero {
    background:
        radial-gradient(900px 300px at 100% 0%, rgba(201, 162, 39, .14), transparent 60%),
        linear-gradient(135deg, var(--bp-navy) 0%, var(--bp-navy-dark) 100%);
    color: #FFFFFF;
    border: 0 !important;
}

.bp-hero .mud-typography { color: inherit; }

.bp-hero .mud-text-secondary, .bp-hero .bp-muted { color: #B8C4DC !important; }

/* KPI */

.bp-stat {
    position: relative;
    overflow: hidden;
    padding: 18px 20px;
    height: 100%;
}

.bp-stat::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: var(--bp-stat-accent, var(--mud-palette-primary));
    opacity: .9;
}

.bp-stat-label {
    padding-right: 48px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.bp-stat-value {
    font-size: clamp(1.15rem, 1.5vw, 1.55rem);
    white-space: nowrap;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

.bp-stat-hint { font-size: 0.8rem; color: var(--mud-palette-text-secondary); margin-top: 4px; }

.bp-stat-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--bp-stat-accent, var(--bp-navy)) 12%, transparent);
    color: var(--bp-stat-accent, var(--bp-navy));
}

.bp-stat-navy { --bp-stat-accent: var(--mud-palette-primary); }
.bp-stat-gold { --bp-stat-accent: var(--bp-gold); }
.bp-stat-emerald { --bp-stat-accent: var(--bp-emerald); }
.bp-stat-error { --bp-stat-accent: #C63D3D; }
.bp-stat-info { --bp-stat-accent: #2F6FB5; }

/* Пустое состояние */

.bp-empty {
    text-align: center;
    padding: 40px 24px;
    color: var(--mud-palette-text-secondary);
}

.bp-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
    color: var(--mud-palette-primary);
}

/* Быстрые действия */

.bp-quick {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--bp-radius);
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    color: inherit;
    text-decoration: none;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.bp-quick:hover { box-shadow: var(--bp-shadow-hover); transform: translateY(-1px); border-color: var(--bp-gold); }

.bp-quick-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
    color: var(--mud-palette-primary);
    flex: 0 0 auto;
}

.bp-quick-text { display: flex; flex-direction: column; line-height: 1.25; }

.bp-quick-text b { font-size: 0.9rem; }

.bp-quick-text span { font-size: 0.78rem; color: var(--mud-palette-text-secondary); }

/* Чек-лист шагов */

.bp-steps { display: flex; flex-direction: column; gap: 6px; }

.bp-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    transition: background .15s ease;
}

.bp-step:hover { background: var(--mud-palette-background); }

.bp-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
    color: var(--mud-palette-primary);
    flex: 0 0 auto;
}

.bp-step-done .bp-step-num { background: var(--bp-emerald); color: #FFFFFF; }

.bp-step-done .bp-step-title { color: var(--mud-palette-text-secondary); text-decoration: line-through; }

.bp-step-title { font-weight: 500; font-size: 0.9rem; }

.bp-step-hint { font-size: 0.78rem; color: var(--mud-palette-text-secondary); }

/* ---------- Кнопки, поля, таблицы, чипы ---------- */

.mud-button-root { border-radius: 10px; text-transform: none; letter-spacing: 0.01em; }

.mud-button-filled { box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }

.mud-button-filled.mud-button-filled-primary:hover { box-shadow: 0 4px 12px rgba(27, 42, 74, .28); }

.bp-btn-gold.mud-button-filled {
    background: linear-gradient(135deg, var(--bp-gold-light), var(--bp-gold)) !important;
    color: #1B1B1B !important;
}

.bp-btn-gold.mud-button-filled:hover { box-shadow: 0 4px 14px rgba(201, 162, 39, .40); }

.mud-input.mud-input-outlined .mud-input-outlined-border { border-radius: 10px; }

.mud-input-control .mud-input-label { font-weight: 500; }

.mud-table { border-radius: var(--bp-radius); }

.mud-table-root .mud-table-head .mud-table-cell {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-table-striped);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.mud-table-root .mud-table-cell { padding: 10px 16px; }

.mud-table-root .mud-table-body .mud-table-row { transition: background .12s ease; }

.mud-chip { font-weight: 600; border-radius: 999px; }

.mud-chip.mud-chip-text { background: color-mix(in srgb, currentColor 12%, transparent); }

.mud-alert { border-radius: 10px; }

.mud-list-item { border-radius: 8px; }

.cursor-pointer { cursor: pointer; }

.bp-num { font-variant-numeric: tabular-nums; }

.bp-money { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.bp-muted { color: var(--mud-palette-text-secondary); }

/* ---------- Помощник ---------- */

.bp-msg { max-width: 85%; padding: 12px 16px; border-radius: 16px; margin-bottom: 12px; }

.bp-msg-user {
    margin-left: auto;
    background: var(--bp-navy);
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

.bp-msg-user .mud-typography { color: inherit; }

.bp-msg-bot {
    margin-right: auto;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-bottom-left-radius: 4px;
    box-shadow: var(--bp-shadow-card);
}

.bp-markdown p { margin: 0 0 8px; }
.bp-markdown ul, .bp-markdown ol { margin: 0 0 8px; padding-left: 22px; }
.bp-markdown li { margin-bottom: 4px; }
.bp-markdown p:last-child { margin-bottom: 0; }
.bp-markdown strong { font-weight: 650; }
/* Таблицы в ответе помощника: расчёты и сравнения. На узком экране таблица прокручивается сама, страница — нет. */
.bp-markdown table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 4px 0 10px; font-size: 0.875rem; }
.bp-markdown th, .bp-markdown td { border: 1px solid var(--mud-palette-lines-default); padding: 4px 8px; text-align: left; vertical-align: top; }
.bp-markdown th { background: var(--mud-palette-background-gray); font-weight: 600; }

.bp-file-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ---------- Страницы входа и регистрации ---------- */

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
    min-height: 100vh;
    background: #F4F6FA;
    color: #172033;
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    background:
        radial-gradient(800px 400px at 0% 100%, rgba(201, 162, 39, .18), transparent 60%),
        linear-gradient(160deg, #1B2A4A 0%, #12203A 55%, #0B1428 100%);
    color: #FFFFFF;
    overflow: hidden;
}

.auth-brand::after {
    content: "";
    position: absolute;
    right: -120px;
    top: -120px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .08);
}

.auth-brand-logo { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: 600; }

.auth-brand-logo b { color: var(--bp-gold-light); }

.auth-brand-title { font-size: 2.1rem; font-weight: 700; line-height: 1.15; margin: 0 0 16px; max-width: 520px; letter-spacing: -0.02em; }

.auth-brand-text { font-size: 1.05rem; line-height: 1.55; color: #C9D2E3; max-width: 520px; margin: 0 0 28px; }

.auth-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 520px; }

.auth-features li { display: flex; align-items: flex-start; gap: 12px; line-height: 1.4; color: #E6EAF3; }

.auth-feature-icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bp-gold);
    color: #1B1B1B;
    font-weight: 700;
    font-size: 0.8rem;
}

.auth-footer { color: #8B9BB8; font-size: 0.9rem; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #FFFFFF;
    border: 1px solid #E3E8F0;
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .06);
}

.auth-mobile-logo { display: none; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 20px; }

.auth-card-title { font-size: 1.6rem; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.015em; }

.auth-card-subtitle { color: #5D6B82; margin: 0 0 24px; }

.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.auth-label { font-size: 0.875rem; font-weight: 600; }

.auth-input {
    font: inherit;
    padding: 12px 14px;
    border: 1px solid #CBD3E0;
    border-radius: 10px;
    background: #FFFFFF;
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}

.auth-input:focus { outline: none; border-color: #1B2A4A; box-shadow: 0 0 0 3px rgba(27, 42, 74, .16); }

.auth-hint { font-size: 0.8rem; color: #5D6B82; }

.auth-check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 20px; font-size: 0.92rem; line-height: 1.4; cursor: pointer; }

.auth-check input { margin-top: 3px; accent-color: #1B2A4A; }

.auth-submit {
    display: block;
    width: 100%;
    padding: 13px 16px;
    border: 0;
    border-radius: 10px;
    background: #1B2A4A;
    color: #FFFFFF;
    font: inherit;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}

.auth-submit:hover { background: #12203A; box-shadow: 0 6px 16px rgba(27, 42, 74, .28); }

.auth-alt { margin: 20px 0 0; text-align: center; color: #5D6B82; font-size: 0.92rem; }

.auth-alt a { color: #1B2A4A; font-weight: 600; text-decoration: none; }

.validation-message { color: #C63D3D; font-size: 0.8rem; }

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

@media (max-width: 960px) {
    .bp-brand-title { display: none; }
    .bp-business-switch { max-width: 170px; }
    .bp-stat-value { font-size: 1.3rem; }
}

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-mobile-logo { display: flex; }
    .auth-panel { align-items: flex-start; padding: 24px 16px; }
    .auth-card { padding: 28px 22px; }
}

/* Непрочитанное уведомление */
.bp-unread { background: color-mix(in srgb, var(--mud-palette-primary) 6%, transparent); }

/* ---------- Способ составления договора ---------- */

.bp-source-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.bp-source {
    display: flex; gap: 10px; align-items: flex-start; text-align: left; cursor: pointer;
    padding: 12px; border-radius: var(--bp-radius-sm); background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default); color: var(--mud-palette-text-primary); font: inherit;
    transition: border-color .15s ease, background .15s ease;
}
.bp-source:hover:not(:disabled) { border-color: var(--mud-palette-primary); }
.bp-source:focus-visible { outline: 2px solid var(--bp-gold); outline-offset: 2px; }
.bp-source--active { border-color: var(--mud-palette-primary); background: color-mix(in srgb, var(--mud-palette-primary) 7%, transparent); box-shadow: inset 0 0 0 1px var(--mud-palette-primary); }
.bp-source:disabled { cursor: not-allowed; opacity: .55; }
.bp-source-icon { color: var(--mud-palette-primary); margin-top: 2px; }
.bp-source-body { display: flex; flex-direction: column; gap: 4px; }
.bp-source-title { font-weight: 600; font-size: .9rem; }
.bp-source-time { font-weight: 400; font-size: .75rem; color: var(--mud-palette-text-secondary); margin-left: 4px; }
.bp-source-text { font-size: .8rem; line-height: 1.35; color: var(--mud-palette-text-secondary); }

/* Подсказки: нумерованные шаги */
.bp-steps { margin: 0; padding-left: 1.2rem; }
.bp-steps li { margin-bottom: 6px; font-size: .875rem; line-height: 1.45; }
.bp-steps li b { font-weight: 600; }

/* Готовность данных к договору */
.bp-ready { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; font-size: .875rem; }
