/*
 * Verhuisservice: page layout only. Every component (buttons, fields, cards, options, alerts, badges, steps)
 * comes from ko-ui.css; this file places them. Tokens only.
 */

html {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
}
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, wide enough for two fields side by side, narrow enough to read. */
.vs-shell {
    max-width: 680px;
    min-height: 100dvh;
    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 top of the content area, as in the portal (ko-ui cards.md: no breadcrumbs → the
   page head takes their place at 58px). Here the content area starts under the logo bar. */
.vs-top { display: flex; align-items: center; justify-content: space-between; gap: var(--ko-space-3); margin-bottom: 58px; }
@media (max-width: 479.98px) { .vs-top { margin-bottom: var(--ko-space-6); } }
.vs-logo { display: inline-flex; min-height: 24px; }
.vs-logo img { display: block; height: 28px; width: auto; }
.vs-main { flex: 1; outline: none; }
.vs-footer { margin-top: var(--ko-space-6); color: var(--ko-text-subtle); }
.vs-footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--ko-space-2); }
/* "Hulp nodig?" reads as footer text (same size and colour as the copyright) but is a button: it opens the chat */
.vs-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;
}
.vs-footer-link:focus-visible { outline: none; border-radius: 2px; box-shadow: var(--ko-focus-ring); }
@media (hover: hover) and (pointer: fine) {
    .vs-footer-link:hover { color: var(--ko-text); text-decoration-color: currentColor; }
}

/* Page head per step */
.vs-page-head { margin-bottom: var(--ko-space-5); }
.vs-page-head .ko-title-page:focus { outline: none; } /* ko-ui-check-ignore: h1 is a programmatic focus target (tabindex=-1) so the new step is announced; not interactive, no ring */

/* Progress */
.vs-progress { margin-bottom: var(--ko-space-5); }
.vs-card-body > .vs-progress { margin: var(--ko-space-1) 0 0; } /* inside a card the card's gap spaces it */
@media (max-width: 479.98px) {
    /* On a phone only the current step keeps its label; the others are dots. */
    .vs-progress li:not([aria-current="step"]) { font-size: 0; line-height: 0; }
}

/* Form card */
.vs-card { margin-bottom: var(--ko-space-4); }
.vs-card-body { display: flex; flex-direction: column; gap: var(--ko-space-4); }
.vs-card-body > form { display: flex; flex-direction: column; gap: var(--ko-space-4); }
.vs-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ko-space-4); }
@media (max-width: 559.98px) { .vs-row { grid-template-columns: 1fr; } }
.vs-section-title { margin: var(--ko-space-2) 0 0; }
/* ko-ui 1.24.0: .ko-input's font shorthand comes after .ko-mono and wins; codes must stay monospace */
.ko-input.ko-mono { font-family: var(--ko-font-mono); }

/* Option cards in a grid (platforms, providers) */
.vs-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ko-space-2); }
@media (max-width: 479.98px) { .vs-options-grid { grid-template-columns: 1fr; } }

/* Bottom row: back left, primary right; on a phone the primary goes on top, full width */
.vs-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);
}
.vs-actions-end { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--ko-space-2); }
@media (max-width: 479.98px) {
    .vs-actions { flex-direction: column-reverse; align-items: stretch; }
    .vs-actions-end { flex-direction: column-reverse; }
    .vs-actions .ko-btn { width: 100%; }
}

.vs-stack { display: flex; flex-direction: column; gap: var(--ko-space-4); }
@media (min-width: 560px) { .vs-row-host { grid-template-columns: minmax(0, 1fr) 140px; } }

/* Mailboxes (step 6): one row per mailbox, column labels once above the list, trash icon per row.
   "Inlognaam wijkt af" (.has-user) adds the login column to every row. */
.vs-mailboxes { display: flex; flex-direction: column; }
.vs-mailboxes-head { display: flex; align-items: center; justify-content: space-between; gap: var(--ko-space-2); margin-bottom: var(--ko-space-3); }
.vs-mailbox-count { font-weight: 400; }
.vs-mailbox-cols,
.vs-mailbox {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) var(--ko-h-control);
    grid-template-areas: "email pass remove";
    column-gap: var(--ko-space-2);
    align-items: start;
}
.vs-mailboxes.has-user .vs-mailbox-cols,
.vs-mailboxes.has-user .vs-mailbox {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) var(--ko-h-control);
    grid-template-areas: "email pass user remove";
}
.vs-mailbox-cols { margin-bottom: 6px; font: 500 13px/16px var(--ko-font); color: var(--ko-text); }
.vs-mailbox-cols > span:nth-child(1) { grid-area: email; }
.vs-mailbox-cols > span:nth-child(2) { grid-area: pass; }
.vs-mailbox-cols > span:nth-child(3) { grid-area: user; }
.vs-mailbox-email { grid-area: email; min-width: 0; }
.vs-mailbox-pass { grid-area: pass; min-width: 0; }
.vs-mailbox-user { grid-area: user; min-width: 0; display: none; }
.vs-mailbox-remove { grid-area: remove; }
.vs-mailboxes.has-user .vs-mailbox-user { display: block; }
.vs-mailbox-list { display: flex; flex-direction: column; gap: var(--ko-space-2); }
/* The labels live in the column row; per field they stay for screen readers */
.vs-mailbox .ko-field > label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* A long domain after the @ shortens instead of squeezing the name */
.vs-mailbox .ko-affix > span:last-child { display: block; max-width: 55%; overflow: hidden; text-overflow: ellipsis; line-height: var(--ko-h-control); }
.vs-mailbox-usertoggle { margin-top: var(--ko-space-3); align-self: flex-start; }
.vs-mailbox-userhelp { margin-left: 24px; }

