/*
 * The look of the whole site, the same as the Android app: white surfaces on
 * a cool light grey, one deep navy, almost square corners, thin borders
 * instead of shadows, figures of one width for amounts.
 *
 * Bootstrap comes from its CDN; here its variables are set to our tokens, so
 * the pages keep their markup. The public pages (layout/public.html.twig) add
 * the classes further down, under "Public pages".
 */

/* Inter, from our own server: no request to a third party. Cyrillic-ext holds the Kyrgyz ң, ө, ү. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter-cyr-ext-tju-6Gg.woff2") format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter-cyr-W5Wngc2.woff2") format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter-latin-ext-KweUqRv.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter-latin-XNcuA7u.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Our tokens */
    --nv-primary: #1e3a8a;
    --nv-primary-hover: #172e6e;
    --nv-primary-soft: #e8ecfa;
    --nv-accent: #384ecd;
    --nv-bg: #f9f9fc;
    --nv-surface: #ffffff;
    --nv-surface-low: #f3f4f7;
    --nv-border: #d8dce2;
    --nv-divider: #e9ecef;
    --nv-text: #1a1c1e;
    --nv-text-2: #43474e;
    --nv-text-3: #6b6f77;
    --nv-expense: #c93b3b;
    --nv-income: #1e8e5a;
    --nv-error: #ba1a1a;
    --nv-radius: 2px;
    --nv-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* Bootstrap, set to them */
    --bs-body-font-family: var(--nv-font);
    --bs-body-bg: var(--nv-bg);
    --bs-body-bg-rgb: 249, 249, 252;
    --bs-body-color: var(--nv-text);
    --bs-body-color-rgb: 26, 28, 30;
    --bs-emphasis-color: var(--nv-text);
    --bs-secondary-color: var(--nv-text-3);
    --bs-tertiary-bg: var(--nv-surface-low);
    --bs-primary: var(--nv-primary);
    --bs-primary-rgb: 30, 58, 138;
    --bs-primary-text-emphasis: var(--nv-primary);
    --bs-primary-bg-subtle: var(--nv-primary-soft);
    --bs-primary-border-subtle: #c3cdf0;
    --bs-success: var(--nv-income);
    --bs-success-rgb: 30, 142, 90;
    --bs-danger: var(--nv-error);
    --bs-danger-rgb: 186, 26, 26;
    --bs-light: var(--nv-surface-low);
    --bs-light-rgb: 243, 244, 247;
    --bs-dark: var(--nv-text);
    --bs-dark-rgb: 26, 28, 30;
    --bs-link-color: var(--nv-primary);
    --bs-link-color-rgb: 30, 58, 138;
    --bs-link-hover-color: var(--nv-accent);
    --bs-link-hover-color-rgb: 56, 78, 205;
    --bs-border-color: var(--nv-border);
    --bs-border-color-translucent: var(--nv-border);
    --bs-border-radius: var(--nv-radius);
    --bs-border-radius-sm: var(--nv-radius);
    --bs-border-radius-lg: var(--nv-radius);
    --bs-border-radius-xl: var(--nv-radius);
    --bs-border-radius-xxl: var(--nv-radius);
    --bs-box-shadow-sm: none;
    --bs-focus-ring-color: rgba(30, 58, 138, .25);
    --bs-code-color: var(--nv-text-2);
}

/* The page is grey; what lies on it is white. Bootstrap paints these with the
   page's own colour, so they are set apart one by one. */
