/* Boutons */

.bouton {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.72rem 1.35rem;
    border: 1.5px solid transparent;
    border-radius: var(--r-full);
    font-family: var(--police-texte);
    font-size: var(--t-sm);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition:
        background-color var(--duree-1) var(--sortie),
        border-color var(--duree-1) var(--sortie),
        color var(--duree-1) var(--sortie),
        box-shadow var(--duree-1) var(--sortie);
}

.bouton:active {
    transform: translateY(1px);
}

.bouton:disabled,
.bouton[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

.bouton--plein {
    background: var(--remplissage);
    color: var(--sur-remplissage);
}

.bouton--plein:hover {
    background: var(--remplissage-survol);
}

.bouton--fantome {
    border-color: var(--texte-fort);
    color: var(--texte-fort);
}

.bouton--fantome:hover {
    background: var(--remplissage);
    border-color: var(--remplissage);
    color: var(--sur-remplissage);
}

.bouton--clair {
    background: var(--creme-logo);
    color: var(--vert-800);
}

.bouton--clair:hover {
    background: #FFFFFF;
}

.bouton--contour-clair {
    border-color: rgba(251, 235, 211, 0.55);
    color: var(--creme-logo);
}

.bouton--contour-clair:hover {
    border-color: var(--creme-logo);
    background: var(--creme-logo);
    color: var(--vert-800);
}

.bouton--terre {
    background: var(--terre-500);
    color: #FFFFFF;
}

.bouton--terre:hover {
    background: var(--terre-600);
}

.bouton--sobre {
    padding: 0.5rem 0.95rem;
    border-color: var(--trait-fort);
    color: var(--encre-doux);
    font-weight: 600;
}

.bouton--sobre:hover {
    border-color: var(--bord-accent);
    background: var(--teinte-beige-1);
    color: var(--texte-fort);
}

.bouton--danger {
    border-color: color-mix(in srgb, var(--terre-500) 50%, transparent);
    color: var(--texte-terre);
}

.bouton--danger:hover {
    border-color: var(--terre-500);
    background: var(--terre-500);
    color: #FFFFFF;
}

.bouton--large {
    padding: 0.92rem 1.75rem;
    font-size: var(--t-base);
}

.bouton--compact {
    padding: 0.42rem 0.85rem;
    font-size: var(--t-xs);
}

.bouton--bloc {
    width: 100%;
}

.bouton--icone {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0.5rem;
    border-color: var(--trait);
}

.bouton--icone:hover {
    border-color: var(--bord-accent);
    background: var(--teinte-beige-1);
}

.bouton__fleche {
    transition: transform var(--duree-2) var(--sortie);
}

.bouton:hover .bouton__fleche {
    transform: translateX(3px);
}

/* Liens */

.lien-souligne {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 1.75rem;
    font-weight: 700;
    color: var(--texte-vert);
    text-decoration: underline;
    text-decoration-color: var(--vert-400);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
    transition: color var(--duree-1);
}

.lien-souligne:hover {
    color: var(--texte-fort);
}

.lien-souligne span {
    transition: transform var(--duree-2) var(--sortie);
}

.lien-souligne:hover span {
    transform: translateX(3px);
}

.section--sombre .lien-souligne {
    color: var(--creme-logo);
}

/* Bouton qui a l'allure d'un lien (« Mot de passe oublié ? ») */
.lien-bouton {
    padding: 0.2rem 0.1rem;
    font-weight: 700;
    color: var(--texte-vert);
    text-decoration: underline;
    text-decoration-color: var(--vert-400);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    cursor: pointer;
}

.lien-bouton:hover {
    color: var(--texte-fort);
}

/* Étiquettes de statut */

.etiquette {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--r-full);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.etiquette--promo {
    background: var(--terre-500);
    color: #FFFFFF;
}

.etiquette--vendu {
    background: var(--aplat-sombre);
    color: #FFFFFF;
}

.etiquette--reserve {
    background: var(--teinte-beige-4);
    color: var(--texte-fort);
}

.etiquette--brouillon {
    border: 1px dashed var(--trait-fort);
    background: var(--surface);
    color: var(--gris);
}

.etiquette--vente {
    background: var(--teinte-vert-2);
    color: var(--texte-fort);
}

.etiquette--archive {
    background: var(--teinte-beige-3);
    color: var(--gris);
}

.etiquette--avant {
    background: var(--remplissage);
    color: var(--creme-logo);
}

/* Fiches pièces */

.grille-fiches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: clamp(1.25rem, 2.5vw, 2rem);
}

