:root {
    /* --- Charte Synia --- */
    --navy: #0B1327;
    --navy-soft: #1c2742;
    --mint: #90E9DE;
    --mint-soft: #c5f3ee;
    --white: #FFFFFF;
    --grey: #D9D9D9;
    /* gris de fond de la charte */

    --ink: #0B1327;
    --muted: #6b7585;
    --line: #e4e8f0;
    --bg: #eef1f6;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(11, 19, 39, 0.08);
    --font: "Work Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* L'attribut `hidden` doit TOUJOURS l'emporter. Sans ceci, la moindre règle
   `display:` sur un sélecteur (ex. `main { display: flex }`) le neutralise
   silencieusement : l'application resterait affichée derrière l'écran de
   connexion. Règle globale plutôt que rustine par sélecteur. */
[hidden] {
    display: none !important;
}

body {
    font-family: var(--font);
    font-weight: 500;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    padding: 0 0 40px;
    overflow-x: hidden; /* garde-fou anti-scroll latéral */
}

/* ===== Header / marque ===== */
header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 24px;
    padding: 12px 24px;
    background: radial-gradient(120% 340% at 50% -140%, var(--navy-soft) 0%, var(--navy) 60%);
    color: var(--white);
    overflow: hidden;
}

header::after {
    /* liseré mint signature en bas du header */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--mint);
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 0;           /* les deux flancs de même largeur -> titre vraiment centré */
}

.brand-logo {
    width: 28px;
    height: 28px;
}

.brand-name {
    font-weight: 900;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--white);
}

header h1 {
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--white);
    white-space: nowrap;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
}

/* ===== Dropzone ===== */
#dropzone {
    display: block;
    border: 2px dashed #c3cee0;
    border-radius: var(--radius);
    padding: 44px 20px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

#dropzone:hover,
#dropzone.dragover {
    background: var(--mint-soft);
    border-color: var(--mint);
}

.dropzone-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.dz-icon {
    color: var(--navy);
}

.dz-icon svg {
    width: 38px;
    height: 38px;
}

#dz-text {
    font-weight: 600;
    color: var(--navy);
}

.file-name {
    font-weight: 700;
    color: var(--navy);
}

/* ===== Boutons ===== */
button {
    font-family: var(--font);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.05s, background 0.15s, color 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button svg {
    width: 18px;
    height: 18px;
}

button:active:not(:disabled) {
    transform: translateY(1px);
}

/* Action principale : mint sur navy (pop de la charte) */
.btn-primary {
    margin-top: 18px;
    width: 100%;
    background: var(--mint);
    color: var(--navy);
    border: 2px solid var(--mint);
    padding: 13px 22px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--mint-soft);
    border-color: var(--mint-soft);
}

.btn-primary:disabled {
    background: #d4dae6;
    border-color: #d4dae6;
    color: #8a93a4;
    cursor: not-allowed;
}

/* Bouton posé sur le bandeau navy. « Se déconnecter » était un lien souligné :
   rien ne le distinguait d'un texte, alors que c'est une action. */