.card { --bs-card-bg: var(--nv-surface); }
.list-group { --bs-list-group-bg: var(--nv-surface); }
.dropdown-menu { --bs-dropdown-bg: var(--nv-surface); }
.modal { --bs-modal-bg: var(--nv-surface); }
.offcanvas { --bs-offcanvas-bg: var(--nv-surface); }
.popover { --bs-popover-bg: var(--nv-surface); }
.toast { --bs-toast-bg: var(--nv-surface); }
.accordion { --bs-accordion-bg: var(--nv-surface); }
.form-control, .form-select, .input-group-text { background-color: var(--nv-surface); }
.form-control:disabled, .form-select:disabled { background-color: var(--nv-surface-low); }
.form-check-input:not(:checked) { background-color: var(--nv-surface); }
.page-link { --bs-pagination-bg: var(--nv-surface); }
.pagination { --bs-pagination-bg: var(--nv-surface); --bs-pagination-active-bg: var(--nv-primary); --bs-pagination-active-border-color: var(--nv-primary); --bs-pagination-color: var(--nv-primary); }
.table { --bs-table-bg: var(--nv-surface); }
.bg-body { background-color: var(--nv-surface) !important; }

.transaction-filter-summary li {
    max-inline-size: 100%;
    padding: .25rem .5rem;
    border: 1px solid var(--nv-border);
    border-radius: var(--bs-border-radius);
    background: var(--nv-surface);
    color: var(--nv-text-2);
    font-size: .8125rem;
    overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
    .transaction-filters.offcanvas-bottom {
        --bs-offcanvas-bg: var(--nv-surface);
        --bs-offcanvas-height: auto;
        /* Keep the form actions above the fixed cookie notice (1080). */
        --bs-offcanvas-zindex: 1090;
        max-height: 90vh;
        max-height: 90dvh;
    }

    .transaction-filter-fields > div {
        min-width: 0;
    }

    .transaction-filter-fields :is(.form-select, .form-control) {
        min-width: 0;
        min-height: 44px;
        font-size: 1rem;
    }

    .transaction-filter-actions {
        padding: .75rem 1rem max(.75rem, env(safe-area-inset-bottom));
    }

    :is(.transaction-filter-actions, .transaction-filter-bar) .btn {
        min-height: 44px;
    }
}

@media (min-width: 375px) and (max-width: 991.98px) {
    .transaction-filter-date {
        width: 50%;
    }
}

body {
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'cv11' 1;
}

h1, h2, h3, .h1, .h2, .h3 { letter-spacing: -0.015em; font-weight: 650; }

/* Amounts and other columns of figures line up. */
.table, .num, .amount, .display-6, .h1, .h2, .h3 { font-variant-numeric: tabular-nums; }
.amount-expense { color: var(--nv-expense); }
.amount-income { color: var(--nv-income); }

