/* Police arabe servie en local (Noto Naskh Arabic, licence OFL 1.1 : static/fonts/OFL.txt) */
@font-face { font-family: "Noto Naskh Arabic"; font-weight: 400; font-display: swap;
  src: local("Noto Naskh Arabic"), url("/static/fonts/NotoNaskhArabic-Regular.ttf") format("truetype"); }
@font-face { font-family: "Noto Naskh Arabic"; font-weight: 700; font-display: swap;
  src: local("Noto Naskh Arabic Bold"), url("/static/fonts/NotoNaskhArabic-Bold.ttf") format("truetype"); }
:root {
  --ink: #18202b;
  --muted: #5c6673;
  --paper: #fbfaf7;
  --card: #ffffff;
  --line: #e4e0d8;
  --brand: #0c5c63;
  --brand-ink: #ffffff;
  --brand-soft: #e3f0ef;
  --accent: #d9822b;
  --good: #2f7d4f;
  --review: #a86b12;
  --bad: #a33a2f;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--font); }
html[lang="ar"] body { font-family: var(--font-ar); font-size: 17px; line-height: 1.8; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.wrap { max-width: 1040px; margin-inline: auto; padding-inline: 16px; }
main.wrap { padding-block: 32px 56px; min-height: 60vh; }
.muted { color: var(--muted); font-size: .92em; }
.inline { display: inline; }
[hidden] { display: none !important; }

/* En-tête */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .04em; color: var(--ink); text-decoration: none; direction: ltr; }
.nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink); }
.nav a:hover { color: var(--brand); }
.nav .lang { border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; }
.nav .linklike { color: var(--ink); text-decoration: none; }

