/* Atelier Revolusolaire — CSS pur, sans outil de construction.
   Couleurs et typographie de la maquette (orange et blanc). */

:root {
    --orange-700: #C2410C;   /* boutons, fonds sous texte blanc (contraste AA) */
    --orange-600: #EA580C;   /* barres, accents */
    --orange-300: #FDBA74;
    --orange-200: #FED7AA;
    --orange-100: #FFEDD5;
    --orange-50: #FFF7ED;
    --orange-25: #FFFBF7;
    --brun-800: #9A3412;
    --brun-900: #7C2D12;
    --texte: #1C1917;
    --gris-700: #57534E;
    --gris-500: #78716C;
    --gris-400: #A8A29E;
    --gris-200: #E7E5E4;
    --gris-100: #F5F5F4;
    --fond: #ffffff;
    --alerte: #B91C1C;

    --titre: 'Sora', 'Segoe UI', system-ui, sans-serif;
    --corps: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;

    --rayon: 10px;
    --rayon-carte: 16px;
    --cible: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--fond);
    color: var(--texte);
    font-family: var(--corps);
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--orange-700); }
a:hover { color: var(--brun-800); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange-600); outline-offset: 2px; }
input[type=range] { accent-color: var(--orange-600); width: 100%; min-height: var(--cible); }
svg { max-width: 100%; height: auto; }

.evitement { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--fond); padding: 10px 14px; border-radius: var(--rayon); }
.evitement:focus { left: 16px; }