@media (max-width: 559.98px) {
    /* Phone: each mailbox stacks with visible labels; trash next to the address */
    .vs-mailbox-cols { display: none; }
    .vs-mailbox,
    .vs-mailboxes.has-user .vs-mailbox {
        grid-template-columns: minmax(0, 1fr) var(--ko-h-control);
        grid-template-areas: "email remove" "pass pass" "user user";
        row-gap: var(--ko-space-3);
        padding-bottom: var(--ko-space-4);
        border-bottom: 1px solid var(--ko-line-soft);
    }
    .vs-mailbox-list { gap: var(--ko-space-4); }
    .vs-mailbox .ko-field > label { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }
    .vs-mailbox-remove { padding-top: 22px; }
}

/* Alert stack above the first card (summary, confirmation, status) */
.vs-notices { margin-bottom: var(--ko-space-4); }
.vs-card-body > .ko-disclosure { align-self: flex-start; }
/* Live regions that are still empty (e.g. #summary-messages) must not take a gap slot */
.vs-card-body > form > div:empty { display: none; }
.vs-card-body p, .vs-card-body .ko-meta { margin: 0; }
/* Verhuisdatum (step 7): a date is short, the field doesn't need the full width */
.vs-date-field .ko-datepicker, .vs-date-field > .ko-input { max-width: 220px; }

/* Help under a step: no frame, icon + title + one paragraph, aligned with the card's content */
.vs-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);
}
.vs-help-icon { margin-top: 1px; color: var(--ko-text-subtle); }
.vs-help-title { margin: 0; font: 500 14px/20px var(--ko-font); letter-spacing: 0; color: var(--ko-text); }
.vs-help-text { margin: 2px 0 0; max-width: 72ch; font: 400 14px/22px var(--ko-font); color: var(--ko-text-subtle); }

/* Vertical steps (status page): ko-steps markers, stacked, with a description per step */
.vs-steps-vertical { flex-direction: column; gap: 0; }
.vs-steps-vertical li { flex: none; display: grid; grid-template-columns: 20px 1fr; column-gap: var(--ko-space-3); padding-bottom: var(--ko-space-5); font: 400 14px/20px var(--ko-font); }
.vs-steps-vertical li::before { grid-column: 1; grid-row: 1 / span 3; }
.vs-steps-vertical li::after { top: 26px; bottom: 6px; left: 9px; right: auto; width: 2px; height: auto; }
.vs-steps-vertical li > * { grid-column: 2; }
.vs-steps-vertical li:last-child { padding-bottom: 0; }
.vs-step-title { font-weight: 500; color: var(--ko-text); }
.vs-steps-vertical li:not(.is-done):not([aria-current="step"]) .vs-step-title { color: var(--ko-text-subtle); }
.vs-step-desc { margin-top: 2px; color: var(--ko-text-subtle); line-height: 22px; }
.vs-step-desc .ko-badge { margin-top: var(--ko-space-1); }

/* Explanation lists (Planning): numbered, nothing done or current, titles in text colour */
.vs-steps-plain li:not(.is-done):not([aria-current="step"]) .vs-step-title { color: var(--ko-text); }
/* Short lists (confirmation): less air between steps */
.vs-steps-compact li { padding-bottom: var(--ko-space-4); }
.vs-steps-compact li:last-child { padding-bottom: 0; }

/* Small lists inside a value (mail accounts) */
.vs-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--ko-space-1); }

/* Busy overlay text inside a field row (live credential checks) */
.vs-check-status { display: flex; align-items: center; gap: 6px; font: 400 13px/18px var(--ko-font); color: var(--ko-text-subtle); }
.vs-check-status.is-ok { color: var(--ko-success-text); }
.vs-check-status.is-bad { color: var(--ko-danger); }
