:root {
  --bg: #1b1714;
  --bg-2: #221d19;
  --surface: #2a2420;
  --surface-2: #332c27;
  --text: #f5ede6;
  --muted: #b5a99f;
  --border: #3d352f;
  --accent: #ff8a5c;
  --accent-2: #e2456b;
  --accent-soft: rgba(255, 138, 92, .14);
  --accent-text: #1b1714;
  --warn-bg: rgba(255, 186, 92, .08);
  --warn-border: rgba(255, 186, 92, .3);
  --error: #ff8f80;
  --radius: 18px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fbf6f2; --bg-2: #f5ede6; --surface: #ffffff; --surface-2: #f7f0ea;
    --text: #2a211c; --muted: #6f6158; --border: #eadfd6;
    --accent: #e8683a; --accent-2: #d13660; --accent-soft: rgba(232, 104, 58, .12);
    --accent-text: #ffffff; --warn-bg: #fff6e8; --warn-border: #f1d9ad; --error: #c0392b;
  }
}
:root[data-theme="light"] {
  --bg: #fbf6f2; --bg-2: #f5ede6; --surface: #ffffff; --surface-2: #f7f0ea;
  --text: #2a211c; --muted: #6f6158; --border: #eadfd6;
  --accent: #e8683a; --accent-2: #d13660; --accent-soft: rgba(232, 104, 58, .12);
  --accent-text: #ffffff; --warn-bg: #fff6e8; --warn-border: #f1d9ad; --error: #c0392b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
img { max-width: 100%; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* En-tête */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.top-in { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand img { border-radius: 11px; flex: none; }
.brand strong { display: block; font-size: 1.2rem; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.nav a:hover { color: var(--text); }
@media (max-width: 640px) { .nav a:not(:last-child) { display: none; } }

/* Hero */
.hero { text-align: center; padding: 48px 16px 8px; }
.pill {
  display: inline-block; margin: 0 0 22px; padding: 7px 16px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg-2);
  color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
h1 { font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.1; margin: 0 0 16px; letter-spacing: -.02em; }
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { color: var(--muted); max-width: 620px; margin: 0 auto; font-size: 1.05rem; }

/* Outil */
.tool { padding-top: 28px; }
.panel {
  max-width: 760px; margin: 0 auto; padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, .6);
}
.tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.tab {
  flex: 1 0 auto; padding: 10px 14px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer;
}
.tab.active { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.tab.soon { cursor: default; opacity: .55; }
.tab em { font-style: normal; font-size: .72rem; font-weight: 500; margin-left: 4px; }

.search { display: flex; gap: 8px; flex-wrap: wrap; position: relative; }
.search-ic { position: absolute; left: 14px; top: 15px; color: var(--muted); pointer-events: none; }
.search input {
  flex: 1 1 260px; min-width: 0; padding: 14px 16px 14px 44px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 14px; background: var(--bg-2); color: var(--text);
}
.search input::placeholder { color: var(--muted); opacity: .8; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .btn {
  padding: 14px 22px; font: inherit; font-weight: 700; border-radius: 14px; border: 0; cursor: pointer;
  background: linear-gradient(100deg, var(--accent), var(--accent-2)); color: #fff;
  text-decoration: none; text-align: center;
}
button:disabled { opacity: .6; cursor: wait; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.search button { flex: 1 0 auto; }
@media (min-width: 600px) { .search button { flex: 0 0 auto; } }

.msg { min-height: 1.5em; margin: 12px 2px 0; color: var(--muted); font-size: .95rem; }
.msg.error { color: var(--error); }

.result { display: flex; gap: 16px; margin-top: 14px; padding: 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); }
.result[hidden] { display: none; }
.result img { width: 110px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; flex: none; background: var(--border); }
.info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.author { font-weight: 700; margin: 0; }
.desc { margin: 0; color: var(--muted); font-size: .92rem; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.btn.disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 440px) {
  .result { flex-direction: column; }
  .result img { width: 100%; max-height: 320px; aspect-ratio: auto; }
}

/* Sections */
.block { padding-top: 64px; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2rem); text-align: center; margin: 0 0 28px; letter-spacing: -.01em; }
h3 { font-size: 1.12rem; margin: 0 0 6px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card p { margin: 0; color: var(--muted); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.num {
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-weight: 800;
}

.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.feat { display: flex; gap: 16px; align-items: flex-start; }
.ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.ic svg { width: 22px; height: 22px; }

.faq { display: grid; gap: 10px; max-width: 760px; margin: 0 auto; }
.faq details { padding: 0; }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 52px 18px 22px; font-weight: 600; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 1.4rem; font-weight: 400;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 22px 18px; }

.warn {
  max-width: 760px; margin: 0 auto; padding: 20px 22px; border-radius: var(--radius);
  background: var(--warn-bg); border: 1px solid var(--warn-border); font-size: .93rem;
}
.warn h2 { font-size: 1.05rem; text-align: left; margin: 0 0 10px; }
.warn p { margin: 0 0 8px; color: var(--muted); }
.warn p:last-child { margin: 0; }
.warn strong { color: var(--text); }

/* Pied de page */
.foot { margin-top: 64px; border-top: 1px solid var(--border); background: var(--bg-2); }
.foot-in { max-width: 960px; margin: 0 auto; padding: 26px 16px 40px; display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
.brand.small img { border-radius: 8px; }
.brand.small strong { font-size: 1rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .88rem; }
.foot nav a { color: var(--muted); }

/* Page Conditions */
.legal { max-width: 760px; padding-top: 32px; }
.legal h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
.legal h2 { text-align: left; margin: 36px 0 12px; font-size: 1.3rem; }
.legal p, .legal li { color: var(--muted); }
.legal strong { color: var(--text); }
.legal .note { font-size: .9rem; }

.contact { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.contact label:not(.consent) { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; }
.contact input:not([type="checkbox"]), .contact textarea {
  font: inherit; font-weight: 400; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg-2); color: var(--text); width: 100%; }
.contact input:focus, .contact textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.contact .hp { display: none; }
.contact button { align-self: flex-start; }

/* Formats de téléchargement */
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer;
}
.opt strong { font-size: .98rem; }
.opt small { color: var(--muted); font-size: .78rem; font-weight: 400; }
.opt:hover { border-color: var(--accent); }
.opt:first-child { background: linear-gradient(100deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.opt:first-child small { color: rgba(255, 255, 255, .85); }
.options.locked .opt { opacity: .45; cursor: not-allowed; }
.options.busy .opt { pointer-events: none; opacity: .6; }
.contact[hidden] { display: none; }

/* Bandeau cookies */
#cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 560px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between;
  padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .7); font-size: .9rem;
}
#cookie-banner p { margin: 0; flex: 1 1 260px; color: var(--muted); }
#cookie-banner .cb-actions { display: flex; gap: 8px; }
#cookie-banner button { padding: 10px 18px; }