/* Texte */
.chiffre { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.petit { font-size: 12.5px; }
.gris { color: var(--gris-500); }
.gris-fonce { color: var(--gris-700); }
.fonce { color: var(--brun-800); }
.aide { font-size: 13px; color: var(--gris-700); }
.titre-ecran { font-family: var(--titre); font-weight: 600; font-size: 24px; letter-spacing: -0.01em; }
.titre-section { font-family: var(--titre); font-weight: 600; font-size: 17px; }
.sous-titre { font-size: 13px; font-weight: 600; color: var(--gris-700); }
.vide { color: var(--gris-700); padding: 14px 0; }
.liste-simple { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* Mise en page */
.pile { display: flex; flex-direction: column; gap: 14px; }
.pile-serree { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.ligne__texte { flex: 1 1 280px; }
.ligne-titre { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.colonnes { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.colonnes > * { flex: 1 1 340px; min-width: 0; }
.tete-ecran { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }

/* Champs */
label { font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], textarea {
    width: 100%;
    min-height: var(--cible);
    border: 1px solid var(--orange-200);
    border-radius: var(--rayon);
    padding: 10px 14px;
    background: var(--orange-25);
    color: var(--texte);
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--orange-600); }

/* Boutons */
.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--cible); padding: 10px 16px;
    border-radius: var(--rayon); font-weight: 600; font-size: 14.5px;
    text-decoration: none; text-align: center; border: 1px solid transparent;
}
.bouton--principal { background: var(--orange-700); color: #fff; }
.bouton--principal:hover { background: var(--brun-800); color: #fff; }
.bouton--second { background: var(--fond); color: var(--brun-800); border-color: var(--orange-200); }
.bouton--second:hover { background: var(--orange-50); color: var(--brun-900); }
.bouton--contour { background: var(--fond); color: var(--orange-700); border-color: var(--orange-200); font-weight: 500; }
.bouton--discret { background: transparent; color: var(--gris-700); border-color: var(--gris-200); font-weight: 500; }
.bouton--discret:hover { background: var(--gris-100); }
.bouton--large { width: 100%; }
.bouton:disabled, .bouton[aria-disabled=true] { background: var(--gris-100); color: var(--gris-700); border-color: var(--gris-200); cursor: not-allowed; }

/* Pastilles */
.pastille, .etat {
    display: inline-block; align-self: flex-start; white-space: nowrap;
    font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px;
}
.pastille--vif { background: var(--orange-700); color: #fff; }
.pastille--fonce { background: var(--brun-900); color: #fff; }
.pastille--clair { background: var(--orange-100); color: var(--brun-800); }
.pastille--file { background: var(--fond); color: var(--brun-800); border: 1px solid var(--orange-200); }
.pastille--gris { background: var(--gris-100); color: var(--gris-700); }
.pastille--alerte { background: #FEE2E2; color: var(--alerte); }
.etat { font-size: 13px; padding: 7px 12px; }
.etat--ouvert { background: var(--orange-100); color: var(--brun-800); }
.etat--ferme { background: var(--brun-900); color: #fff; }

/* Messages */
.message { padding: 12px 16px; border-radius: 12px; font-size: 14px; }
.message--fait { background: var(--orange-50); color: var(--brun-900); border: 1px solid var(--orange-200); }
.message--refus { background: #FEF2F2; color: var(--alerte); border: 1px solid #FECACA; }
.message p + p { margin-top: 4px; }

/* En-tête */
.entete {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px;
    padding: 14px 28px; border-bottom: 1px solid var(--orange-200); background: var(--fond);
}
.marque { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.marque__logo {
    width: 40px; height: 40px; border-radius: var(--rayon); background: var(--orange-700); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--titre); font-weight: 700; font-size: 18px;
}
.marque__textes { display: flex; flex-direction: column; }
.marque__nom { font-family: var(--titre); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.marque__sous { font-size: 12px; color: var(--gris-500); }
.jauges { display: flex; flex-wrap: wrap; gap: 12px 24px; flex: 1 1 520px; min-width: 0; }
.jauge { flex: 1 1 150px; min-width: 140px; display: flex; flex-direction: column; gap: 6px; }
.jauge__haut { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.jauge__label { color: var(--gris-500); }
.jauge__piste { position: relative; height: 8px; border-radius: 99px; background: var(--orange-100); }
.jauge__rempli { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--orange-600); max-width: 100%; }
.jauge__repere { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--brun-900); }
.entete__droite { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; flex: 0 0 auto; }

/* Cadre : navigation + contenu */
.cadre { display: flex; flex-wrap: wrap; align-items: stretch; }
.nav {
    flex: 1 1 220px; max-width: 100%; padding: 24px 16px;
    display: flex; flex-direction: column; gap: 6px;
    border-right: 1px solid var(--orange-100); background: var(--orange-25);
}
.nav__liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.nav__lien {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    min-height: var(--cible); padding: 12px 14px; border-radius: var(--rayon);
    font-size: 14.5px; font-weight: 500; color: var(--texte); text-decoration: none;
}
.nav__lien:hover { background: var(--orange-100); color: var(--texte); }
.nav__lien--ici, .nav__lien--ici:hover { background: var(--orange-700); color: #fff; font-weight: 600; }
.nav__compte { font-family: var(--mono); font-size: 12px; background: var(--brun-900); color: #fff; border-radius: 99px; padding: 1px 8px; }
.nav__lien--ici .nav__compte { background: #fff; color: var(--brun-800); }
.nav__encart {
    margin-top: 18px; padding: 14px; border-radius: 12px; background: var(--fond);
    border: 1px solid var(--orange-200); display: flex; flex-direction: column; gap: 6px;
}
.nav__encart-titre { font-family: var(--titre); font-weight: 600; font-size: 15px; }
.nav__sortie { margin-top: 8px; }
.nav__sortie .bouton { width: 100%; }
.principal {
    flex: 999 1 640px; min-width: 0; padding: 28px 32px 48px;
    display: flex; flex-direction: column; gap: 24px;
}

/* Cartes */
.carte { border: 1px solid var(--orange-200); border-radius: var(--rayon-carte); padding: 20px 22px; background: var(--fond); min-width: 0; }
.carte--nouvelle { border: 1.5px solid var(--orange-300); padding: 18px 20px; }
.carte--liste { padding: 0; overflow: hidden; }
.encart { padding: 12px 14px; border-radius: 12px; background: var(--orange-50); color: var(--brun-900); font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }
.encart--alerte { background: #FEF2F2; color: var(--alerte); }

/* Demandes */
.demandes { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.liste { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ligne-demande {
    display: flex; flex-direction: column; gap: 6px; width: 100%;
    min-height: var(--cible); padding: 14px 16px; border-radius: 14px;
    background: var(--fond); border: 1px solid var(--orange-200); color: var(--texte); text-decoration: none;
}
.ligne-demande:hover { background: var(--orange-25); color: var(--texte); }
.ligne-demande--choisie { background: var(--orange-50); border: 1.5px solid var(--orange-600); }
.ligne-demande__haut { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ligne-demande__titre { font-weight: 600; font-size: 14.5px; }
.ligne-demande__sous { font-size: 12.5px; color: var(--gris-500); }

.detail {
    flex: 999 1 460px; min-width: 0; border: 1px solid var(--orange-200); border-radius: var(--rayon-carte);
    padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; background: var(--fond);
}
.detail__tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail__titres { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 300px; }
.detail__titre { font-family: var(--titre); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; }
.citation { font-size: 13.5px; color: var(--gris-700); white-space: pre-line; }
.cout { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--orange-50); flex: 0 1 240px; min-width: 190px; }
.cout__label { font-size: 12px; color: var(--brun-800); }
.cout__valeur { font-size: 15px; color: var(--brun-900); }
.barre { height: 6px; border-radius: 99px; background: var(--orange-100); position: relative; }
.barre__rempli { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--orange-600); }

.etapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.etape { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.etape__barre { height: 6px; border-radius: 99px; background: var(--orange-100); }
.etape--faite .etape__barre { background: var(--orange-600); }
.etape--encours .etape__barre { background: var(--orange-300); }
.etape__nom { font-size: 12.5px; font-weight: 600; }
.etape__note { font-size: 11.5px; color: var(--gris-500); }

.resume { font-size: 14px; }
.journal {
    border-radius: 12px; background: var(--texte); color: var(--orange-100);
    padding: 14px 16px; font-family: var(--mono); font-size: 12.5px;
    display: flex; flex-direction: column; gap: 4px;
}
.journal__ligne { white-space: pre-wrap; }
.journal__heure { color: var(--orange-300); }

.risque { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--orange-300); font-size: 13.5px; color: #44403C; }
.risque__titre { font-size: 12px; color: var(--brun-800); font-weight: 600; }
.zones { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--orange-600); background: var(--orange-50); color: var(--brun-900); font-size: 13.5px; }
.zones__titre { font-size: 12px; font-weight: 600; color: var(--brun-800); }
.tests { font-size: 13.5px; }
.tests--echec { color: var(--alerte); }
.gestes { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--orange-100); padding-top: 16px; }
.phrase { display: block; margin-top: 6px; font-family: var(--mono); font-weight: 500; color: var(--brun-900); }
.retouche > summary { list-style: none; width: fit-content; }
.retouche > summary::-webkit-details-marker { display: none; }
.retouche[open] > summary { margin-bottom: 12px; }

/* Forfait */
.chiffres-cles { display: flex; flex-wrap: wrap; gap: 16px; }
.chiffre-cle { flex: 1 1 220px; display: flex; flex-direction: column; gap: 8px; }
.chiffre-cle__valeur { font-family: var(--titre); font-weight: 600; font-size: 30px; color: var(--brun-900); font-variant-numeric: tabular-nums; }
.semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; }
.semaine__jour { min-width: 0; }
.jour {
    display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%;
    min-height: var(--cible); background: transparent; border: 0; padding: 4px 0; border-radius: var(--rayon); color: var(--texte);
}
.jour:hover:not(:disabled) { background: var(--orange-25); }
.jour:disabled { cursor: default; }
.jour__budget-txt { color: var(--brun-900); white-space: nowrap; }
.jour__colonne { height: 170px; width: 100%; max-width: 64px; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.jour__cadre { position: absolute; bottom: 0; left: 0; right: 0; border: 1.5px solid var(--orange-300); border-radius: 8px; background: var(--fond); }
.jour--aujourdhui .jour__cadre { background: var(--orange-50); }
.jour--repos .jour__cadre { border-style: dashed; border-color: var(--gris-200); }
.jour__utilise { position: absolute; bottom: 0; left: 6px; right: 6px; border-radius: 6px; background: var(--orange-600); }
.jour__utilise--depasse { background: var(--brun-900); }
.jour__nom { font-size: 13px; font-weight: 500; white-space: nowrap; }
.jour--aujourdhui .jour__nom { font-weight: 700; color: var(--orange-700); }
.jour--repos .jour__nom { color: var(--gris-500); }
.jour__etat { font-size: 11.5px; color: var(--gris-500); overflow-wrap: normal; }
.curseur__label { display: flex; justify-content: space-between; gap: 12px; }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.economie { display: flex; gap: 12px; align-items: baseline; border-bottom: 1px solid var(--orange-100); padding-bottom: 10px; }
.economie__chiffre { font-size: 13px; color: var(--orange-700); min-width: 64px; }
.economie__titre { font-size: 14px; font-weight: 600; }

/* Historique */
.historique { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--orange-100); }
.historique:last-child { border-bottom: 0; }
.historique__etiquette { font-size: 12.5px; color: var(--orange-700); min-width: 90px; }
.historique__corps { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.historique__titre { font-size: 14.5px; font-weight: 600; color: var(--texte); text-decoration: none; }
.historique__titre:hover { text-decoration: underline; }
.historique__etats { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.historique__cout { min-width: 60px; }

/* Pages seules (connexion) */
.seule { background: var(--orange-25); min-height: 100vh; display: flex; justify-content: center; padding: 32px 16px; }
.seule__boite {
    width: 100%; max-width: 440px; align-self: flex-start;
    background: var(--fond); border: 1px solid var(--orange-200); border-radius: var(--rayon-carte);
    padding: 24px; display: flex; flex-direction: column; gap: 18px;
}
.seule__titre { font-family: var(--titre); font-weight: 600; font-size: 22px; }
.qr { background: #fff; padding: 8px; width: fit-content; border: 1px solid var(--orange-200); border-radius: 12px; }
.qr svg { display: block; width: 220px; max-width: 100%; height: auto; }
.cle-totp { word-break: break-all; }
.codes-secours { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.codes-secours li { padding: 10px 12px; background: var(--orange-50); border-radius: var(--rayon); text-align: center; }

/* Téléphone */
@media (max-width: 720px) {
    .entete { padding: 12px 16px; gap: 12px; }
    .entete__droite { width: 100%; justify-content: space-between; }
    .jauges { flex-basis: 100%; }
    .nav { flex-basis: 100%; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--orange-100); }
    .nav__liste { flex-direction: row; flex-wrap: wrap; }
    .nav__liste li { flex: 1 1 auto; }
    .nav__encart { display: none; }
    .nav__sortie .bouton { width: auto; }
    .principal { padding: 20px 16px 40px; }
    .detail { padding: 18px 16px; }
    .carte { padding: 16px; }
    .carte--liste { padding: 0; }
    .historique { padding: 14px 16px; }
    .etapes { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
    .semaine { gap: 4px; }
    .jour__colonne { height: 130px; }
    .jour__budget-txt { font-size: 10.5px; }
    .jour__nom { font-size: 12px; }
    .jour__etat { font-size: 10.5px; }
    .titre-ecran { font-size: 21px; }
}

@media (prefers-reduced-motion: no-preference) {
    .bouton, .nav__lien, .ligne-demande { transition: background-color .15s ease, color .15s ease; }
}
