/* m4amp3.fr — feuille de style */
:root {
  --bg: #f6f7fb; --surface: #ffffff; --surface-2: #eef0f7; --text: #0f1222; --muted: #5b6075;
  --border: #dfe2ec; --primary: #4f46e5; --primary-2: #4338ca; --primary-soft: #e9e7fd;
  --ok: #0f9d6e; --ok-soft: #dff7ee; --warn: #b45309; --warn-soft: #fef3c7; --err: #c0392b; --err-soft: #fde8e6;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,18,34,.05), 0 12px 32px -12px rgba(15,18,34,.16);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f1a; --surface: #151828; --surface-2: #1c2035; --text: #eef0fa; --muted: #9aa1bd;
    --border: #272c45; --primary: #7c74ff; --primary-2: #948dff; --primary-soft: #262a52;
    --ok: #34d399; --ok-soft: #10342a; --warn: #fbbf24; --warn-soft: #3a2d0e; --err: #f87171; --err-soft: #3c1a1a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -12px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f1a; --surface: #151828; --surface-2: #1c2035; --text: #eef0fa; --muted: #9aa1bd;
  --border: #272c45; --primary: #7c74ff; --primary-2: #948dff; --primary-soft: #262a52;
  --ok: #34d399; --ok-soft: #10342a; --warn: #fbbf24; --warn-soft: #3a2d0e; --err: #f87171; --err-soft: #3c1a1a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -12px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 750; margin-top: 2.2em; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; z-index: 100; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.brand b { color: var(--primary); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: .92rem; white-space: nowrap; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.theme-toggle { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; flex: none; }
@media (max-width: 760px) { .nav { display: none; } .site-header .wrap { justify-content: space-between; } }

/* Hero */
.hero { padding: 48px 0 20px; text-align: center; max-width: 820px; margin-inline: auto; }
.hero .eyebrow { display: inline-flex; gap: 8px; align-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: .85rem; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 0 auto 1em; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .92rem; }
.badges li::before { content: "✓ "; color: var(--ok); font-weight: 700; }

/* Card / converter */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.converter { max-width: 820px; margin: 24px auto 0; }
.drop { border: 2px dashed var(--border); border-radius: 12px; padding: 40px 20px; text-align: center; color: var(--muted); transition: .2s; cursor: pointer; background: var(--surface-2); }
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--primary); background: var(--primary-soft); color: var(--text); outline: none; }
.drop svg { color: var(--primary); margin-bottom: 8px; }
.drop-title { font-size: 1.15rem; margin: 0 0 4px; color: var(--text); }
.drop-sub { margin: 0; font-size: .95rem; }
.link { color: var(--primary); text-decoration: underline; cursor: pointer; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-top: 18px; align-items: end; }
.options label { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.options label.check { flex-direction: row; align-items: center; grid-column: 1 / -1; font-weight: 500; }
select, input[type="text"], input[type="email"], textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); width: 100%; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
@media (max-width: 560px) { .options { grid-template-columns: 1fr; } }

.files { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.file { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.file .ico { width: 36px; height: 36px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: .7rem; font-weight: 800; font-family: var(--mono); }
.file .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .meta { font-size: .82rem; color: var(--muted); }
.file .bar { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.file .bar > i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .3s; }
.file.done .bar > i { background: var(--ok); width: 100%; }
.file.error .bar > i { background: var(--err); width: 100%; }
.file .right { display: flex; gap: 6px; align-items: center; }
.icon-btn { background: none; border: 1px solid var(--border); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); border-color: var(--text); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn { font: inherit; font-weight: 650; padding: 12px 20px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: .15s; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; flex: 1; justify-content: center; font-size: 1.05rem; }
.btn-primary:hover { background: var(--primary-2); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--text); }
.btn-ok { background: var(--ok); color: #fff; padding: 8px 14px; font-size: .9rem; }
.btn-small { padding: 8px 14px; font-size: .9rem; background: var(--surface-2); color: var(--text); }
.engine-status { margin: 16px 0 0; font-size: .85rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.engine-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); flex: none; }
.engine-status.loading .dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); animation: pulse 1s infinite; }
.engine-status.server .dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.engine-status.error .dot { background: var(--err); box-shadow: 0 0 0 4px var(--err-soft); }
@keyframes pulse { 50% { opacity: .4; } }

