/* Locked play-code typeface (Lato Bold). SIL OFL 1.1 — wwwroot/fonts/OFL.txt */
@font-face {
    font-family: 'Lato';
    src: url('/fonts/Lato-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

/* Lighter green than Bootstrap btn-success — free PDF preview in Play Code Editor */
.btn-success-light {
    color: #fff;
    background-color: #5cb85c;
    border-color: #4cae4c;
}

.btn-success-light:hover:not(:disabled) {
    color: #fff;
    background-color: #4cae4c;
    border-color: #449d44;
}

.btn-success-light:focus,
.btn-success-light:active:not(:disabled) {
    color: #fff;
    background-color: #449d44;
    border-color: #398439;
}

.btn-success-light:disabled {
    color: #fff;
    background-color: #5cb85c;
    border-color: #4cae4c;
    opacity: 0.65;
}

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

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+P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iA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Info tooltip icon styling */
.info-tooltip-icon {
    cursor: help;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.info-tooltip-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
}

button.info-tooltip-icon {
    border: none;
    background: transparent;
    padding: 0;
    line-height: 1;
}

/* Click/tap bubble — attached to body in infoTip.js so table overflow cannot clip it. */
.mpc-info-tip {
    position: fixed;
    z-index: 1080;
    display: none;
    max-width: min(280px, calc(100vw - 16px));
    padding: 0.5rem 0.75rem;
    background: #212529;
    color: #fff;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    line-height: 1.35;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.mpc-info-tip.show {
    display: block;
}

[data-bs-theme="dark"] .mpc-info-tip {
    background: #e8eef6;
    color: #0a1628;
}

/* Admin report parameter fields (time zone, dates, filters) — size to content, left-aligned.
   Do not flex-grow these; they were stretching across the card. */
.admin-report-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
    justify-content: flex-start;
    margin-bottom: 1rem;
    text-align: left;
}

.admin-report-filters > div {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
}

.admin-report-filters .form-label {
    display: block;
    text-align: left;
}

.admin-report-filters .form-select,
.admin-report-filters .form-control {
    width: auto;
    max-width: 100%;
    display: block;
}

.admin-report-filters .form-select {
    width: max-content;
}

.admin-report-filters .admin-report-filter-user .form-control {
    min-width: 12rem;
}

/* Admin report result grids: wider than the viewport (horizontal scroll).
   Cells wrap after ~30 characters. CSV exports stay raw field data — do not wrap there. */
.admin-report-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.admin-report-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.admin-report-table th,
.admin-report-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: top;
    max-width: 30ch;
}

.admin-report-table th.text-nowrap,
.admin-report-table td.text-nowrap,
.admin-report-table .col-narrow {
    max-width: none;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

/* Play Code Editor: reorder arrow buttons (up/down) - no underline, muted gray */
.reorder-arrow-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    line-height: 1;
    font-size: 1.3rem;
    color: #6c757d;
    text-decoration: none;
    box-shadow: none;
}


.reorder-arrow-btn:hover:not(:disabled) {
    color: #495057;
    text-decoration: none;
}

.reorder-arrow-btn:disabled {
    color: #ced4da;
}

/* Play Code Editor: drag handle for reordering rows */
.drag-handle {
    display: inline-block;
}

.dragging-row {
    opacity: 0.5;
}

.drag-over-row {
    outline: 2px dashed #0d6efd;
    outline-offset: -2px;
}

/* Play Code Editor: description grows with text (no inner horizontal scroll when possible) */
.playcode-description-cell {
    width: 1%; /* let column shrink-wrap content in the table */
    white-space: nowrap;
}

.playcode-description-input {
    display: inline-block;
    width: auto;
    min-width: 8ch;
    max-width: min(50ch, 100%);
    /* Chromium / Safari: size the field to its value */
    field-sizing: content;
}

/* Password policy checklist (Register / Profile) */
.password-requirements {
    padding: 0.6rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
}

.password-requirements-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
    line-height: 1.35;
}

.password-requirements-list li:last-child {
    margin-bottom: 0;
}

