/* ---------- Global ---------- */
html, body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
}

.page-title {
    font-weight: 700;
}

.app-title {
    font-weight: 700;
    letter-spacing: .01em;
}

.lang-switch {
    font-weight: 700;
    letter-spacing: .05em;
}

.user-button {
    text-transform: none;
}

.nav-menu {
    padding-top: 8px;
}

.drawer-build {
    padding: 8px 16px 12px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.signout-form {
    margin: 0;
}

.signout-button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
}

.signout-button:hover {
    background: var(--mud-palette-action-default-hover);
}

/* ---------- Static auth pages (sign-in, invite) ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: #F5F7FA;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(31, 51, 73, .12);
    padding: 32px 28px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #2F5D8A;
    margin-bottom: 20px;
}

.auth-brand-icon {
    font-size: 1.8rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.auth-lead {
    color: #5c6b7a;
    margin: 0 0 20px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: .9rem;
}

.auth-input {
    font: inherit;
    font-weight: 400;
    padding: 10px 12px;
    border: 1px solid #c9d2dc;
    border-radius: 8px;
}

.auth-input:focus {
    outline: 2px solid #2F5D8A;
    outline-offset: 1px;
    border-color: #2F5D8A;
}

.auth-code {
    font-family: 'Consolas', 'Courier New', monospace;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
}

.auth-button {
    margin-top: 6px;
    padding: 12px;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: #2F5D8A;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.auth-button:hover {
    background: #244a6e;
}

.auth-error {
    padding: 10px 12px;
    border-radius: 8px;
    background: #fdecea;
    color: #8a1c13;
    font-size: .9rem;
}

.auth-validation {
    color: #b3261e;
    font-size: .8rem;
    font-weight: 400;
}

.auth-alt {
    margin: 20px 0 0;
    font-size: .9rem;
}

.auth-alt a, .auth-footer a {
    color: #2F5D8A;
}

.auth-demo {
    margin-top: 20px;
    padding: 12px 14px;
    border: 1px dashed #c9d2dc;
    border-radius: 8px;
    font-size: .85rem;
    color: #3d4b59;
}

.auth-demo summary {
    cursor: pointer;
}

/* Demo site: "Explore as …" buttons above the password form. */
.auth-explore {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-explore-lead {
    margin: 0 0 4px;
    font-size: .9rem;
    color: #3d4b59;
}

.auth-explore-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #c9d2dc;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.auth-explore-button:hover, .auth-explore-button:focus-visible {
    border-color: #2F5D8A;
    background: #eef3f8;
}

.auth-explore-button .material-icons {
    color: #2F5D8A;
}

.auth-explore-text {
    display: flex;
    flex-direction: column;
}

.auth-explore-text strong {
    color: #2F5D8A;
}

.auth-explore-text small {
    color: #5c6b7a;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0 16px;
    font-size: .85rem;
    color: #5c6b7a;
}

.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #dde3ea;
}

.auth-demo-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-demo ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.auth-footer {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    font-size: .8rem;
    color: #5c6b7a;
}

/* ---------- Blazor error bar ---------- */
#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;
}

/* ---------- Dismissal board ---------- */
.board-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.board-class-filter {
    min-width: 220px;
    max-width: 420px;
}

.board-column {
    border-radius: 12px;
    padding: 12px;
    min-height: 240px;
    background: #eef2f7;
    /* Cards switch to one row (buttons on the right) when the column is wide enough: see @container below. */
    container-type: inline-size;
}