/* Content */
.content { max-width: 760px; margin: 0 auto; }
.content h2 { scroll-margin-top: 80px; }
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin-bottom: .35em; }
.content table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.content th, .content td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.content th { color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.callout { background: var(--primary-soft); border-left: 4px solid var(--primary); padding: 14px 18px; border-radius: 10px; margin: 1.2em 0; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 48px; margin-bottom: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }
.pros ul, .cons ul { list-style: none; padding: 0; }
.pros li::before { content: "＋ "; color: var(--ok); font-weight: 800; }
.cons li::before { content: "－ "; color: var(--err); font-weight: 800; }

.faq details { border: 1px solid var(--border); border-radius: 10px; padding: 0 16px; margin-bottom: 8px; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-a { padding: 0 0 14px; color: var(--muted); }

/* Grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.tile { display: block; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); transition: .15s; }
.tile:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.tile .arrow { font-family: var(--mono); font-weight: 700; color: var(--primary); font-size: 1.1rem; }
.tile p { margin: 6px 0 0; font-size: .88rem; color: var(--muted); }
.feature { padding: 22px; }
.feature .emoji { font-size: 1.8rem; }
.feature h3 { margin: 10px 0 4px; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
section.block { margin: 56px 0; }
.section-title { text-align: center; margin-bottom: 24px; }
.section-title p { color: var(--muted); }

/* Ads */
.ad { margin: 28px auto; text-align: center; min-height: 90px; max-width: 820px; }

/* Footer */
.site-footer { margin-top: 80px; border-top: 1px solid var(--border); padding: 40px 0 24px; font-size: .92rem; color: var(--muted); background: var(--surface); }
.site-footer h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text); margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--primary); }
.brand-foot { font-weight: 800; font-size: 1.1rem; color: var(--text); }
.brand-foot b { color: var(--primary); }
.copyright { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); font-size: .85rem; }

/* Cookie banner */
.cookie-banner { position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 560px; margin-inline: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); z-index: 100; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cookie-banner p { margin: 0; flex: 1 1 300px; font-size: .9rem; }
.cookie-actions { display: flex; gap: 8px; }

/* Breadcrumb */
.crumbs { font-size: .85rem; color: var(--muted); margin: 20px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 6px; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 10px; z-index: 200; box-shadow: var(--shadow); font-size: .95rem; }

/* Tableaux : défilement horizontal sur mobile */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1em 0; }
.table-wrap table { margin: 0; min-width: 480px; }
pre { overflow-x: auto; background: var(--surface-2); padding: 14px; border-radius: 10px; font-size: .88rem; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
pre code { background: none; padding: 0; }

/* Sélecteur de langue */
.lang-menu { position: relative; }
.lang-btn { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; height: 34px; padding: 0 10px; cursor: pointer; font: inherit; font-size: .85rem; font-weight: 600; }
.lang-btn:hover { color: var(--text); border-color: var(--text); }
.lang-list { position: absolute; right: 0; top: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); list-style: none; margin: 0; padding: 6px; min-width: 150px; z-index: 60; }
.lang-list a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--text); font-size: .92rem; }
.lang-list a:hover { background: var(--surface-2); text-decoration: none; }
.lang-list a[aria-current] { color: var(--primary); font-weight: 700; }
.lang-suggest { background: var(--primary-soft); color: var(--text); border-bottom: 1px solid var(--border); padding: 10px 16px; text-align: center; font-size: .92rem; display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.lang-suggest .btn { padding: 6px 12px; font-size: .88rem; }
.lang-links a { color: var(--muted); margin-right: 8px; }

/* Correctif : l'attribut hidden doit toujours gagner sur display:flex/inline-flex */
[hidden] { display: none !important; }

/* Compteur public */
.counter { display: inline-flex; align-items: center; gap: 8px; margin: 14px auto 0; padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .92rem; color: var(--muted); }
.counter b { color: var(--text); font-variant-numeric: tabular-nums; }
.counter .live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