.btn-ghost {
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    padding: 5px 11px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Bouton secondaire à bordure (style "BOOK YOUR DEMO" de la charte) */
.btn-outline {
    background: transparent;
    color: var(--navy);
    border: 2px solid var(--navy);
    padding: 10px 18px;
}

.btn-outline:hover {
    background: var(--navy);
    color: var(--white);
}

/* ===== Statut ===== */
.status {
    padding: 16px 18px;
    border-radius: var(--radius);
    font-weight: 600;
}

/* Une carte, alignée à gauche comme le reste de la page : le bandeau vert centré
   ne disait que « ça tourne », sans dire où on en était ni combien de temps. */
.status.loading {
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    color: var(--ink);
    font-weight: 500;
}

.status.error {
    background: #fde8e8;
    color: #9b1c1c;
    text-align: left;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--navy);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Édition par l'expert ===== */
/* Les contrôles ne s'affichent qu'au survol ou au clavier : sur un devis de 70
   lignes, 70 boutons visibles en permanence noieraient les données. Ils restent
   atteignables au Tab, donc pas réservés à la souris. */
/* PAS de place réservée aux boutons : réserver 220 px pour des contrôles
   invisibles créait une colonne vide permanente au milieu du tableau et écrasait
   les désignations. Ils flottent par-dessus le texte, au survol seulement, sur un
   fond opaque précédé d'un dégradé pour rester lisibles. */
.cell-designation {
    position: relative;
}

.edit-designation {
    width: 100%;
    font: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 2px 6px;
    margin: -2px -6px;
}

tr:hover .edit-designation {
    border-color: #e4e8f0;
}

.edit-designation:focus {
    outline: none;
    border-color: var(--navy);
    background: var(--white);
}

.ligne-actions {
    position: absolute;
    top: 4px;
    right: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px 2px 28px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0, var(--white) 26px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
}

tr:hover .ligne-actions {
    background: linear-gradient(to right, rgba(250, 251, 253, 0) 0, #fafbfd 26px);
}

tr:hover .ligne-actions,
.cell-designation:focus-within .ligne-actions {
    opacity: 1;
    pointer-events: auto;
}

.edit-categorie,
.edit-exclure {
    font-family: inherit;
    font-size: 0.74rem;
    color: var(--muted);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 3px 7px;
    cursor: pointer;
    max-width: 130px;
}

.edit-exclure:hover {
    color: #7c2d12;
    border-color: #d9a066;
}

tr.excluded .edit-exclure:hover {
    color: #0e5c4c;
    border-color: #7fcbb8;
}

.tag.edite {
    background: #e8f0fe;
    color: #1a4b8c;
}

/* Libellé réservé aux lecteurs d'écran : un <select> sans étiquette n'est pas
   annonçable, mais l'étiquette visible alourdirait chaque ligne. */
.visuellement-cache {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 980px) {
    .cell-designation {
        padding-right: 12px;
    }

    .ligne-actions {
        position: static;
        opacity: 1;
        pointer-events: auto;
        margin-top: 6px;
    }
}

/* ===== Lot de devis : liste à gauche, détail à droite ===== */
/* Empilés verticalement, 10 devis (le dossier SITRON en compte autant) étaient
   illisibles : on ne voyait ni combien il y en avait, ni lesquels posaient
   problème. La liste répond aux deux d'un coup d'œil. */
.lot {
    display: grid;
    grid-template-columns: 296px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.lot-liste {
    position: sticky;
    top: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
}

.lot-item {
    display: block;
    width: 100%;
    text-align: left;
    font-family: inherit;
    color: var(--ink);
    background: var(--white);
    border: 0;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #f0f3f7;
    padding: 10px 13px;
    cursor: pointer;
}

.lot-item:hover {
    background: #fafbfd;
}

.lot-item.actif {
    background: var(--bg);
    border-left-color: var(--navy);
}

.lot-ligne1 {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    font-weight: 600;
}

.lot-ligne2 {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 2px;
    padding-left: 15px;
    font-size: 0.76rem;
    color: var(--muted);
}

.lot-objet {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Vert = contrôles passés, orange = écart à vérifier, rouge = lecture impossible. */
.pastille {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.pastille.ok {
    background: #0e7c66;
}

.pastille.ecart {
    background: #c2410c;
}

.pastille.ko {
    background: #b91c1c;
}

.lot-cumul {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 13px;
    background: #fafbfc;
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
    font-weight: 600;
}

/* Sous 980 px, la liste repasse au-dessus du détail. */
@media (max-width: 980px) {
    .lot {
        grid-template-columns: minmax(0, 1fr);
    }

    .lot-liste {
        position: static;
    }
}

/* ===== Avancement de l'analyse ===== */
.progress-tete {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-titre {
    font-weight: 600;
    flex-grow: 1;
}

.progress-duree {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.progress-etapes {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Jalon : fait, en cours, à venir. Une attente expliquée est deux fois plus courte. */
.etape {
    position: relative;
    padding-left: 22px;
    font-size: 0.85rem;
    color: #9aa3b2;
}

.etape::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.5em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #c3cee0;
}

.etape.faite {
    color: var(--ink);
}

.etape.faite::before {
    background: #0e7c66;
    border-color: #0e7c66;
}

.etape.en-cours {
    color: var(--ink);
    font-weight: 600;
}

.etape.en-cours::before {
    background: var(--navy);
    border-color: var(--navy);
}

/* Zone neutralisée pendant le traitement (attribut `inert` posé par le JS) : le
   grisé rend visible ce que `inert` rend vrai, plutôt que de laisser l'expert
   cliquer dans le vide. */
.verrouille {
    opacity: 0.55;
    filter: saturate(0.6);
    transition: opacity 0.15s;
}

/* Barre d'avancement : suit les jalons franchis, ou balaie en continu quand le
   serveur travaille sur un lot dont les devis avancent en parallèle. */
.progress-barre {
    height: 4px;
    border-radius: 999px;
    background: #edf1f6;
    overflow: hidden;
    margin: 14px 0 12px;
}

.progress-jauge {
    height: 100%;
    background: var(--mint);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.progress-jauge.indeterminee {
    width: 35%;
    animation: balayage 1.4s ease-in-out infinite;
}

@keyframes balayage {
    0% { margin-left: -35%; }
    100% { margin-left: 100%; }
}

.progress-titres {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

.progress-titres .details {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-patience {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

/* ===== Barre de source (zone de dépôt repliée) ===== */
.source-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 0.88rem;
}

.source-bar svg {
    width: 15px;
    height: 15px;
    color: var(--muted);
    flex: none;
}

#source-nom {
    font-weight: 600;
}

#source-meta {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-small {
    padding: 5px 11px;
    font-size: 0.8rem;
}

/* ===== Résultats ===== */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}

.result-header h2 {
    color: var(--navy);
    font-weight: 900;
    letter-spacing: -0.01em;
}

.block {
    margin-bottom: 24px;
}

.block h3 {
    color: var(--navy);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--mint);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #f0f3f7;
    text-align: left;
    vertical-align: top;
}

/* En-tête clair et COLLANT : sur un devis de 70 lignes, savoir quelle colonne
   on lit compte plus que d'afficher un bandeau navy. */
th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fafbfc;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

tbody tr:not(.section):not(.subsection):hover {
    background: #fafbfd;
}

/* Chiffres tabulaires : sans ça les colonnes de montants ondulent, chiffre à
   chiffre. C'est ce détail qui sépare un tableau lisible d'un tableau approximatif. */
.num,
td.num,
th.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Section = micro-libellé posé sur un filet, plus une bande grise pleine largeur. */
tr.section td {
    background: transparent;
    color: #9aa3b2;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.7rem;
    padding: 18px 12px 4px;
    border-bottom: 1px solid var(--line);
}

.details {
    color: var(--muted);
    font-size: 0.82rem;
    white-space: pre-line;
}

/* Sous-poste de main d'œuvre (étage 2 : découpage mécanique / électricité...) */
tr.subsection td {
    background: transparent;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.78rem;
    padding-left: 26px;
}

/* Ligne écartée du compte (étage 2 : "exclu") */
tr.excluded td {
    opacity: 0.55;
    text-decoration: line-through;
}
.cell-designation .details {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    max-width: 640px;
}

tr.excluded td .details {
    text-decoration: none;
}

.tag {
    display: inline-block;
    background: var(--grey);
    color: var(--navy);
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 0.72rem;
    font-weight: 600;
    vertical-align: middle;
}

/* Champ d'instructions libre */
#instructions-box {
    margin: 14px 0 4px;
    font-size: 0.9rem;
}
#instructions-box summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--navy);
}
#instructions {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid #cfd6e4;
    border-radius: 8px;
    font: inherit;
    font-size: 0.85rem;
    resize: vertical;
    box-sizing: border-box;
}
.btn-link {
    margin-top: 6px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.profil-etat {
    margin-top: 8px;
    padding: 8px 10px;
    background: #fdf1e6;
    color: #7c2d12;
    border-radius: 8px;
}

.instructions-actions {
    display: flex;
    gap: 16px;
}

/* Miniatures des fichiers déposés */
#file-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}
.file-tile {
    position: relative;
    width: 84px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.file-tile img,
.file-tile .pdf {
    width: 84px;
    height: 84px;
    border-radius: 8px;
    border: 1px solid var(--line);
    object-fit: cover;
    background: #fff;
}
.file-tile .pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy);
}
.file-tile .pdf svg {
    width: 34px;
    height: 34px;
}
.file-tile .name {
    font-size: 0.68rem;
    color: var(--muted);
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-tile .rm {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: var(--navy);
    color: #fff;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.file-tile .rm:hover {
    background: #9c3400;
}
#aide-instructions {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f4f6fb;
    border: 1px solid #dfe4ee;
    border-radius: 8px;
    font: inherit;
    font-size: 0.8rem;
    color: var(--muted);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Options d'analyse (moteur de lecture, multi-devis) */
#options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    align-items: center;
    margin: 14px 0 4px;
    font-size: 0.85rem;
}
#options .opt {
    display: flex;
    align-items: center;
    gap: 7px;
}
#options .opt > span {
    color: var(--muted);
}
#options select {
    font: inherit;
    padding: 4px 8px;
    border: 1px solid #cfd6e4;
    border-radius: 7px;
    background: #fff;
}
#options .checkbox {
    cursor: pointer;
}