/* Buttons: flat navy, a thin outline, no shadow. */
.btn { --bs-btn-font-weight: 500; --bs-btn-border-radius: var(--nv-radius); --bs-btn-box-shadow: none; }
.btn-primary, .btn-dark {
    --bs-btn-bg: var(--nv-primary);
    --bs-btn-border-color: var(--nv-primary);
    --bs-btn-hover-bg: var(--nv-primary-hover);
    --bs-btn-hover-border-color: var(--nv-primary-hover);
    --bs-btn-active-bg: var(--nv-primary-hover);
    --bs-btn-active-border-color: var(--nv-primary-hover);
    --bs-btn-disabled-bg: var(--nv-primary);
    --bs-btn-disabled-border-color: var(--nv-primary);
}
.btn-outline-primary, .btn-outline-dark {
    --bs-btn-color: var(--nv-primary);
    --bs-btn-border-color: var(--nv-primary);
    --bs-btn-hover-bg: var(--nv-primary);
    --bs-btn-hover-border-color: var(--nv-primary);
    --bs-btn-active-bg: var(--nv-primary-hover);
    --bs-btn-active-border-color: var(--nv-primary-hover);
}
.btn-outline-secondary {
    --bs-btn-color: var(--nv-text-2);
    --bs-btn-border-color: var(--nv-border);
    --bs-btn-hover-color: var(--nv-text);
    --bs-btn-hover-bg: var(--nv-surface-low);
    --bs-btn-hover-border-color: var(--nv-border);
    --bs-btn-active-color: var(--nv-text);
    --bs-btn-active-bg: var(--nv-divider);
    --bs-btn-active-border-color: var(--nv-border);
}
.btn-success { --bs-btn-bg: var(--nv-income); --bs-btn-border-color: var(--nv-income); --bs-btn-hover-bg: #187449; --bs-btn-hover-border-color: #187449; }

/* Cards are white panels with a hairline, not floating tiles. */
.card { --bs-card-border-color: var(--nv-border); --bs-card-cap-bg: var(--nv-surface-low); box-shadow: none !important; }
.shadow, .shadow-sm { box-shadow: none !important; }

.form-control, .form-select { border-color: var(--nv-border); }
.form-control:focus, .form-select:focus { border-color: var(--nv-primary); box-shadow: 0 0 0 1px var(--nv-primary); }
.form-check-input:checked { background-color: var(--nv-primary); border-color: var(--nv-primary); }

.table { --bs-table-border-color: var(--nv-divider); }
.table-light { --bs-table-bg: var(--nv-surface-low); --bs-table-border-color: var(--nv-divider); }
.table-hover tbody tr { cursor: pointer; }
.text-truncate-cell { max-width: 220px; }
.badge-status { font-weight: 500; }
.badge { font-weight: 500; }
/* Every badge has a border, seen or not: one with .border is not taller than the one beside it. */
.badge:not(.border) { border: var(--bs-border-width) solid transparent; }

.list-group { --bs-list-group-border-color: var(--nv-divider); --bs-list-group-active-bg: var(--nv-primary); --bs-list-group-active-border-color: var(--nv-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--nv-primary); }
.dropdown-menu { --bs-dropdown-border-color: var(--nv-border); --bs-dropdown-link-active-bg: var(--nv-primary); box-shadow: 0 4px 12px rgba(26, 28, 30, .08); }
.alert-light { --bs-alert-bg: var(--nv-surface-low); --bs-alert-border-color: var(--nv-divider); }

/* The bar on top of the app: white, a line under it, the active item in navy. */
.nv-appbar { background: var(--nv-surface); border-bottom: 1px solid var(--nv-border); }
.nv-appbar .nav-link { color: var(--nv-text-2); font-weight: 500; }
.nv-appbar .nav-link:hover { color: var(--nv-text); }
.nv-appbar .nav-link.active { color: var(--nv-primary); box-shadow: inset 0 -2px 0 var(--nv-primary); }

/* The mark and the name. */
.nv-brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--nv-primary); font-weight: 700; font-size: 18px; line-height: 28px; letter-spacing: -0.01em; text-decoration: none; }
.nv-brand:hover { color: var(--nv-primary-hover); }
.nv-brand img { width: 28px; height: 28px; border-radius: 6px; }

/* ------------------------------------------------------------------ */
/* Public pages: the front page, the help, the documents, the login.  */
/* ------------------------------------------------------------------ */

.nv-public { background: var(--nv-bg); min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; }
/* A short page (the login, the contents of the help) keeps its footer at the bottom. Nothing may be wider
   than the screen: a page wider than the phone moves the sticky bar off its top. clip, not hidden, which
   would make the body a scroll box and the bar stop sticking. */
.nv-public > main { flex: 1 0 auto; display: flex; flex-direction: column; }
.nv-skip { position: absolute; left: -999px; }
.nv-skip:focus { left: 1rem; top: 1rem; z-index: 2000; background: var(--nv-surface); padding: .5rem 1rem; }

/* Solid white, and every line of text in the sticky bar on a whole pixel: text centred at 19.25px is
   rounded differently at each step of the scroll and shakes, its box does not. */
.nv-header { position: sticky; top: 0; z-index: 1030; background: var(--nv-surface); border-bottom: 1px solid var(--nv-border); }
.nv-header .nav-link { color: var(--nv-text-2); font-weight: 500; padding: .5rem .75rem; }
.nv-header .nav-link:hover, .nv-header .nav-link.active { color: var(--nv-primary); }