/* Trois colonnes au plus : six pièces tombent juste sur deux rangées */
.grille-fiches--trois {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19.5rem), 1fr));
}

.fiche {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--trait), 0 1px 3px rgba(29, 52, 35, 0.05);
    transition: box-shadow var(--duree-2) var(--sortie), transform var(--duree-2) var(--sortie);
}

.fiche:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 0 1px var(--trait-fort), var(--ombre-moyenne);
}

.fiche--indisponible .fiche__media img {
    filter: grayscale(0.5);
    opacity: 0.85;
}

.fiche__media-hote {
    position: relative;
}

.fiche__media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--teinte-beige-2);
}

.fiche__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fiche__marqueurs {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    pointer-events: none;
}

.fiche__coeur {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    background: var(--voile-photo);
    color: var(--gris);
    box-shadow: 0 1px 4px rgba(29, 52, 35, 0.15);
    transition: color var(--duree-1), transform var(--duree-2) var(--ressort);
}

.fiche__coeur:hover {
    color: var(--texte-terre);
    transform: scale(1.08);
}

.fiche__coeur.est-favori {
    color: var(--texte-terre);
}

.fiche__corps {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 1.15rem 1.15rem;
}

.fiche__categorie {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--texte-vert);
}

.fiche__titre {
    font-size: 1.22rem;
    font-weight: 600;
    line-height: 1.2;
}

.fiche__titre a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.fiche__resume {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: var(--t-sm);
    color: var(--gris);
}

.fiche__pied {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--e-3);
    margin-top: auto;
    padding-top: 0.65rem;
}

.fiche__reference {
    font-size: 0.78rem;
    color: var(--gris);
}

/* Prix */

.prix {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.prix__actuel {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--texte-fort);
}

.prix__actuel--promo {
    color: var(--texte-terre);
}

.prix__barre {
    font-size: var(--t-sm);
    color: var(--gris);
    text-decoration: line-through;
}

.prix--large .prix__actuel {
    font-size: clamp(1.9rem, 3.4vw, 2.4rem);
}

.prix--large .prix__barre {
    font-size: var(--t-md);
}

.image-vide {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: var(--teinte-beige-2);
    color: var(--gris);
    font-family: var(--police-main);
    font-size: 1.4rem;
}

/* Formulaires */

.champ {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.champ__label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--e-2);
    font-size: var(--t-sm);
    font-weight: 700;
    color: var(--encre-doux);
}

.champ__option {
    font-size: var(--t-xs);
    font-weight: 400;
    color: var(--gris);
}

.champ input[type="text"],
.champ input[type="email"],
.champ input[type="tel"],
.champ input[type="url"],
.champ input[type="password"],
.champ input[type="number"],
.champ input[type="search"],
.champ input[type="datetime-local"],
.champ textarea,
.champ select {
    width: 100%;
    padding: 0.72rem 0.9rem;
    background: var(--surface);
    border: 1.5px solid var(--trait-fort);
    border-radius: var(--r-sm);
    font-size: var(--t-base);
    transition: border-color var(--duree-1), box-shadow var(--duree-1);
}

.champ textarea {
    min-height: 9rem;
    resize: vertical;
    line-height: 1.6;
}

.champ select {
    appearance: none;
    padding-right: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231D3423' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.95rem center;
}

.champ input::placeholder,
.champ textarea::placeholder {
    color: var(--gris);
}

.champ input:focus,
.champ textarea:focus,
.champ select:focus {
    outline: none;
    border-color: var(--bord-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--vert-400) 28%, transparent);
}

.champ.est-invalide input,
.champ.est-invalide textarea,
.champ.est-invalide select {
    border-color: var(--terre-500);
    background: color-mix(in srgb, var(--teinte-terre) 45%, var(--surface));
}

.champ__erreur {
    min-height: 1rem;
    font-size: var(--t-xs);
    color: var(--texte-terre);
}

.champ__aide {
    font-size: var(--t-xs);
    color: var(--gris);
}

.champ-inline {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    user-select: none;
}

