html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--body-font, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif);
    background: var(--neutral-layer-2, #f5f5f5);
    color: var(--neutral-foreground-rest, #1b1b1b);
}

h1 {
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0 0 12px;
}

h1:focus {
    outline: none;
}

h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 12px;
}

a {
    color: var(--accent-foreground-rest, #0f6cbd);
}

code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.hint {
    color: var(--neutral-foreground-hint, #616161);
    max-width: 70ch;
}

/* ---------- Boot screen (before WASM starts) ---------- */

.boot-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100vh;
}

.boot-logo {
    margin-bottom: 0.75rem;
}

.boot-brand {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #0f6cbd;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Betöltés");
    color: #616161;
}

/* ---------- Main layout ---------- */

.app-layout {
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-header .brand {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.15em;
    font-size: 1.2rem;
}

.app-header .user-name {
    opacity: 0.85;
}

.app-main {
    align-items: stretch;
    min-height: calc(100vh - 50px);
}

.app-nav {
    background: var(--neutral-layer-1, #fff);
    border-right: 1px solid var(--neutral-stroke-divider-rest, #e0e0e0);
}

.app-body {
    flex: 1;
    min-width: 0;
    padding: 24px;
    box-sizing: border-box;
}

.page-stack {
    max-width: 760px;
}

.card {
    background: var(--neutral-layer-1, #fff);
    color: var(--neutral-foreground-rest, #1b1b1b);
    border: 1px solid var(--neutral-stroke-divider-rest, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.section-card,
.info-card {
    padding: 20px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.info-card {
    max-width: 640px;
}

.info-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 20px;
    margin: 0;
}

.info-list dt {
    color: var(--neutral-foreground-hint, #616161);
}

.info-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.error-bar {
    margin-bottom: 12px;
}

/* Pin the text color to the bar's own background (FluentUI adds .dark in dark mode), whatever the page inherits. */
.error-bar:not(.dark) .fluent-messagebar-message {
    color: #1b1b1b;
}

.error-bar.dark .fluent-messagebar-message {
    color: #f3f3f3;
}

.loading-indicator {
    display: flex;
    justify-content: center;
    padding: 48px 0;
}

.grid-scroll {
    overflow-x: auto;
}

.grid-scroll fluent-data-grid {
    min-width: 900px;
}

.qr-code {
    width: 220px;
    height: 220px;
    image-rendering: pixelated;
    background: #fff;
    padding: 8px;
    border-radius: 8px;
}

.recovery-codes {
    columns: 2;
    padding-left: 20px;
}

.setup-steps {
    padding-left: 20px;
}

/* ---------- Auth pages ---------- */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 28px;
    box-sizing: border-box;
}

.auth-brand {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--accent-fill-rest, #0f6cbd);
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: var(--neutral-foreground-hint, #616161);
    margin-bottom: 20px;
}

.auth-server {
    margin-top: 16px;
    font-size: 0.85rem;
    text-align: center;
}

.server-name {
    margin-right: 8px;
    font-size: 0.85rem;
    color: inherit;
    text-decoration: none;
    opacity: 0.8;
}

.auth-title {
    font-size: 1.3rem;
}
