/* ============================================================
   Fonts — same house style as the AdviseursModule (Pacaembu for
   display headings, NotoSans for body). Self-hosted from /Fonts.
   ============================================================ */
@font-face {
    font-family: 'Pacaembu';
    src: url('/Fonts/Pacaembu-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'NotoSans';
    src: url('/Fonts/NotoSans-Regular.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'NotoSans-Semi';
    src: url('/Fonts/NotoSans-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: 'NotoSans-Bold';
    src: url('/Fonts/NotoSans-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

/* ============================================================
   Design tokens. The brand colours (--c-primary/--c-success) are sourced
   from the MudBlazor theme so it stays the single source; the rest are
   local tokens taken from the offerte SVG designs (text/muted/link, the
   --c-focus accent, surfaces and borders) — these are NOT theme-derived.
   ============================================================ */
:root {
    --c-text: #1D1B20;
    --c-muted: #79747E;
    --c-link: #596F8C;
    /* Brand colours come from the MudBlazor theme (InpactTheme) as the single source; the hex is only a
       fallback for the WASM-boot phase before MudThemeProvider has emitted its variables. */
    --c-primary: var(--mud-palette-primary, #2B50CC);
    --c-focus: #304FFE;
    --c-success: var(--mud-palette-success, #2DAF18);
    --c-surface: #F7F2FA;
    --c-bg: #FFFFFF;
    --c-border: #CAC4D0;
    --c-error: #B3261E;
    --c-warning-surface: #FFF4E5;
    --c-warning-text: #8A5A00;
    --logo-bg: #D9D9D9;
    --container-max: 520px;
}

html, body {
    margin: 0;
    font-family: 'NotoSans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--c-text);
    background-color: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}

/* FocusOnNavigate moves focus to the (non-interactive) page h1 for screen readers; suppress the visible
   ring so every navigation doesn't flash an outline around the heading. */
h1:focus {
    outline: none;
}

/* ============================================================
   App shell (mobile-first, capped + centred for desktop).
   ============================================================ */
.app-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: var(--c-bg);
}

.app-header__inner,
.app-container {
    max-width: var(--container-max);
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.app-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
}

.app-logo {
    width: 120px;
    height: 48px;
    object-fit: contain;
    border-radius: 4px;
}

.app-actions {
    display: flex;
    gap: 4px;
}

.app-main {
    flex: 1;
}

.app-container {
    padding: 8px 20px 48px;
}

.app-footer {
    max-width: var(--container-max);
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 20px 28px;
    color: var(--c-muted);
    font-size: 0.8rem;
}

/* ============================================================
   Typography helpers.
   ============================================================ */
.display-title {
    font-family: 'Pacaembu', 'NotoSans', sans-serif;
    font-weight: 700;
    font-size: 1.85rem;
    line-height: 1.15;
    color: var(--c-text);
    margin: 12px 0 16px;
}

.body-text {
    font-family: 'NotoSans', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--c-text);
    margin: 0 0 28px;
}

.hint-text {
    font-family: 'NotoSans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--c-link);
    margin: 16px 0 0;
}

.error-text {
    font-family: 'NotoSans', sans-serif;
    font-size: 0.9rem;
    color: var(--c-error);
    margin: 14px 0 0;
}

.resend-text {
    font-family: 'NotoSans', sans-serif;
    font-size: 0.95rem;
    color: var(--c-link);
    margin: 22px 0 0;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--c-link);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.link-button:hover {
    color: var(--c-primary);
}

.link-button:disabled {
    opacity: 0.5;
    cursor: default;
}

.link-button:disabled:hover {
    color: var(--c-link);
}

/* Keyboard focus (mouse clicks don't trigger :focus-visible, so pointer users see no ring). */
.link-button:focus-visible {
    outline: 2px solid var(--c-focus);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================================
   Segmented code input (one box per digit). A single real input
   sits invisibly on top for OS one-time-code autofill + paste;
   the boxes below mirror its value.
   ============================================================ */
.code-input {
    position: relative;
    display: flex;
    gap: 10px;
    max-width: 360px;
    margin: 4px 0 2px;
}

.code-input__field {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    border: none;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    font-size: 16px; /* keeps iOS from zooming on focus */
    text-align: center;
    cursor: text;
    outline: none;
}

.code-box {
    flex: 1 1 0;
    min-width: 0;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 6px;
    box-sizing: border-box;
    font-family: 'NotoSans-Bold', sans-serif;
    font-size: 2rem;
    color: var(--c-text);
    border-bottom: 2px solid var(--c-border);
    border-radius: 8px 8px 0 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.code-box.is-active {
    align-items: center;
    padding-bottom: 0;
    border: 2px solid var(--c-focus);
    border-radius: 10px;
}

.code-input.is-disabled {
    opacity: 0.6;
}

/* ============================================================
   Access flow states.
   ============================================================ */
.access__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-top: 48px;
    color: var(--c-muted);
}

/* ============================================================
   Quote overview (offertes) — mobile-first cards.
   ============================================================ */
.quote-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.quote-card {
    background-color: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.quote-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.quote-card__number {
    font-family: 'NotoSans-Bold', sans-serif;
    font-size: 1.1rem;
    color: var(--c-text);
}

.quote-card__num {
    color: var(--c-link);
    font-family: 'NotoSans', sans-serif;
    font-weight: 400;
}

.badge-new {
    flex: none;
    /* Tint tracks --c-success automatically so the background can't drift from the text colour. */
    background-color: color-mix(in srgb, var(--c-success) 12%, transparent);
    color: var(--c-success);
    font-family: 'NotoSans-Semi', sans-serif;
    font-size: 0.8rem;
    padding: 3px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.expiry-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background-color: var(--c-warning-surface);
    color: var(--c-warning-text);
    font-size: 0.9rem;
}

.quote-card__changes {
    margin: 14px 0 0;
    padding-left: 1.25rem;
    color: var(--c-text);
    line-height: 1.5;
}

.quote-card__changes li {
    margin-bottom: 4px;
}

.quote-card__premium {
    margin: 16px 0 16px;
    font-size: 1rem;
    color: var(--c-text);
}

.quote-card__premium strong {
    font-family: 'NotoSans-Bold', sans-serif;
    font-size: 1.05rem;
}

.quote-card__cta {
    margin-top: 4px;
}

.quote-footer {
    margin: 24px 0 0;
    color: var(--c-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.empty-panel {
    margin-top: 8px;
    padding: 20px;
    border: 1px dashed var(--c-border);
    border-radius: 12px;
    background-color: var(--c-surface);
}

/* ============================================================
   Quote detail (offerte-detail) — mobile-first.
   ============================================================ */
.section-title {
    font-family: 'NotoSans-Bold', sans-serif;
    font-size: 1.25rem;
    color: var(--c-text);
    margin: 24px 0 12px;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-card {
    background-color: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 20px;
}

.product-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.product-card__insurer {
    font-family: 'NotoSans-Bold', sans-serif;
    font-size: 1.05rem;
    color: var(--c-text);
}

.product-card__logo {
    max-height: 28px;
    max-width: 120px;
    object-fit: contain;
}

.badge-switch {
    flex: none;
    background-color: color-mix(in srgb, var(--c-primary) 12%, transparent);
    color: var(--c-primary);
    font-family: 'NotoSans-Semi', sans-serif;
    font-size: 0.8rem;
    padding: 3px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.product-card__title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.product-card__name {
    font-family: 'NotoSans-Bold', sans-serif;
    font-size: 1rem;
    color: var(--c-text);
    margin: 0;
}

.product-card__details {
    margin: 2px 0 0;
    color: var(--c-muted);
    font-size: 0.9rem;
}

.product-card__premium {
    flex: none;
    font-family: 'NotoSans-Bold', sans-serif;
    color: var(--c-text);
    margin: 0;
}

.coverage-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

.coverage-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--c-text);
}

.coverage-list__icon {
    flex: none;
    color: var(--c-link);
}

.product-card__replaces {
    margin: 14px 0 0;
    color: var(--c-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.existing-panel {
    margin-top: 16px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    overflow: hidden;
}

.existing-panel__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    color: var(--c-text);
}

.pdf-button {
    margin-top: 16px;
}

.total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--c-border);
}

.total-row__label {
    font-family: 'NotoSans-Bold', sans-serif;
    font-size: 1.05rem;
    color: var(--c-text);
}

.total-row__value {
    font-family: 'NotoSans-Bold', sans-serif;
    font-size: 1.05rem;
    color: var(--c-text);
}

.total-note {
    margin: 4px 0 0;
    color: var(--c-muted);
    font-size: 0.8rem;
}

.cta-primary {
    margin-top: 20px;
}

/* ---- Contextual header (back + quote number) ---- */
.header-brand-back {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.header-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    padding: 4px;
    margin-left: -4px;
    color: var(--c-text);
    cursor: pointer;
    border-radius: 6px;
}

.header-back-btn:hover {
    background-color: color-mix(in srgb, var(--c-primary) 8%, transparent);
    color: var(--c-primary);
}

.header-back-btn:focus-visible {
    outline: 2px solid var(--c-focus);
    outline-offset: 1px;
}

.header-brand-title {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 0;
}

.header-brand-title__label {
    font-family: 'NotoSans-Bold', sans-serif;
    font-size: 1.05rem;
    color: var(--c-text);
}

.header-brand-title__num {
    font-size: 0.85rem;
    color: var(--c-link);
}

/* ---- Detail sections / "alles op een rij" ---- */
.detail-section {
    margin-top: 28px;
}

.subsection-title {
    font-family: 'NotoSans-Bold', sans-serif;
    font-size: 1rem;
    color: var(--c-text);
    margin: 16px 0 6px;
}

.situation-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.situation-card {
    border-radius: 12px;
    padding: 14px 16px;
}

.situation-card--current {
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
}

.situation-card--new {
    background-color: color-mix(in srgb, var(--c-success) 8%, transparent);
    border: 1px solid var(--c-success);
}

.situation-card__label {
    font-size: 0.8rem;
    color: var(--c-muted);
}

.situation-card__line {
    margin: 4px 0 0;
    color: var(--c-text);
}

.situation-card__total {
    margin: 2px 0 0;
    font-family: 'NotoSans-Bold', sans-serif;
    color: var(--c-text);
}

.docs-panel {
    margin-top: 20px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    overflow: hidden;
}

.docs-panel__title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--c-text);
}

/* ---- Action block ---- */
.action-block {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-block .cta-primary,
.action-block .pdf-button {
    margin-top: 0;
}

.question-link {
    align-self: center;
    font-size: 0.95rem;
}

/* ============================================================
   Afsluitformulier (betaalwijze + slotvragen).
   ============================================================ */
.form-section {
    margin-top: 28px;
}

.question {
    background-color: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
}

.question__body {
    color: var(--c-text);
    line-height: 1.5;
    margin: 0 0 14px;
}

.question__body ul {
    margin: 8px 0 0;
    padding-left: 1.25rem;
}

.question__body li {
    margin-bottom: 6px;
}

.radio-stack,
.radio-pair {
    display: flex;
    gap: 12px;
}

.radio-stack {
    flex-direction: column;
}

.radio-pair > .radio-row {
    flex: 1 1 0;
}

.radio-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: color-mix(in srgb, var(--c-primary) 6%, transparent);
    border: 1px solid transparent;
    cursor: pointer;
}

.radio-row input[type="radio"] {
    accent-color: var(--c-primary);
    width: 18px;
    height: 18px;
    margin: 0;
    flex: none;
}

.radio-row.is-selected {
    border-color: var(--c-primary);
    background-color: color-mix(in srgb, var(--c-primary) 12%, transparent);
}

.radio-row:hover {
    background-color: color-mix(in srgb, var(--c-primary) 10%, transparent);
}

/* The focusable element is the (visually small) radio input; surface keyboard focus on the whole row. */
.radio-row:has(input:focus-visible) {
    outline: 2px solid var(--c-focus);
    outline-offset: 1px;
}

/* ============================================================
   Aanvraag-bevestiging.
   ============================================================ */
.confirm {
    text-align: center;
    padding-top: 56px;
}

/* Green success check with a soft halo (design #8). The halo is a translucent ring around a solid disc. */
.confirm__check {
    width: 104px;
    height: 104px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: color-mix(in srgb, var(--c-success) 18%, transparent);
}

.confirm__check-inner {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--c-success);
    color: #fff;
}

.confirm__check-inner .mud-icon-root {
    font-size: 2.5rem;
}

.confirm__close {
    margin-top: 24px;
    color: var(--c-link);
    font-size: 0.95rem;
}

/* ============================================================
   Blazor / WASM boot + error UI (shown before the app loads).
   ============================================================ */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--c-primary);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Laden");
    }
