/* ====================================================================
   Correcto — styles de l'espace abonné (/app/).
   Complète style.css (variables, body, champs, boutons, alertes).
   ==================================================================== */

/* --- En-tête applicatif --- */
.app-header {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.app-header-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 20px;
    flex-wrap: wrap;
}
.app-header .wordmark {
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -0.5px;
    color: var(--c-primary);
}
.app-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}
.app-nav a {
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-muted);
}
.app-nav a:hover { background: var(--c-bg); text-decoration: none; }
.app-nav a.active { background: var(--c-primary); color: #fff; }
.app-nav .logout { color: var(--c-error); }

/* --- Conteneur principal --- */
.app-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 20px 64px;
}
.page-title { font-size: 23px; margin-bottom: 4px; }
.page-intro { color: var(--c-muted); font-size: 14px; margin-bottom: 24px; }

/* --- Cartes --- */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px;
}
.card + .card { margin-top: 18px; }
.card h2 { font-size: 16px; margin-bottom: 14px; }
.card h3 { font-size: 14px; margin-bottom: 10px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* --- Statistiques (gros chiffre + libellé) --- */
.stat { text-align: center; }
.stat .value { font-size: 30px; font-weight: 800; color: var(--c-text); }
.stat .label { font-size: 12px; color: var(--c-muted); margin-top: 2px; }

/* --- Pastilles de crédits / badges --- */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-blue   { background: #eff6ff; color: #1d4ed8; }
.badge-green  { background: var(--c-success-bg); color: var(--c-success); }
.badge-amber  { background: #fffbeb; color: #b45309; }
.badge-gray   { background: #f3f4f6; color: #4b5563; }
.badge-red    { background: var(--c-error-bg); color: var(--c-error); }

.credit-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--c-border);
    font-size: 14px;
}
.credit-line:last-child { border-bottom: none; }
.credit-total {
    font-weight: 800;
    font-size: 17px;
}

/* --- Boutons : variantes --- */
.btn-inline {
    display: inline-block;
    width: auto;
    padding: 10px 18px;
}
.btn-secondary {
    background: var(--c-surface);
    color: var(--c-primary);
    border: 1px solid var(--c-border);
}
.btn-secondary:hover { background: var(--c-bg); }
.btn-danger { background: var(--c-error); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 13px; width: auto; display: inline-block; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- Tableaux --- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--c-border);
}
.table th { font-size: 12px; color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.table tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Champs : compléments --- */
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--c-text);
    resize: vertical;
    min-height: 120px;
}
textarea:focus, select:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: var(--c-surface);
    color: var(--c-text);
}

/* --- Badge passif « note à vérifier » (écart barème saisi vs IA) --- */
.coherence-alert {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #d97706;
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 14px;
    color: #92400e;
}
.coherence-alert-hint {
    margin-top: 6px;
    font-size: 13px;
    color: #b45309;
}

/* --- Résultat de correction --- */
.note-hero {
    text-align: center;
    padding: 18px;
    background: #eff6ff;
    border-radius: var(--radius);
}
.note-hero .note-sur-20 { font-size: 40px; font-weight: 800; color: var(--c-primary); }
.note-hero .note-detail { font-size: 13px; color: var(--c-muted); }

.crit-list { list-style: none; }
.crit-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--c-border);
}
.crit-list li:last-child { border-bottom: none; }
.crit-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-weight: 600;
    font-size: 14px;
}
.crit-head .pts { color: var(--c-primary); white-space: nowrap; }
.crit-comment { font-size: 13px; color: var(--c-muted); margin-top: 4px; }

.pill-list { list-style: none; }
.pill-list li {
    font-size: 14px;
    padding: 6px 0 6px 20px;
    position: relative;
}
.pill-list li::before {
    content: "";
    position: absolute;
    left: 4px; top: 13px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--c-primary);
}

/* --- Barres de répartition (statistiques) --- */
.bar-row { margin-bottom: 12px; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.bar-track { background: var(--c-bg); border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { background: var(--c-primary); height: 100%; border-radius: 6px; }

/* --- Divers --- */
.muted { color: var(--c-muted); font-size: 14px; }
.empty-state {
    text-align: center;
    color: var(--c-muted);
    padding: 32px 16px;
    font-size: 14px;
}
.spinner {
    width: 34px; height: 34px;
    border: 3px solid var(--c-border);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    margin: 18px auto;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.section-sep { margin-top: 26px; }
.inline-link { font-size: 14px; }
.hint-block {
    background: var(--c-bg);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--c-muted);
}

/* --- Bandeau de flag (avertissement de sécurité) --- */
.flag-banner {
    text-align: center;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
}
.flag-banner.flag-orange {
    background: #fffbeb;
    color: #b45309;
    border-bottom: 1px solid #fde68a;
}
.flag-banner.flag-red,
.flag-banner.flag-black {
    background: var(--c-error-bg);
    color: var(--c-error);
    border-bottom: 1px solid #fecaca;
}

/* --- Impression d'une correction --- */
@media print {
    .app-header, .no-print { display: none !important; }
    .app-main { padding: 0; }
    .card { border: none; padding: 0; }
}
