/*
 * Les pages d'outils gratuits.
 *
 * Une feuille COMMUNE, et non un <style> recopie dans chaque page comme sur les
 * guides : cinq outils qui partagent une zone de depot, une liste de fichiers
 * et des boutons, c'est cinq copies qui divergeraient a la premiere retouche.
 *
 * Les couleurs sont celles du site, au caractere pres, clair comme sombre :
 * un visiteur qui passe d'un guide a un outil ne doit pas changer de maison.
 */
:root {
  --ground: #FAF7F6; --surface: #FFFFFF; --surface-2: #F2ECEB;
  --ink: #1B1416; --ink-2: #5F5254; --ink-3: #8A7C7E;
  --line: #E6DCDB; --line-fort: #D3C5C4;
  --accent: #8B1A1A; --accent-2: #A32323; --accent-soft: #F7EAE9;
  --sur-accent: #FFFFFF;
  --ok: #1F6B3A; --ok-soft: #E6F2EA;
  --serif: 'Spectral', 'Iowan Old Style', Georgia, serif;
  --sans: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', Consolas, ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #151011; --surface: #1E1718; --surface-2: #271F20;
    --ink: #F3ECEB; --ink-2: #B7A9AA; --ink-3: #8C7D7E;
    --line: #342A2B; --line-fort: #4A3B3C;
    --accent: #D9564F; --accent-2: #E9736B; --accent-soft: #2B1A1A;
    --sur-accent: #1A1112;
    --ok: #6CC48B; --ok-soft: #16271C;
  }
}
:root[data-theme="dark"] {
  --ground: #151011; --surface: #1E1718; --surface-2: #271F20;
  --ink: #F3ECEB; --ink-2: #B7A9AA; --ink-3: #8C7D7E;
  --line: #342A2B; --line-fort: #4A3B3C;
  --accent: #D9564F; --accent-2: #E9736B; --accent-soft: #2B1A1A;
  --sur-accent: #1A1112;
  --ok: #6CC48B; --ok-soft: #16271C;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--sans); font-size: 16.5px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p, ul, ol { margin: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }

/* ── La barre du haut, celle des guides ─────────────────────────────── */
.barre { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--ground) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.barre .dedans { max-width: 860px; margin-inline: auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 14px; }
.marque { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.marque svg { width: 26px; height: 26px; border-radius: 7px; display: block; }
.barre a.retour { margin-left: auto; font-size: 14px; text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.barre a.retour:hover { color: var(--accent); }
.bascule-theme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line-fort); border-radius: 9px;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.bascule-theme:hover { color: var(--accent); border-color: var(--accent); }
.bascule-theme svg { width: 17px; height: 17px; }
.bascule-theme .pour-clair { display: none; }
.bascule-theme[aria-pressed="true"] .pour-sombre { display: none; }
.bascule-theme[aria-pressed="true"] .pour-clair { display: block; }

/* Le selecteur de langue, pose par traduire.py. Ailleurs, le script glisse ce
   style dans le <style> de la page ; ces pages-ci n'en ont pas (leur feuille
   est ce fichier), il doit donc vivre ici — sans lui, le drapeau s'empile
   au-dessus de « FR » dans la barre. Recopie de STYLE_LANGUE. */
.barre a.langue {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; white-space: nowrap; color: var(--ink-2);
}
.barre a.langue:hover { color: var(--accent); }
a.langue svg {
  width: 20px; height: 10px; display: block; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.18);
}
a.langue span { font-size: 12px; font-weight: 600; letter-spacing: .04em; }

/* ── Le texte ───────────────────────────────────────────────────────── */
main { max-width: 860px; margin-inline: auto; padding: 44px 24px 80px; }
.fil { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }
.fil a { color: var(--ink-2); text-decoration: none; }
.fil a:hover { color: var(--accent); }
.date { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
h1 { font-size: clamp(2rem, 4.5vw, 2.7rem); line-height: 1.1; }
.chapeau { margin-top: 16px; font-size: 18px; color: var(--ink-2); max-width: 680px; }

section { margin-top: 48px; }
h2 { font-size: 22px; line-height: 1.25; margin-bottom: 12px; }
h3 { font-size: 17px; line-height: 1.3; margin-top: 24px; margin-bottom: 8px; }
section p + p, section p + ul, section p + ol, section ul + p, section ol + p { margin-top: 12px; }
ul, ol { padding-left: 22px; }
li { margin-top: 6px; }
li::marker { color: var(--accent); }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 2px 5px; border-radius: 4px; }
.cadre { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 18px 20px; font-size: 15.5px; }
.question { margin-top: 24px; }
.question h3 { margin-top: 0; }

.appel { margin-top: 48px; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; }
.appel h2 { margin-bottom: 10px; }
.appel p + p { margin-top: 10px; }

/* ── La promesse, juste sous le titre ───────────────────────────────── */
.promesse {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 22px; padding: 12px 16px; border-radius: 8px;
  background: var(--ok-soft); color: var(--ink); font-size: 14.5px; line-height: 1.55;
}
.promesse svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--ok); }
.promesse a { color: inherit; }