.bascule {
    position: relative;
    flex-shrink: 0;
    width: 2.6rem;
    height: 1.45rem;
    border: 1px solid var(--trait-fort);
    border-radius: var(--r-full);
    background: var(--teinte-beige-3);
    transition: background var(--duree-2) var(--sortie);
}

.bascule::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: var(--ombre-douce);
    transition: transform var(--duree-2) var(--sortie);
}

.champ-inline input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.champ-inline input:checked + .bascule {
    border-color: var(--vert-600);
    background: var(--vert-500);
}

.champ-inline input:checked + .bascule::after {
    transform: translateX(1.13rem);
}

.champ-inline input:focus-visible + .bascule {
    outline: 2px solid var(--bord-accent);
    outline-offset: 2px;
}

.champ-inline__texte {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.champ-inline__texte small {
    font-size: var(--t-xs);
    color: var(--gris);
}

/* Filtres, pastilles, pagination */

.filtres {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-2);
}

.puce {
    padding: 0.42rem 0.95rem;
    border: 1.5px solid var(--trait-fort);
    border-radius: var(--r-full);
    background: var(--surface);
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--encre-doux);
    white-space: nowrap;
    transition: background var(--duree-1), border-color var(--duree-1), color var(--duree-1);
}

.puce:hover {
    border-color: var(--bord-accent);
    color: var(--texte-fort);
}

.puce.est-active {
    border-color: var(--remplissage);
    background: var(--remplissage);
    color: var(--creme-logo);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--e-3);
    margin-top: var(--e-7);
}

.pagination__etat {
    padding-inline: var(--e-3);
    font-size: var(--t-sm);
    color: var(--gris);
}

/* États vides et chargement */

.etat-vide {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--e-3);
    padding: var(--e-8) var(--e-5);
    border: 1.5px dashed var(--trait-fort);
    border-radius: var(--r-lg);
    background: var(--surface);
    text-align: center;
    grid-column: 1 / -1;
}

.etat-vide__titre {
    font-family: var(--police-titre);
    font-size: var(--t-xl);
    color: var(--texte-fort);
}

.etat-vide p {
    max-width: 44ch;
    color: var(--gris);
}

.squelette {
    border-radius: var(--r-sm);
    background: linear-gradient(90deg, var(--teinte-beige-2) 25%, var(--teinte-beige-1) 45%, var(--teinte-beige-2) 65%);
    background-size: 400% 100%;
    animation: chargement 1.6s ease infinite;
}

@keyframes chargement {
    from {
        background-position: 100% 50%;
    }

    to {
        background-position: 0 50%;
    }
}

.squelette-fiche {
    overflow: hidden;
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--trait);
}

.squelette-fiche__media {
    aspect-ratio: 4 / 3;
    border-radius: 0;
}

.squelette-fiche__corps {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: var(--e-4);
}

/* Blocs génériques (administration, compte) */

.carte {
    padding: var(--e-5);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--r-md);
}

.carte--plate {
    padding: var(--e-4);
    border-radius: var(--r-sm);
}

.tableau {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--t-sm);
}

.tableau th {
    padding: 0.6rem 0.75rem;
    border-bottom: 1.5px solid var(--trait-fort);
    font-size: var(--t-xs);
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    color: var(--gris);
}

.tableau td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--trait);
    vertical-align: middle;
}

.defilant {
    overflow-x: auto;
    scrollbar-width: thin;
}

/* « Ajouter au lot » sur une carte : rond, sous le cœur */

.fiche__lot {
    position: absolute;
    top: 3.15rem;
    right: 0.6rem;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    background: var(--voile-photo);
    color: var(--gris);
    box-shadow: 0 1px 4px rgba(var(--ombre-couleur), 0.15);
    transition: color var(--duree-1), background var(--duree-1), transform var(--duree-2) var(--ressort);
}

.fiche__lot[hidden] {
    display: none;
}

.fiche__lot:hover {
    color: var(--texte-vert);
    transform: scale(1.08);
}

.fiche__lot.est-dans-le-lot {
    background: var(--remplissage);
    color: var(--sur-remplissage);
}

/* Polaroïd : photo avec marge blanche et légende manuscrite */

.polaroid {
    padding: 0.85rem 0.85rem 0;
    background: #FFFFFF;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(29, 52, 35, 0.08), 0 18px 36px -18px rgba(29, 52, 35, 0.45);
}