/* Boutons et formulaires */
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand);
  border-radius: 999px; padding: 10px 22px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-small { padding: 6px 14px; font-size: .92em; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.nav .btn { color: var(--brand-ink); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form small { font-weight: 400; color: var(--muted); }
input[type=email], input[type=password], input[type=text], select {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible, .drop:focus-within {
  outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.check input { margin-top: .35em; }
.error { color: var(--bad); font-weight: 600; }
.note { background: var(--brand-soft); border-radius: 8px; padding: 10px 14px; }
.flash { background: var(--brand-soft); border-radius: 8px; padding: 10px 14px; margin-top: 16px; }
.flash-err { background: #fbe9e6; color: var(--bad); }
.banner { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center;
  background: #fff6e8; border: 1px solid #f1dcb7; border-radius: 8px; padding: 8px 14px; margin-top: 12px; font-size: .95em; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.narrow { max-width: 440px; margin-inline: auto; }
.card.danger { border-color: #efc9c3; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.inline-form { grid-template-columns: 1fr auto; align-items: end; }

/* Accueil */
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; padding-block: 24px 40px; }
.lead { font-size: 1.15rem; color: #2f3a47; max-width: 34em; }
.hero-art { display: flex; align-items: center; justify-content: center; gap: 14px; }
.sheet { width: 120px; height: 156px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 12px;
  box-shadow: 0 8px 24px rgba(24, 32, 43, .08); display: grid; align-content: start; gap: 9px; }
.sheet span { font: 700 .75rem/1 var(--font); letter-spacing: .08em; color: #fff; background: var(--accent); border-radius: 4px;
  padding: 4px 6px; justify-self: start; direction: ltr; }
.sheet-doc span { background: var(--brand); }
.sheet i { display: block; height: 6px; border-radius: 3px; background: #e8e4dc; }
.sheet i.short { width: 60%; }
.sheet-doc i { background: var(--brand-soft); }
.arrow { font-size: 1.8rem; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px; }
.features article { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.limits ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.limits li { background: var(--card); border: 1px solid var(--line); border-inline-start: 5px solid var(--good); border-radius: 8px; padding: 12px 16px; }
.limits li.review { border-inline-start-color: var(--review); }
.limits li.bad { border-inline-start-color: var(--bad); }

/* Tarifs */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; }
.plan ul { padding-inline-start: 1.1em; flex: 1; }
.plan-hl { border: 2px solid var(--brand); }
.price { font-size: 2rem; font-weight: 800; margin: 0 0 8px; direction: ltr; text-align: start; }
html[dir="rtl"] .price { direction: rtl; }
.price small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.current { font-weight: 700; color: var(--good); }

/* Application */
.upload { display: grid; gap: 16px; }
.drop { display: grid; place-items: center; text-align: center; min-height: 150px; border: 2px dashed #c9c3b8; border-radius: var(--radius);
  background: #fdfcf9; cursor: pointer; padding: 20px; position: relative; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop-text { font-weight: 600; color: #3a4552; }
.upload-row { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; justify-content: space-between; }
.upload-row label { display: grid; gap: 6px; font-weight: 600; min-width: 220px; }
progress { width: 100%; height: 8px; accent-color: var(--brand); }
.quota { margin-top: 18px; }
meter.bar { width: 100%; height: 10px; }
.jobs { list-style: none; padding: 0; display: grid; gap: 12px; }
.job { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.job-main { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.job-name { overflow-wrap: anywhere; }
.job-status { font-weight: 600; color: var(--muted); }
.job-done .job-status { color: var(--good); }
.job-failed .job-status { color: var(--bad); }
.job-running .job-status::after, .job-queued .job-status::after { content: " …"; }
.job-meta { margin: 4px 0; }
.job-warn { margin: 6px 0; padding-inline-start: 1.1em; color: var(--review); font-size: .93em; }
.job-warn:empty { display: none; }
.job-actions { display: flex; gap: 16px; align-items: center; margin-top: 8px; }

.prose { max-width: 760px; }
.email { font-weight: 600; text-align: start; }

/* Pied de page */
.foot { border-top: 1px solid var(--line); background: var(--card); }
.foot-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 18px; font-size: .9rem; color: var(--muted); }
.foot .links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot p { margin: 0; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .features, .plans { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .top-in { padding-block: 8px; }
}

/* --- Catalogue d'outils et gabarit unique -------------------------------------------------------- */
.skip { position: absolute; inset-inline-start: -999px; top: 0; background: var(--brand); color: #fff; padding: 8px 14px; z-index: 10; }
.skip:focus { inset-inline-start: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: .86em; }
.langs { display: inline-flex; gap: 8px; }
.hero-tools { display: block; padding-block: 8px 24px; text-align: center; }
.hero-tools .lead { margin-inline: auto; }
.search input { max-width: 520px; font-size: 1.05rem; padding: 12px 16px; border-radius: 999px; margin-top: 8px; }
.tool-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 0 0 28px; }
.tool-card a { display: grid; gap: 6px; height: 100%; padding: 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.tool-card a:hover, .tool-card a:focus-visible { border-color: var(--brand); transform: translateY(-1px); }
.tool-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); position: relative; }
.tool-icon::after { content: ""; position: absolute; inset: 9px 11px; border-radius: 3px; background: var(--brand); }
.tool-icon-convert_to::after { background: var(--accent); }
.tool-icon-organize::after { inset: 9px; border-radius: 50%; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.tool .drop { min-height: 180px; gap: 8px; align-content: center; }
.tool .drop .btn { pointer-events: none; }
.btn-big { font-size: 1.05rem; padding: 12px 28px; }
.file-list { margin: 0; padding-inline-start: 1.4em; display: grid; gap: 4px; }
.file-list li bdi { font-weight: 600; overflow-wrap: anywhere; }
.options { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 16px; }
.options label { display: grid; gap: 6px; font-weight: 600; min-width: 200px; flex: 1; }
.progress-wrap { display: grid; gap: 6px; }
.progress-wrap progress { height: 10px; }
.result { text-align: center; display: grid; gap: 10px; justify-items: center; }
.result .actions { justify-content: center; align-items: center; }
.result-name { font-weight: 700; overflow-wrap: anywhere; }
.chain-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chain-list a { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; }
.steps { padding-inline-start: 1.4em; display: grid; gap: 6px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.faq summary { font-weight: 600; cursor: pointer; }
.how, .faq { max-width: 780px; margin-bottom: 28px; }
