html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Pages supply their own padding, so the page background reaches the edges of the main area. */
.content {
    padding: 0;
}

h1:focus {
    outline: none;
}

/* ---------------------------------------------------------------------------
   Quizamatica theme: one set of color tokens for every page and the nav column.
   wwwroot/theme.js sets <html data-theme="dark|light">; with no attribute (Auto)
   the operating system's light/dark preference is used.
   --------------------------------------------------------------------------- */
:root {
    --bg: #f1f0ea;
    --surface: #fff;
    --ink: #1c1b17;
    --muted: #6a6759;
    --line: #dcd9cb;
    --accent: #6f6a3a;
    --accent-ink: #fff;
    --accent-soft: #e7e4cb;
    --verse-bg: #aeaa7c;
    --verse-ink: #5c0b0b;
    --cue: #8b1a1a;
    --danger: #a42a2a;
    --ok: #3d6b2f;

    /* Nav column: a slightly deeper shade of the page, with accent highlights. */
    --nav-bg: #e4e1d3;
    --nav-top: #dad6c4;
    --nav-ink: #2e2c22;
    --nav-muted: #6a6759;
    --nav-line: #cfcab5;
    --nav-hover: rgba(111, 106, 58, .10);
    --nav-active: rgba(111, 106, 58, .20);
    --nav-active-ink: #1c1b17;

    --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #000;
        --surface: #14140f;
        --ink: #eeecdf;
        --muted: #9a9783;
        --line: #2c2b22;
        --accent: #aeaa7c;
        --accent-ink: #17160d;
        --accent-soft: #26251a;
        --danger: #e27b7b;
        --ok: #9fcf8a;
        --verse-bg: #3b3a1f;
        --verse-ink: #fbf8e6;
        --cue: #f08a8a;

        --nav-bg: #0d0d0a;
        --nav-top: #13130e;
        --nav-ink: #d9d6c6;
        --nav-muted: #9a9783;
        --nav-line: #24231c;
        --nav-hover: rgba(174, 170, 124, .10);
        --nav-active: rgba(174, 170, 124, .20);
        --nav-active-ink: #f4f2e6;

        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #000;
    --surface: #14140f;
    --ink: #eeecdf;
    --muted: #9a9783;
    --line: #2c2b22;
    --accent: #aeaa7c;
    --accent-ink: #17160d;
    --accent-soft: #26251a;
    --danger: #e27b7b;
    --ok: #9fcf8a;
    --verse-bg: #3b3a1f;
    --verse-ink: #fbf8e6;
    --cue: #f08a8a;

    --nav-bg: #0d0d0a;
    --nav-top: #13130e;
    --nav-ink: #d9d6c6;
    --nav-muted: #9a9783;
    --nav-line: #24231c;
    --nav-hover: rgba(174, 170, 124, .10);
    --nav-active: rgba(174, 170, 124, .20);
    --nav-active-ink: #f4f2e6;

    color-scheme: dark;
}

/* The page background fills the whole window, including behind the nav column on small screens. */
html, body {
    background: var(--bg);
    color: var(--ink);
}

/* Theme button (Components/ThemeToggle.razor). Shows the current choice. */
.qz-theme-toggle {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: 10px;
    min-height: 44px;
    padding: 0 14px;
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.qz-theme-toggle .tt-dark,
.qz-theme-toggle .tt-light,
:root[data-theme="dark"] .qz-theme-toggle .tt-auto,
:root[data-theme="light"] .qz-theme-toggle .tt-auto {
    display: none;
}

:root[data-theme="dark"] .qz-theme-toggle .tt-dark,
:root[data-theme="light"] .qz-theme-toggle .tt-light {
    display: inline;
}

/* ---------------------------------------------------------------------------
   Shared look for the Home, Access denied, Manage members, Error and Not found
   pages. Classes are prefixed qz- so they don't collide with Bootstrap.
   --------------------------------------------------------------------------- */
.qz-theme {
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.45 var(--sans);
    min-height: 100vh;
}

.qz-theme *, .qz-theme *::before, .qz-theme *::after {
    box-sizing: border-box;
}

.qz-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 16px 40px;
    display: grid;
    gap: 16px;
}

.qz-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    display: grid;
    gap: 14px;
    min-width: 0;
}

.qz-card h2 {
    font: 600 1.1rem var(--serif);
    margin: 0;
}

.qz-card p {
    margin: 0;
}

.qz-muted {
    color: var(--muted);
}

.qz-theme label, .qz-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    display: block;
    margin-bottom: 6px;
}

.qz-input {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    min-height: 48px;
}

select.qz-input {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    padding-right: 36px;
}

.qz-input:disabled {
    opacity: .6;
}

.qz-theme :focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.qz-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    color: var(--ink) !important;
    font-size: .95rem !important;
    font-weight: 400 !important;
    margin: 0 !important;
}

.qz-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.qz-row {
    display: grid;
    gap: 12px;
}

@media (min-width: 560px) {
    .qz-row {
        grid-template-columns: 1fr 1fr;
    }
}

.qz-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.qz-btn {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font: 600 .95rem var(--sans);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.qz-btn:hover {
    color: var(--ink);
}

.qz-btn.primary {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

.qz-btn.danger {
    color: var(--danger);
}

.qz-btn.small {
    min-height: 36px;
    padding: 0 12px;
    font-size: .85rem;
    border-radius: 10px;
}

.qz-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.qz-err {
    color: var(--danger);
    font-size: .9rem;
    margin: 0;
}

.qz-ok {
    color: var(--ok);
    font-size: .9rem;
    margin: 0;
}

.qz-theme .validation-message {
    color: var(--danger);
    font-size: .85rem;
    margin-top: 4px;
}

.qz-pill {
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 2px 10px;
    font-weight: 600;
    font-size: .8rem;
    color: var(--ink);
    white-space: nowrap;
}

/* Printing (e.g. the quiz set page): hide the app chrome so only page content prints. */
@media print {
    .sidebar,
    .top-row,
    #blazor-error-ui,
    #components-reconnect-modal {
        display: none !important;
    }

    .content {
        padding: 0 !important;
    }
}