.polaroid img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: var(--teinte-beige-2);
}

.polaroid figcaption {
    padding: 0.55rem 0.2rem 0.7rem;
    font-family: var(--police-main);
    font-size: 1.35rem;
    line-height: 1.2;
    text-align: center;
    color: #3E4A41; /* le papier reste clair dans les deux thèmes : encre foncée fixe */
}

/* Blocs « services » et appel à l'action, partagés par plusieurs pages */

.entete-section {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--e-3) var(--e-5);
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.entete-section h2 {
    max-width: 22ch;
}

.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: clamp(1.25rem, 3vw, 2rem);
}

.services:has(> :only-child) {
    max-width: 34rem;
}

.service {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--e-3);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--r-lg);
}

.service .brin {
    color: var(--vert-400);
}

.service h3 {
    font-size: var(--t-xl);
    font-weight: 400;
}

.service p {
    color: var(--encre-doux);
}

.service .bouton {
    margin-top: auto;
}

.service p + .bouton {
    margin-top: var(--e-3);
}

.appel__grille {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-6);
}

.appel__grille > div:first-child {
    max-width: 38rem;
}

.appel__grille p {
    margin-top: var(--e-3);
    color: var(--vert-100);
}

.appel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--e-4);
}

/* Comparateur avant / après */

.comparateur {
    --position: 50%;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--r-lg);
    background: var(--teinte-beige-2);
    box-shadow: 0 0 0 1px var(--trait);
    user-select: none;
    -webkit-user-select: none;
    cursor: ew-resize;
    /* Le glissé horizontal est pour la poignée ; vers le haut ou le bas, la page défile normalement. */
    touch-action: pan-y;
}

.comparateur__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.comparateur__avant {
    position: absolute;
    inset: 0;
    clip-path: inset(0 calc(100% - var(--position)) 0 0);
}

.comparateur__trait {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--position);
    width: 3px;
    margin-left: -1.5px;
    background: #FFFFFF;
    box-shadow: 0 0 0 1px rgba(29, 52, 35, 0.15);
    pointer-events: none;
}

.comparateur__poignee {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 4px 14px rgba(29, 52, 35, 0.35);
    transform: translate(-50%, -50%);
    transition: transform var(--duree-2) var(--ressort), box-shadow var(--duree-2);
}

.comparateur:hover .comparateur__poignee {
    transform: translate(-50%, -50%) scale(1.07);
}

.comparateur.est-glisse .comparateur__poignee {
    transform: translate(-50%, -50%) scale(1.14);
    box-shadow: 0 6px 20px rgba(29, 52, 35, 0.45);
}

/* Deux petites flèches dessinées en CSS */
.comparateur__poignee::before,
.comparateur__poignee::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 0.55rem;
    height: 0.55rem;
    border-top: 2px solid var(--vert-800);
    border-left: 2px solid var(--vert-800);
}

.comparateur__poignee::before {
    left: 0.75rem;
    transform: translateY(-50%) rotate(-45deg);
}

.comparateur__poignee::after {
    right: 0.75rem;
    transform: translateY(-50%) rotate(135deg);
}

.comparateur__etiquette {
    position: absolute;
    top: 0.85rem;
    z-index: 2;
    padding: 0.2rem 0.75rem;
    border-radius: var(--r-full);
    background: var(--voile-photo);
    font-family: var(--police-main);
    font-size: 1.15rem;
    line-height: 1.3;
    color: var(--texte-fort);
    cursor: pointer;
    transition: transform var(--duree-2) var(--ressort), background var(--duree-1);
}

.comparateur__etiquette:hover {
    background: var(--creme-logo);
    color: var(--vert-800);
    transform: translateY(-1px);
}

.comparateur__etiquette--avant {
    left: 0.85rem;
}

.comparateur__etiquette--apres {
    right: 0.85rem;
}