.password-requirements .pw-req-icon {
    display: inline-block;
    min-width: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.password-requirements .pw-req-met {
    color: #198754 !important;
}

.password-requirements .pw-req-unmet {
    color: #dc3545 !important;
}

/* Wide-screen nav collapse: checkbox lives in NavMenu (isolated CSS), sidebar width lives in MainLayout.
   Global :has() is required so the parent .sidebar can shrink while leaving a hamburger rail. */
@media (min-width: 641px) {
    .sidebar:has(.navbar-toggler:checked) {
        width: 4.5rem;
    }
}

@media (min-width: 641px) and (prefers-reduced-motion: reduce) {
    .sidebar {
        transition: none;
    }
}

/*
 * Dark chrome = deep navy (Dan). Never ship Bootstrap stock near-black (#212529)
 * or pure black (#000 / #000000) as the body / elevated panel background.
 * Play-code cell colors, CardBorderColorHex, and QuestPDF output are not themed.
 */
[data-bs-theme="dark"] {
    --bs-body-color: #e8eef6;
    --bs-body-color-rgb: 232, 238, 246;
    --bs-body-bg: #0a1628;
    --bs-body-bg-rgb: 10, 22, 40;
    --bs-emphasis-color: #fff;
    --bs-emphasis-color-rgb: 255, 255, 255;
    --bs-secondary-color: rgba(232, 238, 246, 0.75);
    --bs-secondary-color-rgb: 232, 238, 246;
    --bs-secondary-bg: #0f2038;
    --bs-secondary-bg-rgb: 15, 32, 56;
    --bs-tertiary-color: rgba(232, 238, 246, 0.65);
    --bs-tertiary-color-rgb: 232, 238, 246;
    --bs-tertiary-bg: #0f2038;
    --bs-tertiary-bg-rgb: 15, 32, 56;
    --bs-dark-bg-subtle: #0f2038;
    --bs-secondary-bg-subtle: #0f2038;
    --bs-light-bg-subtle: #1a3352;
    --bs-border-color: #1a3352;
    --bs-border-color-translucent: rgba(26, 51, 82, 0.85);
    color-scheme: dark;
}

[data-bs-theme="dark"] a,
[data-bs-theme="dark"] .btn-link {
    color: #6ea8fe;
}

[data-bs-theme="dark"] a:hover,
[data-bs-theme="dark"] .btn-link:hover {
    color: #8bb9fe;
}

[data-bs-theme="dark"] .card {
    --bs-card-bg: #0f2038;
    --bs-card-cap-bg: rgba(10, 22, 40, 0.55);
    --bs-card-border-color: #1a3352;
    --bs-card-color: #e8eef6;
}

[data-bs-theme="dark"] .modal {
    --bs-modal-bg: #0f2038;
    --bs-modal-border-color: #1a3352;
    --bs-modal-color: #e8eef6;
}

[data-bs-theme="dark"] .dropdown-menu {
    --bs-dropdown-bg: #0f2038;
    --bs-dropdown-border-color: #1a3352;
    --bs-dropdown-link-color: #e8eef6;
    --bs-dropdown-link-hover-bg: #1a3352;
    --bs-dropdown-link-hover-color: #e8eef6;
}

[data-bs-theme="dark"] .offcanvas {
    --bs-offcanvas-bg: #0f2038;
    --bs-offcanvas-color: #e8eef6;
}

[data-bs-theme="dark"] .list-group {
    --bs-list-group-bg: #0f2038;
    --bs-list-group-border-color: #1a3352;
    --bs-list-group-color: #e8eef6;
}

[data-bs-theme="dark"] .accordion {
    --bs-accordion-bg: #0f2038;
    --bs-accordion-border-color: #1a3352;
    --bs-accordion-color: #e8eef6;
}

[data-bs-theme="dark"] .toast {
    --bs-toast-bg: rgba(15, 32, 56, 0.95);
    --bs-toast-border-color: #1a3352;
    --bs-toast-color: #e8eef6;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control-color {
    background-color: #0f2038;
    border-color: #1a3352;
    color: #e8eef6;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0f2038;
    border-color: #6ea8fe;
    color: #e8eef6;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: rgba(232, 238, 246, 0.55);
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #0f2038;
    border-color: #1a3352;
    color: #e8eef6;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #e8eef6;
    --bs-table-border-color: #1a3352;
    --bs-table-striped-bg: rgba(15, 32, 56, 0.85);
    --bs-table-striped-color: #e8eef6;
    --bs-table-hover-bg: rgba(26, 51, 82, 0.65);
    --bs-table-hover-color: #e8eef6;
}

[data-bs-theme="dark"] .password-requirements {
    border-color: #1a3352;
    background-color: #0f2038;
}

[data-bs-theme="dark"] .site-footer {
    border-top-color: #1a3352;
}

[data-bs-theme="dark"] .page,
[data-bs-theme="dark"] main,
[data-bs-theme="dark"] article.content {
    background-color: #0a1628;
    color: #e8eef6;
}

/*
 * Bootstrap .bg-light keeps --bs-light (#f8f9fa) in dark theme, so body text (#e8eef6)
 * on Home How It Works / feature bands is unreadable. Map those chrome panels to the
 * navy elevated token. Do not remap --bs-light itself — Home CTA .btn-light must stay light.
 */
[data-bs-theme="dark"] .bg-light {
    background-color: #0f2038 !important;
}

[data-bs-theme="dark"] .reorder-arrow-btn {
    color: #adb5bd;
}

[data-bs-theme="dark"] .reorder-arrow-btn:hover:not(:disabled) {
    color: #e8eef6;
}

[data-bs-theme="dark"] .reorder-arrow-btn:disabled {
    color: #1a3352;
}

/* Card format picker (signed-in editor + guest /try) */
.card-format-thumb-label {
    white-space: nowrap;
    line-height: 1.25;
}
.card-format-thumb-description .card-format-thumb-label {
    font-size: 0.75rem;
}
.card-format-thumb {
    min-height: 100%;
    padding: 0.5rem 0.35rem;
    border: 2px solid #ced4da;
    background: #fff;
    text-align: center;
    --bs-btn-hover-color: inherit;
    --bs-btn-hover-bg: #f8f9fa;
    --bs-btn-hover-border-color: #86b7fe;
    --bs-btn-active-color: inherit;
    --bs-btn-active-bg: #fff;
    --bs-btn-active-border-color: #ced4da;
}
.card-format-thumb:hover:not(:disabled):not(.card-format-thumb-selected) {
    border-color: #86b7fe;
    color: var(--bs-body-color, #212529);
}
.card-format-thumb.card-format-thumb-free {
    background: #d1e7dd;
    --bs-btn-hover-bg: #c4dfd4;
    --bs-btn-active-bg: #d1e7dd;
}
.card-format-thumb.card-format-thumb-free:hover:not(:disabled):not(.card-format-thumb-selected) {
    background: #c4dfd4;
    color: var(--bs-body-color, #212529);
}
.card-format-thumb.card-format-thumb-description {
    border-color: #0d9488;
    --bs-btn-hover-border-color: #0f766e;
    --bs-btn-active-border-color: #0d9488;
}
.card-format-thumb.card-format-thumb-description:hover:not(:disabled):not(.card-format-thumb-selected) {
    border-color: #0f766e;
    color: var(--bs-body-color, #212529);
}
.card-format-thumb.card-format-thumb-selected,
.card-format-thumb.card-format-thumb-selected:hover,
.card-format-thumb.card-format-thumb-selected:focus,
.card-format-thumb.card-format-thumb-selected:active,
.card-format-thumb.card-format-thumb-selected:active:focus {
    box-shadow: 0 0 0 3px #0d6efd;
}
.card-format-thumb.card-format-thumb-selected:not(.card-format-thumb-free) {
    background: #fff;
    --bs-btn-hover-bg: #fff;
    --bs-btn-active-bg: #fff;
}
.card-format-thumb.card-format-thumb-selected.card-format-thumb-free {
    background: #d1e7dd;
    --bs-btn-hover-bg: #d1e7dd;
    --bs-btn-active-bg: #d1e7dd;
}
.card-format-thumb.card-format-thumb-selected:not(.card-format-thumb-description) {
    border-color: #0d6efd;
    --bs-btn-hover-border-color: #0d6efd;
    --bs-btn-active-border-color: #0d6efd;
}
.card-format-thumb.card-format-thumb-locked,
.card-format-thumb.card-format-thumb-locked:disabled {
    opacity: 0.5;
    filter: grayscale(0.7);
    cursor: not-allowed;
    background: #e9ecef;
    --bs-btn-hover-bg: #e9ecef;
    --bs-btn-active-bg: #e9ecef;
}
[data-bs-theme="dark"] .card-format-thumb {
    background: #0f2038;
    border-color: #1a3352;
    --bs-btn-hover-bg: #152a46;
    --bs-btn-active-bg: #0f2038;
}
[data-bs-theme="dark"] .card-format-thumb.card-format-thumb-free {
    background: #163528;
    --bs-btn-hover-bg: #1c4332;
    --bs-btn-active-bg: #163528;
}
[data-bs-theme="dark"] .card-format-thumb.card-format-thumb-description {
    border-color: #2dd4bf;
    --bs-btn-hover-border-color: #5eead4;
    --bs-btn-active-border-color: #2dd4bf;
}
[data-bs-theme="dark"] .card-format-thumb.card-format-thumb-selected,
[data-bs-theme="dark"] .card-format-thumb.card-format-thumb-selected:hover,
[data-bs-theme="dark"] .card-format-thumb.card-format-thumb-selected:focus,
[data-bs-theme="dark"] .card-format-thumb.card-format-thumb-selected:active,
[data-bs-theme="dark"] .card-format-thumb.card-format-thumb-selected:active:focus {
    box-shadow: 0 0 0 3px #6ea8fe;
}
[data-bs-theme="dark"] .card-format-thumb.card-format-thumb-selected:not(.card-format-thumb-free) {
    background: #0f2038;
    --bs-btn-hover-bg: #0f2038;
    --bs-btn-active-bg: #0f2038;
}
[data-bs-theme="dark"] .card-format-thumb.card-format-thumb-selected.card-format-thumb-free {
    background: #163528;
    --bs-btn-hover-bg: #163528;
    --bs-btn-active-bg: #163528;
}
[data-bs-theme="dark"] .card-format-thumb.card-format-thumb-selected:not(.card-format-thumb-description) {
    border-color: #6ea8fe;
    --bs-btn-hover-border-color: #6ea8fe;
    --bs-btn-active-border-color: #6ea8fe;
}
[data-bs-theme="dark"] .card-format-thumb.card-format-thumb-locked,
[data-bs-theme="dark"] .card-format-thumb.card-format-thumb-locked:disabled {
    background: #152033;
    --bs-btn-hover-bg: #152033;
    --bs-btn-active-bg: #152033;
}
.playcode-live-preview {
    color-scheme: light;
    background: #fff;
    padding: 0.35rem;
    border-radius: 0.25rem;
}
.playcode-live-preview svg {
    display: block;
    max-width: 100%;
    height: auto;
}
.card-format-thumb-svg {
    display: flex;
    justify-content: center;
    margin-bottom: 0.35rem;
    min-height: 70px;
    align-items: center;
}
.card-format-thumb-svg svg {
    max-width: 100%;
    height: auto;
}
.card-format-selected-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.4rem;
}
.card-format-selected-copy {
    flex: 0 0 auto;
    text-align: left;
    min-width: 4.5rem;
}
.card-format-selected-graphic {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}
.card-format-selected-graphic svg {
    max-width: 100%;
    height: auto;
}
.collapsible-section-header {
    cursor: pointer;
    user-select: none;
}
.collapsible-section-header:hover {
    background-color: rgba(0, 0, 0, 0.03);
}
[data-bs-theme="dark"] .collapsible-section-header:hover {
    background-color: rgba(255, 255, 255, 0.06);
}
.collapsible-section-header:focus {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}