/* Multi-devis : un bloc encadré par devis */
.devis-bloc {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
}
.devis-titre {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: var(--navy);
    border-bottom: 2px solid var(--line);
    padding-bottom: 6px;
}

/* Alerte cohérence (somme lignes ≠ total) */
/* Alerte cohérence (somme lignes ≠ total). Remontée AU-DESSUS du tableau : elle
   dit à l'expert de ne pas faire confiance aux chiffres qu'il s'apprête à lire,
   information inutile une fois qu'il les a lus. */
.warn {
    background: #fdf1e6;
    color: #7c2d12;
    border: 0;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 0 16px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.warn strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.warn .num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Contrôles passés : présent mais discret — la confiance se signale, elle ne se crie pas. */
.ok-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e7f6f2;
    color: #0e5c4c;
    border-radius: 10px;
    padding: 9px 12px;
    margin: 0 0 16px;
    font-size: 0.82rem;
}

/* Comparaison des 3 lectures */
.compare-recap {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.compare-recap th,
.compare-recap td {
    border: 1px solid var(--line);
    padding: 5px 8px;
    text-align: left;
}
.compare-diffs {
    margin: 10px 0 0;
    padding-left: 18px;
    font-size: 0.83rem;
    color: var(--muted);
}
.ok {
    color: #1c7c3c;
    font-weight: 600;
}
.ko {
    color: #9c3400;
    font-weight: 600;
}

.hint {
    margin-top: 6px;
}

/* Badge de statut par devis (multi) */
.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    vertical-align: middle;
}
.badge.ok {
    background: #e3f4e9;
    color: #1c7c3c;
}
.badge.ko {
    background: #fce4d6;
    color: #9c3400;
}
.tag.ko {
    background: #fce4d6;
    color: #9c3400;
}