/* ── L'outil ────────────────────────────────────────────────────────── */
.outil {
  margin-top: 26px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.depot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 170px; padding: 24px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-fort); border-radius: 10px; background: var(--ground);
  transition: border-color .15s, background .15s;
}
.depot:hover, .depot:focus-visible, .depot.survol { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.depot svg { width: 36px; height: 36px; color: var(--accent); }
.depot strong { font-size: 17px; }
.depot span { font-size: 14px; color: var(--ink-2); }
.depot input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.depot--compact { min-height: 0; flex-direction: row; padding: 12px 16px; margin-top: 14px; }
.depot--compact svg { width: 22px; height: 22px; }
.depot--compact strong { font-size: 15px; }

.fichiers { list-style: none; padding: 0; margin: 0; }
.fichiers li {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground);
}
.fichiers li::marker { content: none; }
.fichiers .rang { font-family: var(--mono); font-size: 12px; color: var(--ink-3); width: 22px; text-align: right; flex: none; }
.fichiers canvas, .fichiers .vignette { flex: none; width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.fichiers .infos { flex: 1 1 200px; min-width: 0; }
.fichiers .nom { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fichiers .detail { font-size: 13px; color: var(--ink-2); }
.fichiers .detail .gain { color: var(--ok); font-weight: 600; }
.fichiers .erreur-fichier { font-size: 13px; color: var(--accent); }
.fichiers label.pages { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.fichiers label.pages input { width: 120px; }
.actions-ligne { display: flex; gap: 4px; margin-left: auto; }

.petit-bouton {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--line-fort); border-radius: 7px;
  background: var(--surface); color: var(--ink-2); cursor: pointer; font: inherit; font-size: 13px;
}
.petit-bouton:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.petit-bouton:disabled { opacity: .35; cursor: default; }
.petit-bouton svg { width: 16px; height: 16px; }

.reglages { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 18px; }
/* Un libelle A COTE de son champ, relie par `for`, et non autour : traduire.py
   traduit un <label> d'un bloc, et un libelle qui enveloppe un <select>
   l'obligerait a recopier toutes les options dans sa traduction. */
.champ, .reglages > fieldset { display: flex; flex-direction: column; gap: 5px; }
.champ > label, .reglages legend { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.reglages fieldset { border: 0; padding: 0; margin: 0; }
.reglages legend { padding: 0; margin-bottom: 5px; }
.cases { display: flex; flex-direction: column; gap: 6px; }
.case { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; }

input[type=text], input[type=url], input[type=email], input[type=tel], input[type=password], select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-fort); border-radius: 7px; padding: 7px 10px; min-height: 38px;
}
textarea { min-height: 90px; resize: vertical; width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=range] { accent-color: var(--accent); width: 200px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 17px; height: 17px; }
input[type=color] { width: 46px; height: 34px; padding: 2px; border: 1px solid var(--line-fort); border-radius: 7px; background: var(--surface); }

.barre-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.bouton {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--sur-accent); text-decoration: none;
  font: inherit; font-weight: 600; font-size: 15px; padding: 11px 20px; border-radius: 8px; border: 0; cursor: pointer;
}
.bouton:hover:not(:disabled) { background: var(--accent-2); }
.bouton:disabled { opacity: .45; cursor: default; }
.bouton svg { width: 18px; height: 18px; }
.bouton--discret { background: transparent; color: var(--ink-2); border: 1px solid var(--line-fort); }
.bouton--discret:hover:not(:disabled) { background: transparent; color: var(--accent); border-color: var(--accent); }

