/* PDF Facile : feuille de style unique.
   Thème choisi par config.json "theme" → <html data-theme="rouge|jaune|bleu">. */

:root {
  --brand: #dc2e29;
  --brand-deep: #b3201c;
  --brand-soft: #fdecec;
  --on-brand: #ffffff;
  --ink: #1f2430;
  --muted: #5d6474;
  --line: #e6e8ee;
  --bg: #ffffff;
  --bg-alt: #f6f7fa;
  --card: #ffffff;
  --top-bg: #ffffff;
  --top-ink: #1f2430;
  --foot-bg: #1f2430;
  --foot-ink: #c9cdd6;
  --ok: #1a7f37;
  --err: #c62828;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 6px 20px rgba(20, 24, 40, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  --faint: #5f6673;
}
[data-theme="jaune"] {
  --brand: #ffc400; --brand-deep: #c79800; --brand-soft: #fff6d6; --on-brand: #111111;
  --top-bg: #111111; --top-ink: #ffffff; --foot-bg: #111111;
}
[data-theme="bleu"] {
  --brand: #1e4ba6; --brand-deep: #0b1730; --brand-soft: #e8eefb; --on-brand: #ffffff;
  --top-bg: #0b1730; --top-ink: #ffffff; --foot-bg: #0b1730;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 16px; }
a { color: var(--brand-deep); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 16px; top: 8px; z-index: 99; background: #fff; padding: 8px 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
main:focus { outline: none; }
[dir="rtl"] body { line-height: 1.7; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* En-tête */
.top { background: var(--top-bg); color: var(--top-ink); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: inherit; text-decoration: none; letter-spacing: -.2px; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: inherit; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.nav a:hover { background: var(--brand-soft); color: var(--brand-deep); }
.nav a[aria-current="page"] { color: var(--brand-deep); background: var(--brand-soft); }
.langs { position: relative; }
.langs summary { list-style: none; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; padding: 8px 10px; border-radius: 8px; font-weight: 700; font-size: 14px; min-height: 40px; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary:hover, .langs[open] summary { background: var(--brand-soft); color: var(--brand-deep); }
.langs ul { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(20, 24, 40, .14); min-width: 170px; z-index: 30; }
.langs li a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.langs li a:hover { background: var(--bg-alt); }
.langs li a[aria-current="true"] { color: var(--brand-deep); background: var(--brand-soft); }
.btn-premium { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 40px; border-radius: 999px; background: #fff4d6; color: #8a5a00; font-weight: 700; text-decoration: none; font-size: 14px; white-space: nowrap; }
.btn-premium.is-on { background: #e7f6ec; color: var(--ok); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: var(--on-brand); border: 0; border-radius: 10px; padding: 12px 22px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; }
.btn:hover { background: var(--brand-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-xl { font-size: 19px; padding: 16px 34px; border-radius: 12px; box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn-off { background: #c9ccd4; color: #fff; cursor: default; box-shadow: none; }
.btn-off:hover { background: #c9ccd4; }
.btn-ghost { background: none; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }

/* Accueil */
.hero { background: var(--bg-alt); padding: 56px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(28px, 4.5vw, 44px); letter-spacing: -.5px; }
.lead { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 720px; margin: 0 auto; }
.tools { padding: 28px 16px 40px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 24px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s, border-color .12s; }
.tcard:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: 0 10px 28px rgba(20, 24, 40, .1); }
.tcard h3 { font-size: 18px; margin: 14px 0 6px; }
.tcard p { margin: 0; color: var(--muted); font-size: 14.5px; }
.tcard[hidden] { display: none; }
.ticon { display: inline-grid; place-items: center; border-radius: 12px; background: var(--c); color: #fff; flex: none; }
.ticon svg { width: 58%; height: 58%; }
.why { padding: 40px 16px; }
.why h2 { text-align: center; font-size: 28px; margin-bottom: 24px; }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.why-grid > div { background: var(--bg-alt); border-radius: var(--radius); padding: 22px; }
.why-grid h3 { font-size: 18px; margin-top: 8px; }
.why-grid p { margin: 0; color: var(--muted); }
.why-i { font-size: 28px; }
.pband { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: linear-gradient(120deg, var(--brand), var(--brand-deep)); color: var(--on-brand); border-radius: 18px; padding: 28px 32px; margin: 20px auto 48px; max-width: 1148px; }
.pband h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.pband p { margin: 0; opacity: .92; }
.pband .btn { background: #fff; color: var(--brand-deep); }

/* Page d'outil */
.thero { text-align: center; padding: 36px 0 24px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 9%, #fff), #fff); }
.thero h1 { font-size: clamp(28px, 4vw, 40px); margin-top: 14px; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-bottom: 32px; }
@media (min-width: 1200px) { .tool-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.tool-side { display: none; }
@media (min-width: 1200px) { .tool-side { display: block; } .tool-side .ad { position: sticky; top: 84px; min-height: 600px; } }
.tool { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 24px; }
.drop { border: 2px dashed color-mix(in srgb, var(--brand) 45%, var(--line)); border-radius: 14px; padding: 48px 16px; text-align: center; background: var(--brand-soft); transition: background .15s, border-color .15s; }
.drop.over, .tool.over .work { background: color-mix(in srgb, var(--brand) 16%, #fff); border-color: var(--brand); }
.drop p { margin: 14px 0 0; color: var(--muted); }
.drop .drop-note { font-size: 14px; }
.files { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.files li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; }
.files .fprev { width: 42px; height: 54px; border-radius: 4px; background: var(--bg-alt); border: 1px solid var(--line); flex: none; object-fit: cover; }
.files .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.files .fmeta { color: var(--muted); font-size: 13px; font-weight: 400; display: block; }
.files button { border: 0; background: var(--bg-alt); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 16px; color: var(--ink); flex: none; }
.files button:hover { background: var(--brand-soft); color: var(--brand-deep); }
.files button:disabled { opacity: .35; cursor: default; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-bottom: 12px; }
.thumb { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 6px; background: #fff; text-align: center; cursor: grab; user-select: none; }
.thumb.dragging { opacity: .4; }
.thumb.drop-before { box-shadow: -4px 0 0 var(--brand); }
.thumb canvas { max-width: 100%; height: auto; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); transition: transform .2s; background: #fff; }
.thumb .tn { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.thumb .tbtns { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.thumb .tbtns button { border: 0; background: var(--bg-alt); border-radius: 6px; width: 30px; height: 28px; cursor: pointer; }
.thumb .tbtns button:hover { background: var(--brand-soft); }
.work-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; background: var(--bg-alt); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.field { display: grid; gap: 5px; font-weight: 600; font-size: 14.5px; }
.field[hidden] { display: none; }
.field small { font-weight: 400; color: var(--muted); font-size: 13px; }
.field input, .field select { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid #cfd3dc; border-radius: 9px; background: #fff; color: var(--ink); width: 100%; }
.field input:focus, .field select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.btn-go { display: flex; width: 100%; max-width: 420px; margin: 0 auto; }
.go-bar { position: sticky; bottom: 0; z-index: 5; padding: 12px 0 4px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 30%); }
.msg { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #fdecea; color: var(--err); font-weight: 600; }
.msg.ok { background: #e7f6ec; color: var(--ok); }
.busy { text-align: center; padding: 40px 10px; }
.bar { height: 10px; background: var(--bg-alt); border-radius: 99px; overflow: hidden; max-width: 460px; margin: 0 auto 14px; }
.bar span { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .2s; }
.done { text-align: center; padding: 24px 10px; }
.done-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 18px 0 22px; }
.done-actions .dl-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 640px; }
.done-actions .dl-list a { font-size: 14px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); }
.done p { color: var(--muted); }
.howto, .faq { margin-top: 36px; }
.howto ol { padding-inline-start: 22px; }
.howto li { margin-bottom: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.more { padding: 16px 16px 48px; }
.more h2 { margin-bottom: 18px; }

/* Publicité */
.ad { margin: 24px auto; text-align: center; min-height: 100px; display: grid; place-items: center; position: relative; padding-top: 18px; }
.ad-label { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--faint); letter-spacing: .5px; text-transform: uppercase; }
.ad-empty a { display: grid; place-items: center; width: 100%; min-height: 90px; border: 1px dashed #b9bec8; border-radius: 10px; color: var(--faint); text-decoration: none; font-weight: 600; background: var(--bg-alt); }
.ad-lateral.ad-empty a { min-height: 600px; }
.ad ins { width: 100%; }
body.is-premium .ad, body.is-premium [data-hide-premium] { display: none !important; }

/* Premium */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 28px 0 12px; }
.plan { position: relative; border: 1px solid var(--line); border-radius: 18px; padding: 28px 22px; text-align: center; box-shadow: var(--shadow); background: #fff; }
.plan-best { border: 2px solid var(--brand); }
.plan-tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--brand-deep); color: var(--on-brand); font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 99px; white-space: nowrap; }
.price { font-size: 18px; color: var(--muted); margin: 8px 0; }
.price strong { font-size: 38px; color: var(--ink); }
.plan-note { color: var(--ok); font-weight: 600; margin-top: 0; }
.plan .btn { margin-top: 10px; width: 100%; }
.pay-note { text-align: center; color: var(--muted); font-size: 14px; }
.compare { width: 100%; border-collapse: collapse; margin: 28px 0; }
.compare th, .compare td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.compare tbody th, .compare thead th:first-child { text-align: start; font-weight: 400; }
.compare th:last-child, .compare td:last-child { color: var(--brand-deep); font-weight: 700; }
.licence { background: var(--bg-alt); border-radius: var(--radius); padding: 22px; margin-bottom: 48px; }
.licence-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.licence-form .field { flex: 1; min-width: 220px; }
.premium-on { background: #e7f6ec; border-radius: var(--radius); padding: 22px; margin-top: 24px; }

/* Pages de texte */
.prose { padding: 40px 16px 56px; }
.prose h2 { margin-top: 1.6em; font-size: 22px; }

/* Pied de page */
.foot { background: var(--foot-bg); color: var(--foot-ink); padding: 44px 0 20px; margin-top: 24px; }
.foot-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.foot .logo { color: #fff; }
.foot h2 { font-size: 15px; color: #fff; margin-bottom: 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 4px; }
.foot li a { display: inline-block; padding: 4px 0; }
.foot a { color: var(--foot-ink); text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }
.foot p { font-size: 14px; }
.copy { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 16px; margin-top: 24px; font-size: 13px; }

@media (max-width: 860px) {
  .foot-in { grid-template-columns: 1fr 1fr; }
  .top { position: static; }
  .top-in { flex-wrap: wrap; gap: 6px 10px; padding-top: 8px; }
  .logo { flex: 1; }
  .nav { order: 5; flex: 1 0 100%; margin: 0 -16px; padding: 0 12px 6px; }
  .nav a { font-size: 14px; padding: 8px 10px; }
  .hero { padding: 32px 0 24px; }
}
@media (max-width: 520px) {
  .logo { font-size: 18px; }
  .btn-premium span { display: none; }
  .btn-premium { padding: 8px 11px; }
  .foot-in { grid-template-columns: 1fr; }
  .tool { padding: 16px; }
  .drop { padding: 36px 12px; }
  .btn-xl { font-size: 17px; padding: 14px 22px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tcard { padding: 14px; }
  .tcard h3 { font-size: 15.5px; margin-top: 10px; }
  .tcard p { font-size: 13px; }
  .pband { padding: 22px; border-radius: 14px; margin: 16px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Page racine : choix de la langue */
.lang-pick { text-align: center; padding: 64px 16px; }
.lang-pick .logo { justify-content: center; margin-bottom: 24px; }
.lang-pick h1 { font-size: 20px; color: var(--muted); font-weight: 600; line-height: 1.8; }
.lang-pick ul { list-style: none; padding: 0; margin: 24px auto 0; display: grid; gap: 10px; max-width: 320px; }
.lang-pick a { display: block; font-size: 18px; text-decoration: none; padding: 14px; }
