/*
 * st-mobi.by design: light, plain, readable. Tokens first (--sm-*), then Bootstrap's own variables pointed at them,
 * then a few components (sm-*) shared by the landing and the account pages. No animations, no pop-ups.
 */

:root {
    --sm-primary: #2563eb;
    --sm-primary-rgb: 37, 99, 235;
    --sm-primary-hover: #1d4ed8;
    --sm-primary-soft: #eef3ff;
    --sm-accent: #0ea5a4;
    --sm-ink: #0f172a;
    --sm-text: #334155;
    --sm-muted: #64748b;
    --sm-border: #e2e8f0;
    --sm-surface: #ffffff;
    --sm-bg: #f8fafc;
    --sm-success: #16a34a;
    --sm-radius: 14px;
    --sm-radius-sm: 10px;
    --sm-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
    --sm-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --bs-body-font-family: var(--sm-font);
    --bs-body-color: var(--sm-text);
    --bs-body-bg: var(--sm-surface);
    --bs-emphasis-color: var(--sm-ink);
    --bs-secondary-color: var(--sm-muted);
    --bs-border-color: var(--sm-border);
    --bs-primary: var(--sm-primary);
    --bs-primary-rgb: var(--sm-primary-rgb);
    --bs-link-color: var(--sm-primary);
    --bs-link-color-rgb: var(--sm-primary-rgb);
    --bs-link-hover-color: var(--sm-primary-hover);
    --bs-border-radius: var(--sm-radius-sm);
    --bs-border-radius-lg: var(--sm-radius);
}

body {
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 {
    color: var(--sm-ink);
    font-weight: 700;
    letter-spacing: -.01em;
}

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: var(--sm-radius-sm);
}

.btn-primary {
    --bs-btn-bg: var(--sm-primary);
    --bs-btn-border-color: var(--sm-primary);
    --bs-btn-hover-bg: var(--sm-primary-hover);
    --bs-btn-hover-border-color: var(--sm-primary-hover);
    --bs-btn-active-bg: var(--sm-primary-hover);
    --bs-btn-active-border-color: var(--sm-primary-hover);
}

.btn-outline-primary {
    --bs-btn-color: var(--sm-primary);
    --bs-btn-border-color: var(--sm-primary);
    --bs-btn-hover-bg: var(--sm-primary);
    --bs-btn-hover-border-color: var(--sm-primary);
    --bs-btn-active-bg: var(--sm-primary-hover);
}

.text-ink { color: var(--sm-ink) !important; }

/* Header and footer (every page). */

.sm-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--sm-border);
}

.sm-header .nav-link {
    color: var(--sm-text);
    font-weight: 500;
}

.sm-header .nav-link:hover,
.sm-header .nav-link.active {
    color: var(--sm-primary);
}

.sm-header .nav-link.active { font-weight: 600; }

/* The user's name on the menu button (UserMenu), cut when long. */
.sm-account-name { max-width: 12rem; }

/* The sections folded into the burger (below lg): full-width rows. */
@media (max-width: 991.98px) {
    .sm-header .navbar-collapse { padding: .5rem 0 .75rem; }
    .sm-header .navbar-nav .nav-link { padding: .65rem .25rem; border-bottom: 1px solid var(--sm-border); }
}

/* A narrow phone: the app button keeps only its icon next to the brand and the burger. */
@media (max-width: 399.98px) {
    .sm-app-text { display: none; }
}

.sm-brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--sm-ink);
    text-decoration: none;
}

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

.sm-brand-mark {
    width: 2rem;
    height: 2rem;
}

.sm-footer {
    margin-top: auto;
    background: var(--sm-bg);
    border-top: 1px solid var(--sm-border);
    color: var(--sm-muted);
    font-size: .925rem;
}

.sm-footer a { color: var(--sm-text); text-decoration: none; }
.sm-footer a:hover { color: var(--sm-primary); }

.sm-footer-title {
    color: var(--sm-ink);
    font-weight: 600;
    margin-bottom: .75rem;
}

/* Sections and cards (the landing; the account pages reuse cards and page headers). */

.sm-section { padding: 5rem 0; }
.sm-section-alt { background: var(--sm-bg); }

.sm-section-header {
    max-width: 44rem;
    margin: 0 auto 3rem;
    text-align: center;
}

.sm-section-header p { color: var(--sm-muted); font-size: 1.1rem; margin: 0; }