.nv-lang { display: inline-flex; height: 38px; border: 1px solid var(--nv-border); }
.nv-lang a, .nv-lang span { display: inline-flex; align-items: center; padding: 0 .625rem; font-size: 13px; line-height: 20px; font-weight: 500; text-decoration: none; color: var(--nv-text-2); text-transform: uppercase; }
.nv-lang span { background: var(--nv-primary); color: #fff; }
.nv-lang a:hover { background: var(--nv-surface-low); color: var(--nv-text); }

.nv-section { padding-block: clamp(3rem, 7vw, 6rem); }
.nv-section + .nv-section { border-top: 1px solid var(--nv-divider); }
.nv-section-white { background: var(--nv-surface); }
.nv-eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--nv-accent); margin-bottom: .75rem; }
.nv-h1 { font-size: clamp(2.25rem, 5.2vw, 3.75rem); line-height: 1.05; font-weight: 750; letter-spacing: -0.03em; }
.nv-h2 { font-size: clamp(1.625rem, 3.2vw, 2.375rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; }
.nv-lead { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.55; color: var(--nv-text-2); max-width: 36rem; }
.nv-muted { color: var(--nv-text-3); }

/* The hero: text on the left, the phone on the right. */
.nv-hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 6vw, 5rem); overflow: hidden; }
.nv-hero-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .5rem; color: var(--nv-text-2); }
.nv-hero-points li { display: flex; gap: .5rem; align-items: baseline; }
.nv-hero-points li::before { content: ''; flex: none; width: 6px; height: 6px; background: var(--nv-primary); transform: translateY(-2px); }