/* Rappel discret, tant qu'on n'a pas touché au comparateur. */
.comparateur__aide {
    position: absolute;
    bottom: 0.85rem;
    left: 50%;
    z-index: 1;
    padding: 0.25rem 0.85rem;
    border-radius: var(--r-full);
    background: rgba(21, 38, 25, 0.62);
    color: #FFFFFF;
    font-size: var(--t-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
    transition: opacity var(--duree-3), transform var(--duree-3) var(--sortie);
}

.comparateur.est-manipule .comparateur__aide {
    opacity: 0;
    transform: translate(-50%, 0.4rem);
}

/* Le vrai curseur reste dans la page (clavier, lecteurs d'écran) mais ne reçoit plus la souris : c'est la scène qui s'en charge. */
.comparateur__curseur {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.comparateur:has(.comparateur__curseur:focus-visible) {
    outline: 3px solid var(--vert-400);
    outline-offset: 3px;
}

/* Photos jointes */

.depot-photos {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border: 1.5px dashed var(--trait-fort);
    border-radius: var(--r-md);
    background: var(--teinte-beige-1);
    color: var(--encre-doux);
    cursor: pointer;
    transition: border-color var(--duree-1), background var(--duree-1);
}

.depot-photos svg {
    flex-shrink: 0;
    color: var(--texte-vert);
}

.depot-photos strong {
    color: var(--texte-fort);
}

.depot-photos:hover,
.depot-photos.est-survole {
    border-color: var(--bord-accent);
    background: var(--teinte-vert-1);
}

.champ--photos:has(input:focus-visible) .depot-photos {
    outline: 2px solid var(--bord-accent);
    outline-offset: 2px;
}

.champ--photos.est-complet .depot-photos {
    display: none;
}

.apercus-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.apercus-photos[hidden] {
    display: none;
}

.apercu-photo {
    position: relative;
    width: 5.5rem;
    height: 5.5rem;
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--teinte-beige-2);
    box-shadow: 0 0 0 1px var(--trait);
}

.apercu-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.apercu-photo.est-en-cours img {
    opacity: 0.45;
}

.apercu-photo button {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--voile-photo);
    color: var(--texte-terre);
    box-shadow: 0 1px 4px rgba(29, 52, 35, 0.25);
}

.apercu-photo button:hover {
    background: var(--terre-500);
    color: #FFFFFF;
}

/* Etiquettes de statut (gestion du site et espace personnel) */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.6rem;
    border-radius: var(--r-full);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.45;
    white-space: nowrap;
}

.badge__point {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
}

.badge--vert {
    background: var(--teinte-vert-2);
    color: var(--texte-fort);
}

.badge--terre {
    background: var(--teinte-terre);
    color: var(--texte-terre);
}

.badge--gris {
    background: var(--teinte-beige-3);
    color: var(--encre-doux);
}

.badge--beige {
    border: 1px solid var(--trait-fort);
    background: var(--teinte-beige-1);
    color: var(--encre-doux);
}

.badge--noir {
    background: var(--aplat-sombre);
    color: #FFFFFF;
}

.avatar {
    display: inline-grid;
    flex-shrink: 0;
    place-items: center;
    border-radius: 50%;
    background: var(--teinte-vert-2);
    color: var(--texte-fort);
    font-family: var(--police-titre);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.avatar--s {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.7rem;
}

.avatar--m {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 0.85rem;
}

.avatar--l {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.2rem;
}

.chargement {
    display: grid;
    gap: 0.8rem;
    padding: 1rem 0;
}

.etat-vide--echec {
    border-color: color-mix(in srgb, var(--terre-500) 45%, transparent);
}

/* Formulaire : piege a robots, cases de consentement */

.formulaire__piege {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.case-consentement {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: var(--t-sm);
    line-height: 1.5;
    color: var(--encre-doux);
    cursor: pointer;
}

.case-consentement input {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.2rem;
}

.case-consentement a {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.champ.est-invalide .case-consentement {
    color: var(--texte-terre);
}

.lien-retour {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 1.75rem;
    margin-bottom: 0.6rem;
    font-size: var(--t-sm);
    font-weight: 700;
    color: var(--texte-vert);
}

.lien-retour:hover {
    color: var(--texte-fort);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Formulaire en carte et piece jointe (contact, espace personnel) */

.formulaire {
    display: grid;
    gap: var(--e-4);
    padding: clamp(1.5rem, 3vw, 2.4rem);
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--r-lg);
}

.formulaire__duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--e-4);
}

.formulaire__pied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-4);
    padding-top: var(--e-4);
    border-top: 1px solid var(--trait);
}

.formulaire__mention {
    max-width: 36ch;
    font-size: var(--t-xs);
    color: var(--gris);
}

