/* Outilo — feuille de style unique, sans dépendance. */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f4f4f2;
  --border: #e3e3df;
  --text: #1c1c19;
  --muted: #6b6b64;
  --accent: #1f6f4a;
  --accent-soft: #e8f2ec;
  --accent-text: #ffffff;
  --danger: #a8321f;
  --radius: 10px;
  --maxw: 62rem;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14140f;
    --surface: #1c1c18;
    --surface-2: #24241f;
    --border: #33332c;
    --text: #eceae2;
    --muted: #9d9c92;
    --accent: #6bbd8f;
    --accent-soft: #1e2a23;
    --accent-text: #10160f;
    --danger: #e8836f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

/* L'attribut `hidden` doit l'emporter sur les `display` posés plus bas
   (.field, .result, .actions… sont en flex et l'annuleraient sinon). */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- En-tête ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -.02em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: .95rem;
}
.site-nav { display: flex; gap: 1.1rem; font-size: .93rem; flex-wrap: wrap; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }

/* ---------- Contenu ---------- */

main { padding: 2.5rem 0 3.5rem; }

h1 {
  font-size: clamp(1.65rem, 4vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -.025em;
  margin: 0 0 .6rem;
}
h2 {
  font-size: 1.25rem;
  letter-spacing: -.015em;
  margin: 2.5rem 0 .75rem;
}
h3 { font-size: 1.02rem; margin: 1.75rem 0 .5rem; }

.lede {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 44rem;
  margin: 0 0 2rem;
}

.prose { max-width: 44rem; }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .35rem; }

/* ---------- Bloc outil ---------- */

.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.25rem 1.25rem;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone strong { display: block; margin-bottom: .2rem; }
.dropzone span { color: var(--muted); font-size: .9rem; }
.dropzone input[type=file] { display: none; }

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field .hint { font-size: .78rem; color: var(--muted); font-weight: 400; }

input[type=number], input[type=text], select {
  font: inherit;
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible, .dropzone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input[type=range] { width: 100%; accent-color: var(--accent); }

.checkline { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.checkline input { accent-color: var(--accent); width: 1rem; height: 1rem; }

button, .btn {
  font: inherit;
  font-weight: 600;
  padding: .6rem 1.1rem;
  border-radius: 7px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; align-items: center; }

.status { font-size: .9rem; color: var(--muted); }
.status.error { color: var(--danger); }

.result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.result[hidden] { display: none; }
.preview {
  max-width: 100%;
  max-height: 22rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 18px 18px;
}
.stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
  font-size: .9rem;
}
.stats div { display: flex; flex-direction: column; }
.stats dt { color: var(--muted); font-size: .8rem; }
.stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 600;
}

.privacy-note {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  font-size: .87rem;
  color: var(--muted);
  background: var(--accent-soft);
  border-radius: 7px;
  padding: .75rem .9rem;
  margin-top: 1.25rem;
}

/* ---------- Grille d'accueil ---------- */

.cat-title {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 2.5rem 0 1rem;
  font-size: 1.1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card strong { display: block; margin-bottom: .3rem; font-size: .98rem; line-height: 1.35; }
.card span { color: var(--muted); font-size: .87rem; line-height: 1.5; display: block; }

/* ---------- FAQ ---------- */

details {
  border-bottom: 1px solid var(--border);
  padding: .85rem 0;
}
details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .97rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "−"; }
details p { margin: .6rem 0 0; color: var(--muted); font-size: .93rem; }

/* ---------- Pied de page ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2rem 0;
  font-size: .88rem;
  color: var(--muted);
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }

/* ---------- Emplacements publicitaires ---------- */

.ad-slot { margin: 2rem 0; min-height: 0; text-align: center; }
.ad-slot:empty { display: none; }

/* ---------- Divers ---------- */

.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1.25rem; }
.breadcrumb a { color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: .82rem; font-weight: 600; }

.scroll-x { overflow-x: auto; }

@media (max-width: 40rem) {
  main { padding: 1.75rem 0 2.5rem; }
  .tool { padding: 1.15rem; }
}
