/*
 * Ardoise — les pages de gestion (connexion, classes, fiches élèves,
 * compte, administration).
 *
 * Elles portent le THÈME DE L'APPLICATION D'ORIGINE : classe.css (copie conforme de l'original) est chargée avant
 * cette feuille et fournit les variables (--navy, --cream, --coral…), les
 * polices (Baloo 2, Nunito), l'en-tête `header.topbar`, les boutons
 * `.btn-coral` / `.btn-outline` / `.btn-navy` et les cartes `.card`.
 *
 * Ce fichier ne fait qu'ajouter ce que l'original n'avait pas — formulaires,
 * tableaux de gestion, notices — dans ce même vocabulaire.
 */

/* ── Structure ──────────────────────────────────────────────────────────── */

main.shell--narrow {
    max-width: 760px;
}

header.topbar a.brand {
    color: white;
    text-decoration: none;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    font-size: 21px;
    letter-spacing: 0.2px;
}

header.topbar nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

header.topbar nav form {
    margin: 0;
}

header.topbar .btn-ghost[aria-current="page"] {
    background: white;
    color: var(--navy);
}

a.btn {
    text-decoration: none;
    display: inline-block;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-header h1 {
    margin: 0;
    font-size: 28px;
    color: var(--navy);
    line-height: 1.15;
}

.page-header__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lede {
    margin: 6px 0 0;
    color: var(--ink-soft);
    max-width: 640px;
    font-weight: 600;
}

.overline {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.back {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--navy);
    font-weight: 700;
    text-decoration: none;
}

.back::before {
    content: "← ";
}

.section {
    margin-top: 22px;
}

h2 {
    font-size: 20px;
    color: var(--navy);
    margin: 0 0 12px;
}

h3 {
    color: var(--navy);
    margin: 0 0 10px;
}

.card + .card {
    margin-top: 16px;
}

.card--danger {
    border: 2px solid var(--coral-soft);
}

.grid {
    display: grid;
    gap: 14px;
}

.grid--cards {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.grid--students {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* ── Classes et élèves ──────────────────────────────────────────────────── */

.class-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    transition: transform .12s ease, border-color .12s ease;
}

.class-tile:hover {
    transform: translateY(-2px);
    border-color: var(--green);
}

.class-tile__title {
    font-family: 'Baloo 2', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--navy);
}

.student {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    transition: transform .12s ease, border-color .12s ease;
}

a.student:hover {
    transform: translateY(-2px);
    border-color: var(--green);
}

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--line);
    background: var(--cream);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Baloo 2', sans-serif;
    font-size: 30px;
    font-weight: 800;
    color: var(--navy);
}

.avatar--lg {
    width: 120px;
    height: 120px;
}

.student__name {
    font-weight: 800;
}

.board-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: var(--green-soft);
}

.board-cta p {
    margin: 4px 0 0;
    color: var(--ink-soft);
    font-weight: 600;
}

/* ── Boutons (compléments à ceux de l'original) ─────────────────────────── */

.btn-danger {
    background: #C8553D;
    color: white;
}

.btn-danger:hover {
    opacity: 0.92;
}

.btn-outline {
    display: inline-block;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 16px;
}

.actions--inline {
    margin: 0;
    flex-wrap: nowrap;
}

.actions--inline select {
    width: auto;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* ── Formulaires ────────────────────────────────────────────────────────── */

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.field label,
.label {
    font-weight: 800;
    font-size: 13.5px;
    color: var(--navy);
}

.field__hint {
    font-size: 12.5px;
    color: var(--ink-soft);
    font-weight: 600;
}

.field__error {
    font-size: 12.5px;
    color: #C8553D;
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input:not([type]),
select,
textarea {
    font-family: 'Nunito', sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    padding: 10px 14px;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink);
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--navy-soft);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--ink-soft);
    margin: 6px 0;
}

.check input {
    width: 18px;
    height: 18px;
}

.code-input {
    font-family: 'Baloo 2', sans-serif;
    font-size: 24px;
    letter-spacing: 4px;
    max-width: 200px;
}

.rows {
    display: grid;
    gap: 8px;
}

.row {
    display: grid;
    gap: 8px;
    align-items: start;
}

.row--2 {
    grid-template-columns: 1fr;
}

.row--3 {
    grid-template-columns: 80px 1fr;
}

.row--field {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .row--field {
        grid-template-columns: 1fr 180px 1fr;
    }
}

.row__head {
    font-size: 12px;
    color: var(--ink-soft);
    font-weight: 800;
}

/* ── Tableaux de gestion ────────────────────────────────────────────────── */

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

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

table.list th,
table.list td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

table.list th {
    font-size: 12.5px;
    color: var(--ink-soft);
    font-weight: 800;
}

table.list tbody tr:last-child td {
    border-bottom: none;
}

/* ── Étiquettes, notices, absence ───────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--cream);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge--ok {
    background: var(--green-soft);
    color: var(--green);
}

.badge--warning {
    background: var(--amber-soft);
    color: #7A5410;
}

.notice {
    margin: 0 0 18px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--home-soft);
    color: var(--ink);
    font-weight: 700;
}

.notice--success {
    background: var(--green-soft);
}

.notice--warning {
    background: var(--amber-soft);
}

.notice--danger {
    background: var(--coral-soft);
}

.notice ul {
    margin: 0;
    padding-left: 18px;
}

.empty {
    text-align: center;
    padding: 36px 18px;
    color: var(--ink-soft);
    font-weight: 600;
}

.empty__title {
    display: block;
    font-family: 'Baloo 2', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
}

.empty__title::before {
    content: "🌱 ";
}

.qr {
    display: inline-block;
    padding: 12px;
    background: white;
    border-radius: var(--radius-sm);
}

.qr svg {
    display: block;
    width: 190px;
    height: 190px;
}

.codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
    padding: 0;
    list-style: none;
    font-family: ui-monospace, Menlo, monospace;
    font-weight: 700;
}

.mono {
    font-family: ui-monospace, Menlo, monospace;
}

.muted {
    color: var(--ink-soft);
}

.small {
    font-size: 13px;
}

.espace-avant {
    margin-top: 16px;
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 16px;
    top: 16px;
    padding: 8px 12px;
    background: var(--paper);
    z-index: 100;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

details > summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--navy);
    padding: 6px 0;
}

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--amber);
    outline-offset: 2px;
}