/* Ligne répétée d'un devis à l'autre */
tr.doublon td {
    background: #fff6ee;
}

/* Lignes à gauche, totaux à droite et COLLANTS : sur un devis de 70 lignes, les
   totaux étaient en bas de page, donc invisibles pendant tout le travail de
   relecture. C'est pourtant ce qu'on vérifie en permanence. */
.devis-corps {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 272px;
    gap: 20px;
    align-items: start;
}

.panneau-totaux {
    position: sticky;
    top: 16px;
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
}

.panneau-totaux h3 {
    border: 0;
    margin-bottom: 8px;
    padding: 0;
}

.totaux {
    width: 100%;
}

.totaux td {
    border: none;
    padding: 5px 0;
    font-size: 0.85rem;
}

.totaux td:first-child {
    color: var(--muted);
}

.totaux tr.net td {
    font-weight: 800;
    color: var(--navy);
    font-size: 1rem;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

/* ===== Footer ===== */
.site-footer {
    max-width: 1200px;
    margin: 28px auto 0;
    padding: 0 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.site-footer strong {
    color: var(--navy);
}

/* Sous 980 px, les totaux repassent sous le tableau plutôt que de l'écraser. */
@media (max-width: 980px) {
    .devis-corps {
        grid-template-columns: minmax(0, 1fr);
    }

    .panneau-totaux {
        position: static;
    }
}
/* ===== Authentification ===== */
/* Session : dans le bandeau, à droite. Même largeur que .brand pour que le titre
   reste centré sur la page et ne se décale pas quand l'e-mail est long. */
.auth-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 1 1 0;
    min-width: 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.72);
}

#auth-user {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-bar .btn-link {
    color: var(--mint);
    flex: none;
}

/* Bandeau étroit : le titre passe à la ligne plutôt que d'écraser les flancs. */
@media (max-width: 640px) {
    header {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 6px;
    }
    header h1 {
        order: 3;
        flex-basis: 100%;
        text-align: center;
        font-size: 1.1rem;
    }
}

.auth-card {
    max-width: 420px;
    margin: 0 auto;
}

.auth-card h2 {
    margin-bottom: 4px;
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 18px;
}

.auth-card label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

.auth-card input {
    font-family: var(--font);
    font-size: 1rem;
    padding: 11px 13px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
    color: var(--ink);
}

.auth-card input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(144, 233, 222, 0.45);
}

/* Œil « afficher / masquer » posé DANS le champ. Le bouton reste hors du flux
   (absolu) pour ne pas décaler la mise en page du formulaire, et l'input se
   réserve la place à droite pour que le texte ne passe jamais dessous. */
.champ-mdp {
    position: relative;
    display: flex;
    flex-direction: column;
}

.champ-mdp input {
    padding-right: 44px;
}

.voir-mdp {
    position: absolute;
    top: 0;
    right: 0;
    height: 46px;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
}

.voir-mdp:hover {
    color: var(--navy);
}

.voir-mdp:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: -2px;
}

.voir-mdp svg {
    width: 19px;
    height: 19px;
}

.auth-card .btn-primary {
    margin-top: 6px;
}

.auth-error {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fdecec;
    color: #8a1c1c;
    font-size: 0.9rem;
}

#auth-reset {
    display: block;
    margin: 12px auto 0;
}