.piece-jointe {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.85rem;
    background: var(--teinte-vert-1);
    border: 1px solid var(--bord-vert);
    border-radius: var(--r-md);
}

.piece-jointe img {
    flex-shrink: 0;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: var(--r-sm);
    object-fit: cover;
}

.piece-jointe__texte {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.piece-jointe__texte small {
    font-size: var(--t-xs);
    color: var(--texte-vert);
}

.piece-jointe__texte strong {
    display: block;
    font-size: var(--t-sm);
}

@media (max-width: 520px) {
    .formulaire__duo {
        grid-template-columns: 1fr;
    }
}

/* Messages d'erreur generaux d'un formulaire, formulaires de fenetre modale */

.acces__alerte {
    padding: 0.65rem 0.9rem;
    border: 1px solid color-mix(in srgb, var(--terre-500) 45%, transparent);
    border-radius: var(--r-sm);
    background: var(--teinte-terre);
    font-size: var(--t-sm);
    color: var(--texte-terre);
}

.formulaire-modale {
    display: grid;
    gap: var(--e-4);
}

/* Double authentification : carte d'état, clé à recopier, codes de secours */

.double-auth {
    display: grid;
    gap: var(--e-3);
}

.double-auth p {
    margin: 0;
}

.double-auth__etat {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.double-auth__alerte {
    color: var(--texte-terre);
    font-weight: 700;
}

.double-auth__obligatoire {
    border-color: var(--terre-400);
}

.double-auth__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.double-auth__etapes {
    display: grid;
    gap: var(--e-3);
    margin: 0;
    padding-left: 1.25rem;
    list-style: decimal;
    font-size: var(--t-sm);
    line-height: 1.55;
}

.double-auth__etapes li::marker {
    font-weight: 700;
    color: var(--texte-vert);
}

.double-auth__etapes .double-auth__cle,
.double-auth__etapes .double-auth__actions,
.double-auth__etapes .double-auth__qr {
    margin-top: 0.5rem;
}

/* Le code QR reste noir sur blanc, même en thème sombre : les applications le lisent mal autrement. */
.double-auth__qr {
    width: min(100%, 13.5rem);
    padding: 0.35rem;
    border: 1px solid var(--trait-fort);
    border-radius: var(--r-sm);
    background: #fff;
    line-height: 0;
}

.double-auth__qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.double-auth__cle {
    padding: 0.65rem 0.85rem;
    border: 1px dashed var(--trait-fort);
    border-radius: var(--r-sm);
    background: var(--fond);
    /* Chasse fixe : on recopie lettre à lettre, aucune hésitation possible entre deux caractères. */
    font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: var(--t-base);
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.6;
    color: var(--encre);
    overflow-wrap: anywhere;
    user-select: all;
}

.double-auth__codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1.25rem;
    margin: 0;
    padding: 0.9rem 1rem 0.9rem 2.4rem;
    list-style: decimal;
    border: 1px solid var(--trait);
    border-radius: var(--r-sm);
    background: var(--fond);
}

.double-auth__codes li::marker {
    font-size: var(--t-xs);
    color: var(--gris);
}

.double-auth__codes code {
    /* Chasse fixe : on recopie lettre à lettre, aucune hésitation possible entre deux caractères. */
    font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: var(--t-base);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--encre);
    user-select: all;
}

@media (max-width: 359px) {
    .double-auth__codes {
        grid-template-columns: 1fr;
    }
}

.formulaire__pied--droite {
    justify-content: flex-end;
    border-top: 0;
    padding-top: 0;
}

.formulaire-profil {
    display: grid;
    gap: var(--e-4);
}

.formulaire-profil .formulaire__duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--e-4);
}

@media (max-width: 640px) {
    .formulaire-profil .formulaire__duo {
        grid-template-columns: 1fr;
    }
}

/* Champ mot de passe avec bouton « Afficher » */
.champ__mdp {
    position: relative;
}

.champ .champ__mdp input {
    padding-right: 5.5rem;
}

.champ__voir {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    min-height: 1.75rem;
    padding: 0.3rem 0.65rem;
    border-radius: var(--r-full);
    font-size: var(--t-xs);
    font-weight: 700;
    color: var(--texte-vert);
}

.champ__voir:hover {
    background: var(--teinte-beige-2);
    color: var(--texte-fort);
}
