/* ==========================================================================
   MitNetClient — Design System
   Ported from the MitNetClientportal design (Clientportal/MitNetClientportal).
   Only --brand / --brand-hover / --brand-soft are overridden per-tenant from
   the inline <style> block in App.razor (see ClientBranding).
   ========================================================================== */

:root {
    /* Brand-Tweakable (per-tenant overrides set in App.razor) */
    --brand: #2563eb;
    --brand-hover: #1d4ed8;
    --brand-soft: #eff6ff;
    --brand-fg: #ffffff;

    /* Neutrals */
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;

    /* Status */
    --success: #16a34a;
    --success-soft: #dcfce7;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --info: #0284c7;
    --info-soft: #e0f2fe;

    /* Spacing & Radius */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-xl: 16px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.05);

    /* Typography */
    --font-sans: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 22px; line-height: 1.25; letter-spacing: -0.015em; }
h3 { font-size: 17px; line-height: 1.3; }
h4 { font-size: 15px; line-height: 1.35; }
p  { margin: 0; }

a { color: var(--brand); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

/* ==========================================================================
   Layout
   ========================================================================== */

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topnav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topnav-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-link {
    padding: 8px 14px;
    border-radius: var(--r-md);
    color: var(--text-muted);
    font-size: 14px; font-weight: 500;
    cursor: pointer; background: none; border: none;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all 0.12s ease;
    text-decoration: none;
}
.nav-link:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--brand); background: var(--brand-soft); }

.nav-right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--r-md);
    display: grid; place-items: center;
    color: var(--text-muted);
    position: relative;
    cursor: pointer;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }

.icon-btn-sm {
    width: 24px; height: 24px;
    border: none; background: transparent;
    color: var(--text-muted);
    border-radius: 4px;
    display: inline-grid; place-items: center;
    cursor: pointer; font-family: inherit;
}
.icon-btn-sm:hover { color: var(--text); background: var(--bg); }

.icon-btn .dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 7px; height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
}
.user-chip:hover { background: var(--bg); }
.user-chip .avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--text); color: var(--surface);
    display: grid; place-items: center;
    font-size: 11px; font-weight: 700;
}
.user-chip .name { font-size: 13px; font-weight: 600; }

.page {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px;
    flex: 1;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}
.page-header .lead { color: var(--text-muted); font-size: 14px; margin-top: 6px; }

