/*
 * Betalen: page layout only, modelled on the verhuisservice shell (vs-app.css). Every component
 * (buttons, fields, cards, option cards, alerts, badges, progress) comes from ko-ui.css; this file places them.
 * Tokens only.
 */

html {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}
html, body {
    margin: 0;
    background: var(--ko-bg-subtle);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
*, *::before, *::after { box-sizing: border-box; }
button, a, [role="button"] { touch-action: manipulation; }

/* One column, the same width as the verhuisservice */
.bt-shell {
    max-width: 680px;
    min-height: 100svh;
    margin: 0 auto;
    padding:
        calc(var(--ko-space-5) + env(safe-area-inset-top, 0px))
        calc(var(--ko-space-4) + env(safe-area-inset-right, 0px))
        calc(var(--ko-space-6) + env(safe-area-inset-bottom, 0px))
        calc(var(--ko-space-4) + env(safe-area-inset-left, 0px));
    display: flex;
    flex-direction: column;
}
/* Page head 58px below the logo bar, as in the verhuisservice (no breadcrumbs → the page head takes their place) */
.bt-top { display: flex; align-items: center; justify-content: space-between; gap: var(--ko-space-3); margin-bottom: 58px; }
@media (max-width: 479.98px) { .bt-top { margin-bottom: var(--ko-space-6); } }
.bt-logo { display: inline-flex; min-height: 24px; }
.bt-logo img { display: block; height: 28px; width: auto; }
.bt-main { flex: 1; outline: none; }

.bt-footer { margin-top: var(--ko-space-6); color: var(--ko-text-subtle); }
.bt-footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--ko-space-2); }
/* "Hulp nodig?" reads as footer text but is a button: it opens the chat */
.bt-footer-link {
    min-height: 24px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 2px;
    transition: color 150ms ease, text-decoration-color 150ms ease;
}
.bt-footer-link:active { color: var(--ko-text); }
.bt-footer-link:focus-visible { outline: none; border-radius: 2px; box-shadow: var(--ko-focus-ring); }
@media (hover: hover) and (pointer: fine) {
    .bt-footer-link:hover { color: var(--ko-text); text-decoration-color: currentColor; }
}

.bt-page-head { margin-bottom: var(--ko-space-5); }
.bt-notices { margin-bottom: var(--ko-space-4); }

/* Card with a form or a list */
.bt-card { margin-bottom: var(--ko-space-4); }
.bt-card-body { display: flex; flex-direction: column; gap: var(--ko-space-4); }
.bt-card-body > form { display: flex; flex-direction: column; gap: var(--ko-space-4); }
.bt-card-body p { margin: 0; }
.bt-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ko-space-4); }
@media (max-width: 559.98px) { .bt-row { grid-template-columns: 1fr; } }
/* Live regions that are still empty must not take a gap slot */
.bt-card-body > form > div:empty { display: none; }

/* Detail rows inside a card body that also holds other content: no extra padding */
.bt-dl-flush { margin: 0; }
.bt-total dd { font-weight: 600; }

/* Invoice list: search + select all above the option cards */
.bt-list-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ko-space-3); }
.bt-list-tools .ko-search { flex: 1 1 240px; max-width: 320px; }
.bt-list-count { color: var(--ko-text-subtle); }
/* Several from a list → plain checkbox rows (ko-ui choices.md), not option cards: every invoice starts selected,
   so a blue ring per card would colour the whole list. Only the checkbox carries the selection. The page scrolls,
   the list doesn't (no nested scroll on phones). */
.bt-invoices { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--ko-line-soft); }
.bt-invoice-row { border-bottom: 1px solid var(--ko-line-soft); }
.bt-invoice {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    column-gap: var(--ko-space-3);
    align-items: start;
    min-height: var(--ko-h-row-store);
    padding: var(--ko-space-3) var(--ko-space-2);
    cursor: pointer;
    font: 400 14px/20px var(--ko-font);
    color: var(--ko-text);
    transition: background-color 150ms ease;
}
.bt-invoice > .ko-check { margin-top: 2px; }
.bt-invoice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bt-invoice-title { font-weight: 500; }
.bt-invoice-desc { font-size: 13px; line-height: 18px; color: var(--ko-text-subtle); }
.bt-invoice-amount { white-space: nowrap; text-align: right; }
/* "Bekijken" is 18px of text: give it a 24px hit area without moving the line */
.bt-invoice-desc .ko-link { display: inline-block; padding-block: 3px; margin-block: -3px; }
/* Not selected: the amount goes quiet, so it reads as "not in the total" */
.bt-invoice:has(.ko-check:not(:checked)) .bt-invoice-amount { color: var(--ko-text-subtle); }
.bt-invoice:active { background: var(--ko-bg-pressed); }
@media (hover: hover) and (pointer: fine) {
    .bt-invoice:hover { background: var(--ko-bg-hover); }
}
.bt-empty-search { margin: 0; padding: var(--ko-space-3) 0; color: var(--ko-text-subtle); }

/* Bottom row: back left, primary right; on a phone the primary goes on top, full width */
.bt-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ko-space-2);
    padding-top: var(--ko-space-4);
    border-top: 1px solid var(--ko-line-soft);
}
.bt-actions-end { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--ko-space-2); margin-left: auto; }
@media (max-width: 479.98px) {
    .bt-actions { flex-direction: column-reverse; align-items: stretch; }
    .bt-actions-end { flex-direction: column-reverse; margin-left: 0; }
    .bt-actions .ko-btn { width: 100%; }
}

/* Waiting for the bank */
.bt-wait { display: flex; flex-direction: column; gap: var(--ko-space-2); }
.bt-wait-text { margin: 0; color: var(--ko-text-subtle); }

/* Help under a screen: no frame, icon + title + one paragraph, aligned with the card's content */
.bt-help {
    display: grid;
    grid-template-columns: 18px 1fr;
    column-gap: var(--ko-space-3);
    margin: var(--ko-space-2) 0 var(--ko-space-4);
    padding: 0 var(--ko-space-4);
}
.bt-help-icon { margin-top: 1px; color: var(--ko-text-subtle); }
.bt-help-title { margin: 0; font: 500 14px/20px var(--ko-font); letter-spacing: 0; color: var(--ko-text); }
.bt-help-text { margin: 2px 0 0; max-width: 72ch; font: 400 14px/22px var(--ko-font); color: var(--ko-text-subtle); }

/* Preview banner (ko-preview.php only) */
.bt-preview-nav { display: flex; flex-wrap: wrap; gap: var(--ko-space-2); margin-top: var(--ko-space-3); }