.sm-eyebrow {
    display: inline-block;
    padding: .3rem .75rem;
    border-radius: 999px;
    background: var(--sm-primary-soft);
    color: var(--sm-primary);
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.sm-card {
    height: 100%;
    background: var(--sm-surface);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    padding: 1.5rem;
}

.sm-card-raised { box-shadow: var(--sm-shadow); border-color: transparent; }

/* Dashboard: a balance below zero is burgundy (red is for "a day or two left"). */
.sm-balance-negative { color: #7f1d1d; }

/* Dashboard lists: the document number in its own right-aligned column (as 1C prints it, no padding), then the date and
   the amount; the company's facts as label / value. */
.sm-doc-row { display: flex; gap: .75rem; padding: .3rem 0; border-bottom: 1px solid var(--sm-border); font-variant-numeric: tabular-nums; }
.sm-doc-date { color: var(--sm-muted); white-space: nowrap; }
.sm-doc-what { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-doc-sum { white-space: nowrap; }
/* Under "Последние акты" / "Счета ждут оплаты" only the number, right-aligned so 83 and 108 line up; the amount at the end. */
.sm-doc-no { min-width: 4ch; text-align: right; white-space: nowrap; }
.sm-doc-no + .sm-doc-sum { margin-left: auto; }
/* The act's state in podpis.by: an icon in a column of its own, so the amounts stay aligned. */
.sm-doc-edo { width: 1.25rem; text-align: center; }
/* The acts and invoices tables: figures in columns (same width digits), the number column narrow. */
.sm-docs-table { font-variant-numeric: tabular-nums; }
.sm-docs-table th:nth-child(1) { width: 8rem; }
.sm-docs-table th:nth-child(2) { width: 5rem; }
.sm-doc-edo .sm-mark { margin-left: 0; }
.sm-facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .75rem; margin: 0; }
.sm-facts dt { font-weight: 400; color: var(--sm-muted); }
.sm-facts dd { margin: 0; min-width: 0; }

/* State marks: an icon with its words in a tooltip; warnings bright amber, errors red. */
.sm-mark { margin-left: .3rem; cursor: help; }
.sm-mark-ok { color: var(--sm-success); }
.sm-mark-warning { color: #f59e0b; }
.sm-mark-error { color: #dc2626; }
.sm-mark-pending { color: #d97706; }

/* Dashboard: licenses by month, stacked bars without a script. Each column: an area of fixed height with the total on
   top of the bar (its height a share of the largest month), then the month. */
.sm-chart { display: grid; grid-template-columns: repeat(var(--sm-chart-cols), minmax(0, 1fr)); gap: .5rem; }
.sm-chart-col { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.sm-chart-area { height: 11rem; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.sm-chart-total { font-size: .8rem; font-variant-numeric: tabular-nums; margin-bottom: .25rem; }
.sm-chart-bar { width: min(100%, 3rem); display: flex; flex-direction: column-reverse; border-radius: 6px 6px 0 0; overflow: hidden; min-height: 2px; }
.sm-chart-empty { height: 25%; border: 1px dashed var(--sm-border); border-bottom: 0; }
.sm-chart-seg { min-height: 1px; }
.sm-chart-label { font-size: .75rem; color: var(--sm-muted); margin-top: .35rem; border-top: 1px solid var(--sm-border); width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-chart-legend { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; }
.sm-chart-swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; }

.sm-icon {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    background: var(--sm-primary-soft);
    color: var(--sm-primary);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.sm-page-header {
    padding: 2rem 0 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--sm-border);
}

.sm-page-header p { color: var(--sm-muted); margin: .25rem 0 0; }

/* Hero. */

.sm-hero {
    padding: 4.5rem 0 4rem;
    background:
        radial-gradient(60rem 30rem at 85% -10%, var(--sm-primary-soft), transparent 70%),
        var(--sm-surface);
}

.sm-hero h1 {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    line-height: 1.1;
    letter-spacing: -.02em;
}

.sm-hero .lead { color: var(--sm-muted); font-size: 1.2rem; }

.sm-checks {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    color: var(--sm-muted);
    font-size: .95rem;
}

.sm-checks i { color: var(--sm-success); margin-right: .35rem; }

/* The phone in the hero: plain HTML, so no image to keep in step with the app. */

.sm-phone {
    width: 18.5rem;
    max-width: 100%;
    margin: 0 auto;
    padding: .75rem;
    border-radius: 2.25rem;
    background: var(--sm-ink);
    box-shadow: 0 30px 60px rgba(15, 23, 42, .18);
}

.sm-phone-screen {
    border-radius: 1.6rem;
    background: var(--sm-bg);
    padding: 1.25rem 1rem;
    font-size: .85rem;
}

.sm-visit {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .8rem;
    margin-top: .5rem;
    background: var(--sm-surface);
    border: 1px solid var(--sm-border);
    border-radius: 12px;
}

.sm-visit-dot {
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--sm-primary-soft);
    color: var(--sm-primary);
}

.sm-visit-done .sm-visit-dot { background: #dcfce7; color: var(--sm-success); }

/* Steps. */

.sm-step-number {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--sm-primary);
    color: #fff;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Prices. */

.sm-price-card { display: flex; flex-direction: column; }

.sm-price {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--sm-ink);
    line-height: 1;
}

.sm-price small { font-size: .9rem; font-weight: 500; color: var(--sm-muted); }

.sm-feature-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 1.5rem;
    flex: 1;
}

.sm-feature-list li {
    display: flex;
    gap: .5rem;
    padding: .3rem 0;
    font-size: .95rem;
}

.sm-feature-list i { color: var(--sm-success); flex: none; }

.sm-demo-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
    padding: 1.5rem 2rem;
    border-radius: var(--sm-radius);
    background: var(--sm-primary-soft);
    margin-bottom: 2rem;
}

/* Call to action band. */

.sm-cta {
    border-radius: calc(var(--sm-radius) * 1.5);
    background: linear-gradient(135deg, var(--sm-primary), #1e40af);
    color: #fff;
    padding: 3rem;
}

.sm-cta h2 { color: #fff; }
.sm-cta p { color: rgba(255, 255, 255, .85); }

.sm-cta .btn-light { color: var(--sm-primary); }

/* The cookie notice: a thin bar at the bottom, no overlay. */

.sm-cookie-bar {
    position: sticky;
    bottom: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--sm-border);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .06);
}

@media (max-width: 575.98px) {
    .sm-section { padding: 3.5rem 0; }
    .sm-cta { padding: 2rem 1.5rem; }
}

/* The company's page: one row per requisite (label, value, state, action); a row with "change" is a <details> whose
   summary is the row and whose body is the field. */
.sm-requisites .sm-req {
    display: block;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--sm-border);
}

.sm-requisites .sm-req:last-child { border-bottom: 0; }

.sm-requisites .sm-req > summary,
.sm-requisites div.sm-req {
    display: grid;
    grid-template-columns: 12rem 1fr 7rem;
    gap: .25rem 1rem;
    align-items: baseline;
}

.sm-requisites .sm-req > summary { cursor: pointer; list-style: none; }
.sm-requisites .sm-req > summary::-webkit-details-marker { display: none; }

.sm-req-label { color: var(--sm-ink); font-weight: 600; }
.sm-req-value { min-width: 0; overflow-wrap: anywhere; }
.sm-req-value { grid-column: 2; }
.sm-req-action { grid-column: 3; justify-self: end; color: var(--sm-primary); font-size: .9rem; font-weight: 500; }
.sm-req-action-button { background: none; border: 0; padding: 0; }
.sm-req-action-button:hover, .sm-requisites summary:hover .sm-req-action { text-decoration: underline; }
/* Bank accounts: one row each, the group's inner lines without borders. */
.sm-requisites .sm-req.sm-req-group { border-bottom: 0; padding-bottom: .35rem; }
.sm-requisites .sm-req.sm-req-group + .sm-req { padding-top: .35rem; }
.sm-req[open] > summary .sm-req-action { color: var(--sm-muted); }

.sm-req-note, .sm-req-pending { display: block; font-size: .85rem; color: var(--sm-muted); margin-top: .15rem; }
.sm-req-pending, .sm-req-warn { color: #b45309; }
.sm-req-edit { padding: .75rem 0 .25rem 13rem; }
.sm-iban-input { flex: 0 1 auto; width: 38ch; max-width: 100%; }

.sm-account { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; padding: .2rem 0; }
.sm-requisites details > summary.btn { list-style: none; }
.sm-requisites details > summary.btn::-webkit-details-marker { display: none; }
.sm-requisites details > summary.small { cursor: pointer; }

@media (max-width: 767.98px) {
    .sm-requisites .sm-req > summary,
    .sm-requisites div.sm-req { grid-template-columns: 1fr auto; }
    .sm-req-label { grid-column: 1 / -1; font-size: .85rem; color: var(--sm-muted); }
    .sm-req-label:empty { display: none; }
    .sm-req-value { grid-column: 1; }
    .sm-req-action { grid-column: 2; }
    .sm-req-edit { padding-left: 0; }
}

/* Staff's balances: the days a balance lasts, by band (BalanceBands). */
.sm-band { display: inline-block; min-width: 2.5rem; padding: .15rem .5rem; border-radius: 999px; font-weight: 600;
    font-variant-numeric: tabular-nums; text-align: center; color: #fff; }
.sm-band-negative { background: #111827; }
.sm-band-critical { background: #dc2626; }
.sm-band-urgent { background: #f97316; }
.sm-band-soon { background: #eab308; color: #1f2937; }
.sm-band-fine { background: #16a34a; }
.sm-band-plenty { background: #0ea5e9; }
.sm-band-unknown { background: #e2e8f0; color: #475569; }
