/* Feuille de style du Web : écrite à la main, sans bibliothèque. Mêmes couleurs que la
   PWA, mais pensée pour un grand écran. */

:root {
    color-scheme: light dark;

    --green: #15803d;
    --green-strong: #166534;
    --red: #b91c1c;
    --ink: #0f172a;
    --muted: #475569;
    --line: #cbd5e1;
    --page: #f1f5f9;
    --surface: #ffffff;
    --info-bg: #ecfdf5;
    --error-bg: #fef2f2;
    --focus: #1d4ed8;

    --radius: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --green: #22c55e;
        --green-strong: #16a34a;
        --red: #f87171;
        --ink: #f1f5f9;
        --muted: #94a3b8;
        --line: #334155;
        --page: #0b1220;
        --surface: #162033;
        --info-bg: #10291c;
        --error-bg: #2d1518;
        --focus: #93c5fd;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ink);
    background: var(--page);
}

h1, h2, p {
    margin: 0;
}

h1 {
    font-size: 1.625rem;
    line-height: 1.25;
}

h1:focus {
    outline: none;
}

h2 {
    font-size: 1.25rem;
    line-height: 1.25;
}

a {
    color: var(--green);
    font-weight: 600;
}

/* --- Structure --- */

.app-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
}

.brand img {
    border-radius: 7px;
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 60rem;
    margin: 0 auto;
    padding: 1.5rem;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.card-narrow {
    width: 100%;
    max-width: 28rem;
    margin: 2rem auto 0;
}

.card-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.eyebrow {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.hint {
    font-size: 0.9375rem;
    color: var(--muted);
}

/* --- Formulaires --- */

form {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

label {
    font-weight: 600;
}

input:not([type="hidden"]) {
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font: inherit;
    color: inherit;
    background: var(--page);
    border: 1.5px solid var(--line);
    border-radius: 10px;
}

.code-input {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.5rem 1.125rem;
    font: inherit;
    font-weight: 700;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
}

.button-primary {
    margin-top: 0.375rem;
    color: #ffffff;
    background: var(--green-strong);
    border-color: var(--green-strong);
}

@media (prefers-color-scheme: dark) {
    .button-primary {
        color: #052e16;
    }
}

.button:disabled {
    opacity: 0.6;
    cursor: default;
}

.link {
    padding: 0.375rem 0;
    font: inherit;
    font-weight: 600;
    color: var(--green);
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
}

.secondary-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 1.5rem;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* --- Tableau des réponses --- */

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

thead th {
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

tbody th {
    font-weight: 600;
}

td {
    font-variant-numeric: tabular-nums;
}

.summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    font-size: 0.875rem;
    font-weight: 700;
    border: 1.5px solid currentColor;
    border-radius: 999px;
}

.badge-present {
    color: var(--green);
}

.badge-absent {
    color: var(--red);
}

/* --- Messages --- */

.message {
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    font-size: 0.9375rem;
}

.message-info {
    background: var(--info-bg);
}

.message-error {
    background: var(--error-bg);
    color: var(--red);
    font-weight: 600;
}

/* --- Erreur imprévue de l'application --- */

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1000;
    padding: 0.875rem 1.5rem;
    color: #ffffff;
    background: #7f1d1d;
}

#blazor-error-ui a {
    color: #ffffff;
    font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* --- Indicateur du direct --- */

.live::before {
    content: "";
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.375rem;
    border-radius: 50%;
    background: currentColor;
}

.live-on {
    color: var(--green);
    font-weight: 600;
}

.live-off {
    color: var(--muted);
}