.nv-phone { position: relative; width: min(300px, 78vw); margin-inline: auto; padding: 10px; background: #12141a; border-radius: 34px; box-shadow: 0 30px 60px -30px rgba(30, 58, 138, .45); }
.nv-phone img { display: block; width: 100%; height: auto; border-radius: 26px; }
.nv-phone-pair { display: flex; gap: 1.25rem; justify-content: center; align-items: flex-start; }
.nv-phone-pair .nv-phone { width: min(250px, 42vw); margin: 0; }
.nv-phone-pair .nv-phone:nth-child(2) { margin-top: 3rem; }

/* A grid of sources: square tiles with a hairline, like the app's lists. */
.nv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); border-top: 1px solid var(--nv-border); border-left: 1px solid var(--nv-border); }
.nv-tile { background: var(--nv-surface); padding: 1.5rem; border-right: 1px solid var(--nv-border); border-bottom: 1px solid var(--nv-border); }
.nv-tile h3 { font-size: 1.0625rem; font-weight: 650; margin: 1rem 0 .5rem; }
.nv-tile p { margin: 0; color: var(--nv-text-2); }
.nv-icon { width: 40px; height: 40px; display: grid; place-items: center; background: var(--nv-primary-soft); color: var(--nv-primary); }
.nv-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.nv-checks { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; }
.nv-checks li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: .75rem; }
.nv-checks svg { width: 20px; height: 20px; margin-top: 2px; fill: none; stroke: var(--nv-primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nv-checks b { display: block; font-weight: 600; }
.nv-checks span { color: var(--nv-text-2); }

/* The privacy block: navy, the one dark band on the page. */
.nv-dark { background: var(--nv-primary); color: #fff; }
.nv-dark .nv-eyebrow { color: #b6c4ff; }
.nv-dark .nv-lead, .nv-dark p { color: #dce1ff; }
.nv-dark a { color: #fff; }
.nv-dark .nv-checks svg { stroke: #b6c4ff; }
.nv-dark .nv-checks span { color: #dce1ff; }

/* Plans */
.nv-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.nv-plan { background: var(--nv-surface); border: 1px solid var(--nv-border); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.nv-plan-featured { border: 2px solid var(--nv-primary); }
.nv-plan h3 { font-size: 1.125rem; font-weight: 650; margin: 0; }
.nv-price { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.nv-price small { font-size: .875rem; font-weight: 500; color: var(--nv-text-3); letter-spacing: 0; }
.nv-plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; font-size: .9375rem; color: var(--nv-text-2); }
.nv-plan li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: .5rem; }
.nv-plan li svg { width: 16px; height: 16px; margin-top: 3px; fill: none; stroke: var(--nv-income); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.nv-free { border: 1px solid var(--nv-border); background: var(--nv-surface); padding: clamp(1.5rem, 4vw, 2.5rem); display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
@media (max-width: 767.98px) { .nv-free { grid-template-columns: minmax(0, 1fr); } }

/* FAQ */
.nv-faq { border-top: 1px solid var(--nv-border); }
.nv-faq details { border-bottom: 1px solid var(--nv-border); }
.nv-faq summary { list-style: none; cursor: pointer; padding: 1.125rem 0; font-weight: 600; display: flex; justify-content: space-between; gap: 1rem; }
.nv-faq summary::-webkit-details-marker { display: none; }
.nv-faq summary::after { content: '+'; font-weight: 400; font-size: 1.375rem; line-height: 1; color: var(--nv-primary); }
.nv-faq details[open] summary::after { content: '−'; }
.nv-faq details > div { padding-bottom: 1.25rem; color: var(--nv-text-2); max-width: 46rem; }

/* Reading pages: the help and the documents. */
.nv-read { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); padding-block: 2rem 4rem; }
@media (max-width: 991.98px) { .nv-read { grid-template-columns: minmax(0, 1fr); } }
.nv-toc { position: sticky; top: 5rem; align-self: start; }
@media (max-width: 991.98px) { .nv-toc { position: static; } }
.nv-toc a { display: block; padding: .375rem .75rem; color: var(--nv-text-2); text-decoration: none; border-left: 2px solid var(--nv-divider); }
.nv-toc a:hover { color: var(--nv-text); border-left-color: var(--nv-border); }
.nv-toc a.active { color: var(--nv-primary); border-left-color: var(--nv-primary); font-weight: 600; }
.nv-prose { max-width: 44rem; font-size: 1.0625rem; line-height: 1.65; }
.nv-prose h1 { font-size: clamp(1.75rem, 3.5vw, 2.375rem); font-weight: 700; letter-spacing: -0.025em; margin-bottom: 1rem; }
.nv-prose h2 { font-size: 1.375rem; margin-top: 2.25rem; }
.nv-prose h3 { font-size: 1.125rem; margin-top: 1.75rem; }
.nv-prose img { max-width: 100%; height: auto; }
.nv-prose table { width: 100%; margin-bottom: 1rem; }
.nv-prose code { color: var(--nv-text); background: var(--nv-surface-low); padding: .1em .3em; }
.nv-crumbs { font-size: .875rem; color: var(--nv-text-3); margin-bottom: 1rem; }
.nv-crumbs a { color: var(--nv-text-3); }

/* The articles: a list of cards, and one article with two more to read under it. */
.nv-posts { display: grid; gap: 1rem; }
.nv-post-card { position: relative; background: var(--nv-surface); border: 1px solid var(--nv-border); padding: 1.25rem 1.5rem; }
.nv-post-card:hover { border-color: var(--nv-primary); }
.nv-article { max-width: 44rem; margin-inline: auto; padding-block: 2rem 4rem; }
.nv-post-cta { margin-top: 2.5rem; padding: 1.5rem; background: var(--nv-surface); border: 1px solid var(--nv-border); }
.nv-post-more { display: grid; gap: .75rem; margin-top: 2.5rem; }

/* Login */
.nv-auth { flex: 1 0 auto; display: grid; place-items: center; padding: 2rem 1rem; }
.nv-auth-card { width: min(24rem, 100%); background: var(--nv-surface); border: 1px solid var(--nv-border); padding: 2rem; }

/* Footer */
.nv-footer { background: var(--nv-surface); border-top: 1px solid var(--nv-border); padding-block: 2.5rem; font-size: .9375rem; color: var(--nv-text-2); }
.nv-footer-heading { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--nv-text-3); margin-bottom: .75rem; }
.nv-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .375rem; }
.nv-footer a { color: var(--nv-text-2); text-decoration: none; }
.nv-footer a:hover { color: var(--nv-primary); text-decoration: underline; }

.budget-chart { position: relative; height: 12rem; max-width: 16rem; }
.budget-swatch { flex: none; width: .75rem; height: .75rem; border-radius: 50%; }