.etat { font-size: 14px; color: var(--ink-2); }
.etat.ok { color: var(--ok); font-weight: 600; }
.etat.erreur { color: var(--accent); font-weight: 600; }
.vide { margin-top: 14px; font-size: 14px; color: var(--ink-3); }

/* Le resultat d'un outil a un seul champ (mot de passe, QR code). */
.resultat { margin-top: 18px; padding: 16px 18px; border-radius: 10px; background: var(--ground); border: 1px solid var(--line); }

.depot { position: relative; }

/* Le mot de passe : gros, en chasse fixe, et coupable n'importe où — un mot
   de passe de 64 caractères n'a pas d'espace où passer à la ligne. */
.mdp {
  display: block; font-family: var(--mono); font-size: clamp(17px, 3.2vw, 23px); line-height: 1.5;
  word-break: break-all; color: var(--ink); min-height: 1.5em; user-select: all;
}
.jauge { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 16px; overflow: hidden; }
.jauge > div { height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width .2s, background .2s; }
.jauge > div.solide { background: var(--ok); }
.solidite { margin-top: 8px; font-size: 14px; color: var(--ink-2); }

/* Le QR code : la saisie à gauche, l'aperçu à droite ; l'un sous l'autre
   sur téléphone. */
.qr-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 26px; align-items: start; }
.champs { display: flex; flex-direction: column; gap: 12px; }
.champs .champ input:not([type=color]), .champs .champ select, .champs .champ textarea { width: 100%; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.apercu {
  aspect-ratio: 1; width: 100%; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; color: #8A7C7E; font-size: 14px; text-align: center; padding: 10px;
}
.apercu svg { width: 100%; height: 100%; display: block; }
.qr-apercu .barre-actions { margin-top: 14px; }

@media (max-width: 680px) {
  .qr-colonnes { grid-template-columns: 1fr; }
  .qr-apercu { max-width: 320px; }
}

/* ── La grille du sommaire des outils ───────────────────────────────── */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 26px; }
.carte {
  position: relative;
  display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.carte:hover, .carte:focus-within { border-color: var(--accent); transform: translateY(-1px); }
/* Le lien est sur le titre (le traducteur saute un lien qui contient un
   pictogramme) ; son ::after recouvre la carte, qui reste cliquable partout. */
.carte a { color: inherit; text-decoration: none; }
.carte a::after { content: ''; position: absolute; inset: 0; border-radius: 10px; }
.carte a:focus-visible { outline: none; }
.carte:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.carte svg { width: 28px; height: 28px; color: var(--accent); }
.carte strong { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.carte span { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.autres { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.autres li { margin: 0; }
.autres li::marker { content: none; }
.autres a { display: inline-block; padding: 7px 13px; border: 1px solid var(--line-fort); border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: 14px; }
.autres a:hover { color: var(--accent); border-color: var(--accent); }

footer { border-top: 1px solid var(--line); background: var(--surface); padding: 30px 24px; }
footer .dedans { max-width: 860px; margin-inline: auto; font-size: 13px; color: var(--ink-3); line-height: 1.7; }
footer strong { color: var(--ink-2); }

@media (max-width: 560px) {
  main { padding-top: 30px; }
  /* Le cadre de depot, une fois des fichiers poses, passe sur une ligne. Sur
     telephone, cette ligne ecrasait « Deposez vos photos ici » sur trois lignes a
     cote de l'icone (vu sur les captures du film, 2026-10-01) : on empile. */
  .depot--compact { flex-direction: column; gap: 2px; padding: 12px 16px; }
  /* Le nom du fichier a cote de sa vignette, les boutons dessous : avec 200 px
     reserves au nom, il passait sous la vignette et laissait un trou. */
  .fichiers .infos { flex-basis: 120px; }
  .outil { padding: 16px; }
  .barre a.retour { font-size: 13px; }
  .fichiers label.pages input { width: 100px; }
}