.column-waiting { background: #fff6e5; }
.column-called { background: #e8f3fb; }
.column-released { background: #e9f7ee; }

.board-column-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.board-empty {
    color: #6b7785;
    padding: 24px 8px;
    text-align: center;
}

.pickup-card {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    border-left: 6px solid #c9d2dc;
    background: #fff;
}

.pickup-card.status-waiting { border-left-color: #f0a202; }
.pickup-card.status-called { border-left-color: #2f8fd4; }
.pickup-card.status-released { border-left-color: #2e9e5b; opacity: .85; }
.pickup-card.overdue { box-shadow: 0 0 0 2px #e05a4f inset; animation: pulse 2s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 2px #e05a4f inset; }
    50% { box-shadow: 0 0 0 4px #e05a4f inset; }
}

.pickup-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.pickup-guardian {
    font-weight: 700;
    font-size: 1.1rem;
}

.pickup-note {
    color: #3d4b59;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pickup-elapsed {
    white-space: nowrap;
    font-weight: 600;
    color: #5c6b7a;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pickup-children {
    margin: 8px 0 4px;
}

.pickup-child {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.pickup-child-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.pickup-door {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #2f8fd4;
    font-weight: 600;
}

.pickup-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.pickup-released-at {
    color: #5c6b7a;
    font-size: .85rem;
    margin-top: 4px;
}

/* The same parent's children at another stage (their card is in another column). */
.pickup-elsewhere {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 6px;
    font-size: .85rem;
    color: var(--mud-palette-text-secondary);
}

.pickup-elsewhere-child {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Board mode: a wall screen in the hallway. The board alone, full screen: no app bar, no side menu
   (the class is set on <html> by QueueBoard.razor.js). */
html.board-fullscreen .mud-appbar,
html.board-fullscreen .mud-drawer,
html.board-fullscreen .mud-drawer-overlay {
    display: none !important;
}

html.board-fullscreen .mud-main-content {
    padding-top: 0 !important;
    margin-left: 0 !important;
}

/* A wide column (a laptop, a wall screen): the buttons sit to the right of the names instead of on a row of their
   own, so a card is two lines high (parent, child) and a 1080p screen holds 8+ cards per column. */
@container (min-width: 480px) {
    .pickup-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 12px;
        align-items: center;
    }

    .pickup-card > * { grid-column: 1; }

    .pickup-card > .pickup-actions {
        grid-column: 2;
        grid-row: 1 / span 4;
        margin-top: 0;
        flex-wrap: nowrap;
    }

    .pickup-card-head { justify-content: flex-start; align-items: baseline; gap: 12px; }
    /* One line per name, however long: a wrapped name would make the card a line taller. */
    .pickup-card-head > div:first-child { min-width: 0; }
    .pickup-guardian { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pickup-children { margin: 2px 0 0; }
    .pickup-child { padding: 1px 0; }
}

/* Board mode: tighter frame, big names (children read them from across the hallway). */
html.board-fullscreen .mud-main-content > div { padding: 12px 16px !important; }
.board-mode .board-toolbar { margin-bottom: 4px; }
.board-mode .board-toolbar .page-title { font-size: 1.75rem; }
.board-mode .board-column { padding: 10px; }
.board-mode .board-column-title { font-size: 1.4rem; margin-bottom: 8px; }
.board-mode .pickup-card { padding: 8px 14px; margin-bottom: 8px; }
.board-mode .pickup-guardian { font-size: 1.35rem; line-height: 1.3; }
.board-mode .pickup-child-name { font-size: 1.4rem; line-height: 1.3; }

/* ---------- Parent: I'm here ---------- */
.pickup-children-select {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pickup-child-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #c9d2dc;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
}

.pickup-child-option.selected {
    border-color: #2F5D8A;
    background: #eef3f9;
}

.pickup-child-option-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.pickup-big-button {
    height: 64px;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 14px;
}

.pickup-status {
    border-radius: 16px;
    padding: 24px 20px;
    border-top: 8px solid #f0a202;
}

.pickup-status.status-called { border-top-color: #2f8fd4; }
.pickup-status.status-released { border-top-color: #2e9e5b; }

.pickup-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.pickup-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #a3adb8;
    font-size: .85rem;
    font-weight: 600;
}

.pickup-step.reached { color: #2F5D8A; }
.pickup-step.active { color: #2f8fd4; transform: scale(1.1); }

.pickup-step-line {
    flex: 1;
    height: 3px;
    background: #dde3ea;
    margin: 0 8px 20px;
}

.pickup-headline {
    font-weight: 800;
}

.pickup-status-children {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pickup-status-child {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    background: #f5f7fa;
    border-radius: 12px;
}

.pickup-status-child-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.pickup-status-door {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #e8f3fb;
    border-radius: 10px;
}

.pickup-status-door-name {
    font-weight: 800;
    font-size: 1.2rem;
    color: #1f5f8f;
}

.pickup-status-meta {
    margin-top: 16px;
    color: #5c6b7a;
    font-size: .9rem;
}

/* ---------- History ---------- */
.history-toolbar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    max-width: 560px;
}

.history-table .mud-table-cell {
    white-space: nowrap;
}

/* ---------- Admin ---------- */
.invite-code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: .25em;
    text-align: center;
    padding: 12px;
    border: 2px dashed #2F5D8A;
    border-radius: 10px;
    color: #2F5D8A;
    background: #eef3f9;
}

/* Demo site only: the parent's "start over" button. */
.demo-reset {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 12px;
    border-top: 1px dashed var(--mud-palette-lines-default);
    font-size: .8rem;
}
