:root {
    --encre: #1c1915;
    --papier: #f4efe6;
    --panneau: #fffaf3;
    --trait: #d9d0c3;
    --sourd: #6f675c;
    --cachet: #9c2b1a;
    --cachet-fonce: #7a1f14;
    --valide: #2d5a3d;
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    color: var(--encre);
    background: var(--papier);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: radial-gradient(ellipse at top, #fffdf8 0%, var(--papier) 55%);
}

.enveloppe {
    width: min(720px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 3rem 0 4rem;
}

header h1 {
    font-size: 2.4rem;
    letter-spacing: 0.28em;
    margin: 0 0 0.35rem;
    font-weight: 600;
}

.chapo {
    margin: 0 0 1.25rem;
    color: var(--sourd);
    max-width: 38em;
    line-height: 1.45;
}

.filet {
    height: 3px;
    width: 4.5rem;
    background: var(--cachet);
    margin: 0 0 1.75rem;
}

#compte {
    margin: 0 0 1.75rem;
    background: var(--panneau);
    border: 1px solid var(--trait);
    padding: 1rem 1.25rem;
}

#statut-compte,
#affichage-courriel {
    margin: 0 0 0.75rem;
    color: var(--sourd);
    font-size: 0.95rem;
    line-height: 1.45;
}

#formulaire-compte label {
    display: block;
    margin: 0 0 0.65rem;
    font-size: 0.92rem;
}

#formulaire-compte input {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font: inherit;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--trait);
    background: #fff;
}

#erreur-compte {
    color: var(--cachet);
    margin: 0.5rem 0 0;
    font-size: 0.92rem;
}

#deconnexion-compte {
    font: inherit;
    border: 1px solid var(--encre);
    background: transparent;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
}

footer {
    margin-top: 2.5rem;
    color: var(--sourd);
    font-size: 0.92rem;
    line-height: 1.45;
    max-width: 40em;
}

footer code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.85em;
}

#zone-depot {
    border: 1.5px dashed var(--encre);
    background: var(--panneau);
    padding: 2.4rem 1.5rem;
    text-align: center;
    cursor: pointer;
    outline: none;
}

#zone-depot.survol,
#zone-depot:focus-visible {
    background: #fff;
    box-shadow: 0 0 0 3px var(--papier), 0 0 0 5px var(--encre);
}

#zone-depot p {
    margin: 0 0 1rem;
}

#parcourir {
    font: inherit;
    background: var(--cachet);
    color: #fffaf3;
    border: 0;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
}

#parcourir:hover,
#parcourir:focus-visible {
    background: var(--cachet-fonce);
}

#parcourir-dossier {
    font: inherit;
    background: transparent;
    color: var(--encre);
    border: 1.5px solid var(--encre);
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    margin-left: 0.4rem;
}

#groupe {
    margin-top: 1.5rem;
    background: var(--panneau);
    border: 1px solid var(--trait);
    padding: 1.25rem;
}

#groupe h2,
#historique h2,
#vue-partage h2 {
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 0.35rem;
    font-weight: 600;
}

#meta-groupe {
    color: var(--sourd);
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
}

#liste-groupe,
#progression-fichiers {
    list-style: none;
    margin: 0;
    padding: 0;
}

.element-groupe,
.ligne-fichier {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
    border-top: 1px solid var(--trait);
    padding: 0.55rem 0;
    font-size: 0.95rem;
}

.ligne-fichier {
    display: block;
    padding: 0.65rem 0 0.4rem;
}

.tete-ligne-fichier {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.92rem;
}

.nom-element-groupe,
.tete-ligne-fichier span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taille-element-groupe,
.tete-ligne-fichier span:last-child {
    color: var(--sourd);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.retirer-element-groupe {
    font: inherit;
    font-size: 0.85rem;
    border: 0;
    background: transparent;
    color: var(--cachet);
    cursor: pointer;
    padding: 0;
}

.retirer-element-groupe:hover,
.retirer-element-groupe:focus-visible {
    text-decoration: underline;
}

.barre-petite {
    height: 6px;
    margin: 0.35rem 0 0;
}

.barre-petite span {
    display: block;
    height: 100%;
    background: var(--valide);
}

.ligne-fichier.est-erreur .tete-ligne-fichier span:last-child,
.ligne-fichier.est-annule .tete-ligne-fichier span:last-child {
    color: var(--cachet);
}

.ligne-fichier.est-termine .tete-ligne-fichier span:last-child {
    color: var(--valide);
}

#envoyer {
    font: inherit;
    background: var(--cachet);
    color: #fffaf3;
    border: 1px solid var(--cachet);
    padding: 0.45rem 1rem;
    cursor: pointer;
}

#envoyer:hover,
#envoyer:focus-visible {
    background: var(--cachet-fonce);
    border-color: var(--cachet-fonce);
}

#envoyer:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#transfert {
    margin-top: 1.5rem;
    background: var(--panneau);
    border: 1px solid var(--trait);
    padding: 1.25rem 1.25rem 0.75rem;
}

#nom-transfert {
    font-weight: 600;
    margin: 0 0 0.15rem;
}

#meta-transfert,
#etat-transfert {
    color: var(--sourd);
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
}

.barre {
    position: relative;
    height: 10px;
    background: var(--trait);
    margin: 0.4rem 0 0.35rem;
}

#barre-remplissage {
    display: block;
    height: 100%;
    width: 0;
    background: var(--valide);
}

#pourcentage {
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
}

.actions {
    display: flex;
    gap: 0.6rem;
    margin: 1rem 0;
}

.actions button {
    font: inherit;
    border: 1px solid var(--encre);
    background: transparent;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
}

.actions button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#journal {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0 0.75rem;
    max-height: 12rem;
    overflow: auto;
    color: var(--sourd);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
}

#journal li {
    border-top: 1px solid var(--trait);
    padding: 0.3rem 0;
}

#historique {
    margin-top: 2.5rem;
}

.chapo-historique,
#historique-vide {
    color: var(--sourd);
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.45;
}

#liste-historique {
    list-style: none;
    margin: 0;
    padding: 0;
}

.session-historique {
    background: var(--panneau);
    border: 1px solid var(--trait);
    margin: 0 0 0.75rem;
    padding: 0.4rem 1rem 0.75rem;
}

.session-historique summary {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 0;
}

.titre-historique {
    font-weight: 600;
}

.meta-historique {
    color: var(--sourd);
    font-size: 0.9rem;
}

.fichiers-historique {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fichiers-historique li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.4rem 0.75rem;
    align-items: center;
    border-top: 1px solid var(--trait);
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.nom-fichier-historique {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taille-fichier-historique,
.etat-fichier-historique {
    color: var(--sourd);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lien-telechargement {
    color: var(--cachet);
    text-decoration: none;
    white-space: nowrap;
}

.lien-telechargement:hover,
.lien-telechargement:focus-visible {
    text-decoration: underline;
}

.empreinte-historique {
    grid-column: 1 / -1;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.72rem;
    color: var(--sourd);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions-historique {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.actions-historique button {
    font: inherit;
    font-size: 0.9rem;
    border: 1px solid var(--encre);
    background: transparent;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
}

.fichier-vacant {
    color: var(--sourd);
    border-top: 1px solid var(--trait);
    padding: 0.5rem 0;
}

body.mode-partage #zone-depot,
body.mode-partage #groupe,
body.mode-partage #transfert,
body.mode-partage #historique {
    display: none;
}

#vue-partage {
    background: var(--panneau);
    border: 1px solid var(--trait);
    padding: 1.25rem;
}

#erreur-partage {
    color: var(--cachet);
    margin: 0 0 1rem;
}