.breadcrumb {
    display: flex; align-items: center; gap: 6px;
    color: var(--text-soft);
    font-size: 13px;
    margin-bottom: 8px;
}
.breadcrumb a { color: var(--text-soft); }
.breadcrumb .sep { color: var(--text-soft); }
.breadcrumb .current { color: var(--text-muted); }

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 16px; }
.card-header .sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 24px; }
.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    display: flex; flex-direction: column; gap: 6px;
}
.kpi-card .label { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.kpi-card .value { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.kpi-card .meta { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
    font-family: inherit;
    text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--brand-fg); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--bg); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-row.row-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row .grid-cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Country-code + number compound, used everywhere a phone number is collected (registration,
   MFA channel setup) — same shape project-wide. */
.phone-input-group { display: flex; gap: 8px; }
.phone-input-group .phone-country-select { flex: 0 0 110px; min-width: 0; }
.phone-input-group .phone-number-input { flex: 1 1 auto; min-width: 0; }

.label {
    font-size: 13px; font-weight: 500; color: var(--text);
    display: flex; align-items: center; gap: 6px;
}
.label .req { color: var(--danger); }
.label .hint { color: var(--text-soft); font-weight: 400; font-size: 12px; }

.input, .select, .textarea {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    background: var(--surface);
    font-size: 14px; color: var(--text);
    font-family: inherit;
    transition: border-color 0.12s, box-shadow 0.12s;
    width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}
.input:disabled, .select:disabled, .textarea:disabled {
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: not-allowed;
}
.input.readonly { background: var(--surface-2); border-color: var(--border); }
.textarea { height: auto; padding: 10px 12px; min-height: 80px; resize: vertical; }
.helper { font-size: 12px; color: var(--text-muted); }
.helper.error { color: var(--danger); }

.checkbox, .radio {
    display: flex; align-items: flex-start; gap: 10px;
    cursor: pointer;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    transition: all 0.1s;
}
.checkbox:hover, .radio:hover { border-color: var(--border-strong); }
.checkbox.checked, .radio.checked { border-color: var(--brand); background: var(--brand-soft); }
.checkbox input, .radio input { margin-top: 3px; accent-color: var(--brand); }
.checkbox .text, .radio .text { flex: 1; }
.checkbox .text strong, .radio .text strong { display: block; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.checkbox .text span, .radio .text span { font-size: 12px; color: var(--text-muted); }

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.badge.success { background: var(--success-soft); color: #166534; border-color: transparent; }
.badge.warning { background: var(--warning-soft); color: #92400e; border-color: transparent; }
.badge.danger  { background: var(--danger-soft); color: #991b1b; border-color: transparent; }
.badge.info    { background: var(--info-soft); color: #075985; border-color: transparent; }
.badge.brand   { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge .dot-mark { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ==========================================================================
   Tables
   ========================================================================== */

/* Tables live inside .card.flush, which clips overflow for its rounded corners — without this
   wrapper, a table wider than its card (common on narrow viewports) gets silently cut off instead
   of scrolling, and short numeric cells get squeezed into an awkward mid-value line break. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    font-size: 12px; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}
.table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .muted { color: var(--text-muted); }
.table .wrap { white-space: normal; word-break: break-word; overflow-wrap: anywhere; min-width: 160px; }

/* ==========================================================================
   Misc
   ========================================================================== */

.divider { height: 1px; background: var(--border); margin: 16px 0; border: none; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--text-muted); font-size: 13px; }
.tabular { font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty .icon { font-size: 32px; margin-bottom: 12px; opacity: 0.4; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab {
    padding: 12px 16px;
    font-size: 14px; font-weight: 500;
    color: var(--text-muted);
    border: none; background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: all 0.12s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: grid; place-items: center;
    z-index: 200; padding: 32px;
    animation: fadeIn 0.15s ease-out;
}
.modal {
    background: var(--surface);
    border-radius: var(--r-xl);
    max-width: 520px; width: 100%;
    max-height: 90vh; overflow: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.18s ease-out;
}
.modal.lg { max-width: 720px; }
.modal.xl { max-width: 920px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }

.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 32px; }
.stepper .step { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.stepper .step .num {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 13px; font-weight: 600;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    color: var(--text-muted);
}
.stepper .step.active .num { background: var(--brand); color: var(--brand-fg); border-color: var(--brand); }
.stepper .step.done .num { background: var(--success); color: white; border-color: var(--success); }
.stepper .step .label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.stepper .step.active .label { color: var(--text); font-weight: 600; }
.stepper .step.done .label { color: var(--text); }
.stepper .connector { flex: 1; height: 1px; background: var(--border); margin: 0 12px; }
.stepper .step.done + .connector { background: var(--success); }

/* ==========================================================================
   PublicHeader
   ========================================================================== */

.public-header { width: 100%; }

.public-contact-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.public-contact-bar-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 32px;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 12px;
    color: var(--text-muted);
}
.public-contact-item { display: inline-flex; align-items: center; gap: 6px; }
.public-contact-bar-right { display: flex; gap: 8px; align-items: center; }

.public-brand-strip-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
}

.public-brand-strip.grey { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.public-brand-strip.grey .public-brand-strip-inner { height: 88px; }

.public-brand-mark {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.public-brand-mark.on-light { color: var(--text); }

/* LogoBox — white square, brand-colored initials or tenant logo image */
.brand-logo-box {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-weight: 800;
    background: #ffffff;
    color: var(--brand);
}
.brand-logo-box.bordered { border: 1px solid var(--border); }
.brand-logo-box img { width: 78%; height: 78%; object-fit: contain; }

/* ==========================================================================
   Login screen
   ========================================================================== */

.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: linear-gradient(160deg, color-mix(in oklch, var(--brand) 16%, #ffffff) 0%, var(--bg) 55%);
}
.login-card-wrap { width: 100%; max-width: 440px; }
.login-card-inner { padding: 40px; }

.alert-success {
    background: var(--success-soft);
    color: #166534;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-info {
    background: var(--info-soft);
    color: #075985;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    display: flex;
    gap: 8px;
}
.alert-warning {
    background: var(--warning-soft);
    color: #92400e;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    gap: 8px;
}
.alert-danger {
    background: var(--danger-soft);
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    gap: 8px;
}

.contract-card {
    display: block;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.contract-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.tile-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

/* Key/value pairs (detail grids) */
.kv-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.kv-value { font-weight: 600; font-size: 14px; }

/* Action list rows (detail side cards) */
.action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    background: transparent;
    transition: background 0.1s;
}
.action-row:hover { background: var(--surface-2); text-decoration: none; }

/* Placeholder feature pages */
.placeholder-block {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}
.placeholder-block .icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--text-muted);
    display: grid; place-items: center;
    margin: 0 auto 16px;
}

/* ==========================================================================
   Blazor framework defaults (kept for the framework's own error/reconnect UI)
   ========================================================================== */

h1:focus { outline: none; }

#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;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "Es ist ein Fehler aufgetreten."; }

/* ==========================================================================
   Registration wizard (Zugang erstellen) — global, not CSS-isolated, because
   Register.razor.js builds dropdown results and the calendar via
   document.createElement()/innerHTML at runtime. Blazor's per-component CSS
   isolation rewrites every scoped selector to require a b-xxxxx attribute
   that the compiler only stamps onto elements written directly in the .razor
   markup — it can never reach elements a script creates later, so those
   rules would silently never match. Keeping this global avoids that trap.
   ========================================================================== */

.wizard-progress {
    margin-bottom: 20px;
}

.wizard-progress-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
}

.wizard-progress-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 2px;
    transition: width 0.2s ease;
}

.wizard-progress-label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.verify-channel {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
}

.verify-channel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.verify-channel-done {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

/* Narrow viewports: the two-column name row and the Geburtsort/-datum split both need to stack. */
@media (max-width: 420px) {
    .form-row.row-grid,
    .split-6040 {
        grid-template-columns: 1fr;
    }
}

/* Generic "ComboBox"-style field (text input that opens a filterable dropdown on focus) — used for
   both Geburtsland and Geburtsort, same shape as the Backend project's SfComboBox/MunicipalityPickerComponent. */
.combo-field {
    position: relative;
}

.combo-field .input {
    padding-right: 32px;
    cursor: pointer;
}

.combo-field .country-flag {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    height: 16px;
    width: auto;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    z-index: 1;
}

.combo-field.has-flag .input {
    padding-left: 34px;
}

.municipality-results {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.municipality-result-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

.municipality-result-item:hover {
    background: var(--bg);
}

.country-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.country-result-item img {
    height: 16px;
    width: auto;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    flex: 0 0 auto;
}

/* Geburtsort (60%) + Geburtsdatum (40%), side by side under one label — matches the Backend
   project's .md2-split-6040. */
.split-6040 {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 8px;
}

/* Birthdate: typeable field + calendar-icon trigger that opens a popup calendar. */
.date-field {
    position: relative;
}

.date-field .input {
    padding-right: 34px;
}

.date-trigger {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
}

.date-trigger:hover {
    background: var(--bg);
    color: var(--text);
}

.date-calendar {
    display: none;
    position: absolute;
    z-index: 20;
    top: 100%;
    right: 0;
    margin-top: 4px;
    width: 260px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.date-calendar.open {
    display: block;
}

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
}

.cal-header button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: 16px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
}

.cal-header button:hover {
    background: var(--bg);
}

.cal-header-label {
    font-size: 13px;
    font-weight: 600;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}

.cal-weekdays span {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}

.cal-grid {
    display: grid;
    gap: 2px;
}

.cal-grid-days {
    grid-template-columns: repeat(7, 1fr);
}

.cal-grid-months {
    grid-template-columns: repeat(3, 1fr);
}

.cal-grid-years {
    grid-template-columns: repeat(4, 1fr);
}

.cal-cell {
    background: none;
    border: none;
    border-radius: 6px;
    padding: 6px 0;
    font-size: 12px;
    cursor: pointer;
    color: var(--text);
    text-align: center;
}

.cal-cell:hover {
    background: var(--bg);
}

.cal-cell.selected {
    background: var(--brand);
    color: var(--brand-fg);
    font-weight: 600;
}
