/* ============================================================
   NetCheck — Design System
   Premium, editorial, fast. Light + dark. No framework.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=JetBrains+Mono:wght@500&display=swap');

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --brand-500: #0d9488;
  --brand-600: #0f766e;
  --brand-700: #115e59;
  --violet-500: #06b6d4;
  --grad: linear-gradient(135deg, #0d9488 0%, #06b6d4 100%);
  --grad-soft: linear-gradient(135deg, rgba(13,148,136,.12), rgba(6,182,212,.12));

  /* Neutrals (light) */
  --bg: #fbfbfe;
  --bg-2: #f4f4fb;
  --surface: #ffffff;
  --border: #e7e7f0;
  --border-strong: #d6d6e4;
  --ink: #0e1220;
  --ink-2: #3c4257;
  --ink-3: #6b7186;
  --muted: #9297a8;

  /* Status */
  --success: #10b981;
  --success-bg: #e7f9f1;
  --danger: #ef4444;
  --warn: #f59e0b;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(16,18,32,.06), 0 1px 3px rgba(16,18,32,.04);
  --shadow-md: 0 4px 12px rgba(16,18,32,.07), 0 2px 4px rgba(16,18,32,.04);
  --shadow-lg: 0 18px 50px -12px rgba(45,42,120,.25);
  --shadow-brand: 0 12px 30px -8px rgba(13,148,136,.45);

  /* Geometry */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --maxw: 1140px;
  --nav-h: 68px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

:root[data-theme="dark"] {
  --bg: #0a0b12;
  --bg-2: #101220;
  --surface: #14161f;
  --border: #24273a;
  --border-strong: #313552;
  --ink: #eef0f7;
  --ink-2: #b9bdd0;
  --ink-3: #878ca6;
  --muted: #666c86;
  --grad-soft: linear-gradient(135deg, rgba(13,148,136,.18), rgba(6,182,212,.16));
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7);
  --success-bg: rgba(16,185,129,.14);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 3px; border-radius: 4px; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.section { padding-block: clamp(56px, 9vw, 110px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-600);
}
:root[data-theme="dark"] .eyebrow { color: var(--violet-500); }

h1, h2, h3 { line-height: 1.12; letter-spacing: -.02em; font-weight: 800; }
.h-display, .h2, .brand, .hero h1, .tool-hero h1, .prose h1 {
  font-family: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  font-optical-sizing: auto; letter-spacing: -.03em;
}
.h-display { font-size: clamp(2.4rem, 6vw, 4rem); }
.h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.28rem); color: var(--ink-2); max-width: 60ch; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav__inner { height: var(--nav-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; box-shadow: var(--shadow-brand);
}
.brand__mark svg { width: 17px; height: 17px; }
.nav__links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav__link {
  padding: 9px 14px; border-radius: var(--r-sm); font-weight: 600; font-size: .95rem;
  color: var(--ink-2); transition: color .2s, background .2s; cursor: pointer;
}
.nav__link:hover { color: var(--ink); background: var(--bg-2); }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm);
  color: var(--ink-2); transition: all .2s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.icon-btn svg { width: 18px; height: 18px; }
.nav__toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  --pad: 12px 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: var(--pad); border-radius: var(--r-pill); font-weight: 700; font-size: .98rem;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-brand); }
.btn--primary:hover { box-shadow: 0 16px 36px -8px rgba(13,148,136,.6); transform: translateY(-1px); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { border-color: var(--brand-500); color: var(--brand-600); }
.btn--lg { --pad: 15px 30px; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(50px, 8vw, 90px); overflow: hidden; }
.hero__glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 78% 8%, rgba(6,182,212,.22), transparent 60%),
    radial-gradient(50% 45% at 12% 6%, rgba(13,148,136,.20), transparent 55%);
}
.hero__grid {
  position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(70% 55% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(70% 55% at 50% 0%, #000 30%, transparent 75%);
}
.hero__inner { text-align: center; max-width: 780px; margin-inline: auto; }
.hero h1 { margin: 22px 0 18px; }
.hero .lede { margin-inline: auto; }
.hero__cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.hero__trust { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin-top: 34px; color: var(--ink-3); font-size: .9rem; font-weight: 600; }
.hero__trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero__trust svg { width: 16px; height: 16px; color: var(--success); }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Tool grid ---------- */
.tools-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 34px; }
.grid-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 24px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); cursor: pointer; overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.tool-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad); opacity: 0; transition: opacity .25s;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tool-card:hover::after { opacity: 1; }
.tool-card__icon {
  width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--grad-soft); color: var(--brand-600); flex-shrink: 0;
}
:root[data-theme="dark"] .tool-card__icon { color: var(--violet-500); }
.tool-card__icon svg { width: 24px; height: 24px; }
.tool-card h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; }
.tool-card p { font-size: .92rem; color: var(--ink-3); line-height: 1.5; }
.tool-card__arrow { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; color: var(--brand-600); }
:root[data-theme="dark"] .tool-card__arrow { color: var(--violet-500); }
.tool-card__arrow svg { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.tool-card:hover .tool-card__arrow svg { transform: translateX(4px); }
.tool-card.soon { opacity: .62; cursor: default; }
.tool-card.soon:hover { transform: none; box-shadow: none; }
.tool-card.soon::after { display: none; }
.badge-soon { position: absolute; top: 16px; right: 16px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); padding: 4px 9px; border-radius: var(--r-pill); }

/* ---------- Category nav (pills) ---------- */
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--r-pill);
  font-weight: 600; font-size: .92rem; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--border); cursor: pointer; transition: all .2s var(--ease);
}
.cat-pill:hover { color: var(--brand-600); border-color: var(--brand-500); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.cat-pill svg { width: 16px; height: 16px; }

/* ---------- Category blocks ---------- */
.cat { margin-top: 60px; scroll-margin-top: 90px; }
.cat:first-of-type { margin-top: 44px; }
.cat__head { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.cat__icon { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--grad); color: #fff; flex-shrink: 0; box-shadow: var(--shadow-brand); }
.cat__icon svg { width: 21px; height: 21px; }
.cat__head h3 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.cat__count { margin-left: auto; font-size: .82rem; font-weight: 700; color: var(--ink-3); background: var(--bg-2); border: 1px solid var(--border); padding: 5px 12px; border-radius: var(--r-pill); }

/* ---------- Feature band ---------- */
.features { background: var(--bg-2); border-block: 1px solid var(--border); }
.grid-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 30px; }
.feat__icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--brand-600); margin-bottom: 16px; }
:root[data-theme="dark"] .feat__icon { color: var(--violet-500); }
.feat__icon svg { width: 22px; height: 22px; }
.feat h3 { font-size: 1.12rem; margin-bottom: 8px; font-weight: 700; }
.feat p { color: var(--ink-3); font-size: .95rem; }

/* ---------- Tool page ---------- */
.tool-hero { padding-top: 46px; text-align: center; }
.breadcrumb { display: flex; gap: 8px; justify-content: center; align-items: center; font-size: .88rem; color: var(--ink-3); font-weight: 600; margin-bottom: 22px; }
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb svg { width: 14px; height: 14px; opacity: .6; }
.tool-hero__icon { width: 66px; height: 66px; border-radius: 18px; background: var(--grad); display: grid; place-items: center; margin: 0 auto 22px; box-shadow: var(--shadow-brand); }
.tool-hero__icon svg { width: 32px; height: 32px; color: #fff; }
.tool-hero h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 14px; }

/* Dropzone */
.workbench { max-width: 760px; margin: 40px auto 0; }
.dropzone {
  position: relative; border: 2px dashed var(--border-strong); border-radius: var(--r-xl);
  background: var(--surface); padding: 54px 30px; text-align: center; cursor: pointer;
  transition: border-color .25s var(--ease), background .25s, transform .15s;
}
.dropzone:hover { border-color: var(--brand-500); background: var(--grad-soft); }
.dropzone.drag { border-color: var(--brand-500); background: var(--grad-soft); transform: scale(1.01); }
.dropzone__icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; background: var(--grad-soft); display: grid; place-items: center; color: var(--brand-600); }
:root[data-theme="dark"] .dropzone__icon { color: var(--violet-500); }
.dropzone__icon svg { width: 30px; height: 30px; }
.dropzone h3 { font-size: 1.2rem; margin-bottom: 6px; }
.dropzone p { color: var(--ink-3); font-size: .95rem; }
.dropzone .btn { margin-top: 20px; }
.dropzone input[type=file] { display: none; }

/* File list */
.filelist { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.file-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); animation: rise .3s var(--ease) both;
}
.file-item__thumb { width: 42px; height: 42px; border-radius: 9px; background: var(--grad-soft); display: grid; place-items: center; color: var(--brand-600); flex-shrink: 0; }
.file-item__thumb svg { width: 20px; height: 20px; }
.file-item__meta { min-width: 0; flex: 1; }
.file-item__name { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item__size { font-size: .82rem; color: var(--muted); }
.file-item__actions { display: flex; gap: 4px; margin-left: auto; }
.mini-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; border: none; background: transparent; color: var(--ink-3); transition: all .18s; }
.mini-btn:hover { background: var(--bg-2); color: var(--ink); }
.mini-btn.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.mini-btn svg { width: 17px; height: 17px; }
.mini-btn[disabled] { opacity: .3; cursor: not-allowed; }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.toolbar .btn { flex: 1; min-width: 200px; }

/* Options row */
.options { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.opt {
  display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 170px;
}
.opt label { font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.opt select, .opt input[type=text], .opt input[type=number] {
  padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); font-weight: 500; transition: border-color .2s;
}
.opt select:focus, .opt input:focus { border-color: var(--brand-500); outline: none; }

/* ---------- Visual page grid (WYSIWYG) ---------- */
.grid-hint { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 22px 0 14px; }
.grid-hint__label { font-weight: 700; font-size: .98rem; }
.grid-hint__label span { color: var(--brand-600); }
:root[data-theme="dark"] .grid-hint__label span { color: var(--violet-500); }
.grid-hint__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--r-pill); font-weight: 600; font-size: .85rem; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); transition: all .18s var(--ease); }
.chip-btn:hover { color: var(--brand-600); border-color: var(--brand-500); }
.chip-btn svg { width: 14px; height: 14px; }

.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 16px; margin-top: 6px; }
.page-grid.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.page-thumb {
  position: relative; border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s, opacity .2s;
}
.page-thumb.enter { animation: rise .34s var(--ease) both; }
.page-thumb:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.page-thumb__canvas { width: 100%; aspect-ratio: 3/4; display: grid; place-items: center; background: var(--bg-2); overflow: hidden; }
.page-thumb__canvas img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s var(--ease); background: #fff; }
.page-thumb__skeleton { width: 100%; aspect-ratio: 3/4; background: linear-gradient(100deg, var(--bg-2) 30%, var(--border) 50%, var(--bg-2) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.page-thumb__num { position: absolute; bottom: 8px; left: 8px; font-size: .72rem; font-weight: 700; color: #fff; background: rgba(15,18,32,.72); padding: 3px 9px; border-radius: var(--r-pill); backdrop-filter: blur(4px); }
.page-thumb__check { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); display: grid; place-items: center; color: transparent; transition: all .18s var(--ease); }
.page-thumb__check svg { width: 14px; height: 14px; }

/* selectable (diviser) */
.page-thumb.selectable.selected { border-color: var(--brand-500); box-shadow: 0 0 0 2px var(--brand-500), var(--shadow-md); }
.page-thumb.selectable.selected .page-thumb__check { background: var(--grad); border-color: transparent; color: #fff; }
.page-thumb.selectable:not(.selected) .page-thumb__canvas img { opacity: .4; }
.page-thumb.selectable:not(.selected) { border-style: dashed; }

/* rotate control (pivoter) */
.page-thumb__rotate { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(15,18,32,.7); color: #fff; border: none; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .18s, background .18s; backdrop-filter: blur(4px); }
.page-thumb:hover .page-thumb__rotate { opacity: 1; }
.page-thumb__rotate:hover { background: var(--brand-600); }
.page-thumb__rotate svg { width: 15px; height: 15px; }

/* draggable (fusionner, image) */
.page-thumb.draggable { cursor: grab; will-change: transform; }
.page-thumb.draggable:active { cursor: grabbing; }
.page-thumb.dragging {
  opacity: .55; transform: scale(1.05) rotate(1.6deg); z-index: 6;
  box-shadow: var(--shadow-lg); border-color: var(--brand-500);
}
/* animated insertion bar */
.page-thumb.drop-before::before,
.page-thumb.drop-after::before {
  content: ""; position: absolute; top: 6%; height: 88%; width: 4px; border-radius: 4px;
  background: var(--grad); box-shadow: 0 0 10px 1px rgba(13,148,136,.6);
  animation: barpulse .9s var(--ease) infinite; z-index: 8;
}
.page-thumb.drop-before::before { left: -10px; }
.page-thumb.drop-after::before { right: -10px; }
@keyframes barpulse { 0%,100% { opacity: 1; transform: scaleY(1); } 50% { opacity: .55; transform: scaleY(.9); } }
.page-thumb__canvas img.pop { animation: thumbpop .4s var(--ease) both; }
@keyframes thumbpop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.page-thumb__label { padding: 9px 10px; }
.page-thumb__label .n { font-weight: 600; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-thumb__label .s { font-size: .74rem; color: var(--muted); }
.page-thumb__del { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(15,18,32,.7); color: #fff; border: none; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .18s, background .18s; backdrop-filter: blur(4px); }
.page-thumb:hover .page-thumb__del { opacity: 1; }
.page-thumb__del:hover { background: var(--danger); }
.page-thumb__del svg { width: 15px; height: 15px; }
.page-thumb__order { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; font-size: .8rem; display: grid; place-items: center; box-shadow: var(--shadow-sm); }

.thumb-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px; color: var(--ink-3); font-weight: 600; }
.thumb-loading .spinner { border-color: rgba(13,148,136,.25); border-top-color: var(--brand-500); }

/* ---------- Forms & calculators ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 700; font-size: .88rem; color: var(--ink-2); }
.field input, .field select, .field textarea {
  padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); font-weight: 500; font-size: 1rem; width: 100%;
  transition: border-color .2s, box-shadow .2s; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-500); outline: none; box-shadow: 0 0 0 3px rgba(13,148,136,.14); }
.field .suffix { position: relative; }
.field .suffix input { padding-right: 44px; }
.field .suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; font-size: .9rem; }
textarea.mono, input.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.pill-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.pill-tab { padding: 9px 16px; border-radius: var(--r-pill); font-weight: 600; font-size: .92rem; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); transition: all .18s var(--ease); }
.pill-tab:hover { border-color: var(--brand-500); color: var(--brand-600); }
.pill-tab.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--shadow-brand); }

.readout { margin-top: 26px; padding: 32px 28px; border-radius: var(--r-xl); background: var(--grad-soft); border: 1px solid var(--border); text-align: center; animation: rise .3s var(--ease) both; }
.readout__big { font-size: clamp(2.3rem, 7vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.08; }
.readout__label { color: var(--ink-3); font-weight: 600; margin-top: 6px; }
.readout__sub { margin-top: 16px; font-size: 1.05rem; color: var(--ink-2); font-weight: 600; }
.readout__bar { height: 12px; border-radius: var(--r-pill); background: var(--bg-2); margin-top: 20px; overflow: hidden; position: relative; }
.readout__bar i { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--ink); border-radius: 2px; transform: translateX(-50%); transition: left .4s var(--ease); }
.seg { display: flex; height: 100%; }
.seg > div { flex: 1; }
.copy-out { display: flex; gap: 10px; align-items: stretch; margin-top: 8px; }
.copy-out textarea {
  flex: 1; min-height: 120px; resize: vertical;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 12px 14px; font-family: inherit; font-size: 1rem; line-height: 1.6;
}
.copy-out textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(13,148,136,.14); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; text-align: center; }
.stat b { display: block; font-size: 1.6rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.stat span { font-size: .82rem; color: var(--ink-3); font-weight: 600; }

/* Result */
.result { text-align: center; padding: 40px 30px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-md); animation: rise .35s var(--ease) both; }
.result__check { width: 68px; height: 68px; border-radius: 50%; background: var(--success-bg); color: var(--success); display: grid; place-items: center; margin: 0 auto 18px; }
.result__check svg { width: 34px; height: 34px; }
.result h3 { font-size: 1.5rem; margin-bottom: 8px; }
.result p { color: var(--ink-3); margin-bottom: 24px; }
.result .toolbar { justify-content: center; }
.result .btn { flex: 0 1 auto; }

.hidden { display: none !important; }

/* Spinner */
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Ad slot (AdSense-ready placeholder) */
/* Emplacements publicitaires : la place est reservee des la maquette pour
   qu'aucun saut de mise en page n'apparaisse quand les annonces arrivent.
   Le cadre pointille n'est visible qu'en l'absence d'annonce (.ad-slot--vide). */
.ad-slot { max-width: 760px; margin: 46px auto 0; min-height: 90px; display: grid; place-items: center; }
.ad-slot--vide { border: 1px dashed var(--border); border-radius: var(--r-md);
  color: var(--muted); font-size: .82rem; background: var(--bg-2); }
.ad-slot ins { display: block; width: 100%; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); margin-top: 80px; }
.footer__inner { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; padding-block: 56px 40px; }
.footer__brand p { color: var(--ink-3); font-size: .92rem; margin-top: 14px; max-width: 30ch; }
.footer__col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 16px; font-weight: 700; }
.footer__col a { display: block; padding: 5px 0; color: var(--ink-2); font-size: .94rem; font-weight: 500; transition: color .2s; }
.footer__col a:hover { color: var(--brand-600); }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 24px; border-top: 1px solid var(--border); color: var(--ink-3); font-size: .88rem; }

/* Legal / content pages */
.prose { max-width: 760px; margin-inline: auto; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 12px; }
.prose .updated { color: var(--muted); font-size: .9rem; margin-bottom: 40px; }
.prose h2 { font-size: 1.5rem; margin: 40px 0 14px; }
.prose h3 { font-size: 1.15rem; margin: 26px 0 10px; }
.prose p, .prose li { color: var(--ink-2); margin-bottom: 14px; }
.prose ul { padding-left: 22px; margin-bottom: 14px; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--brand-600); font-weight: 600; }
.prose a:hover { text-decoration: underline; }
.prose strong { color: var(--ink); font-weight: 700; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .footer__inner { grid-template-columns: 1fr 1fr; gap: 30px; }
  .nav__links { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px; gap: 2px;
    transform: translateY(-140%); transition: transform .32s var(--ease); box-shadow: var(--shadow-lg); }
  .nav__links.open { transform: none; }
  .nav__link { padding: 13px 14px; }
  .nav__toggle { display: grid; }
}
@media (max-width: 560px) {
  .footer__inner { grid-template-columns: 1fr; }
  .toolbar .btn { min-width: 100%; }
  .hero__trust { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Mobile: les formulaires à colonnes fixes passent en 1 colonne (évite les champs écrasés) */
@media (max-width: 560px){ .form-grid[style*="grid-template-columns"]{ grid-template-columns:1fr !important; } }

/* ============================================================
   v3 — Hero pleine vue, densité, fin de page sans trou
   ============================================================ */

/* 1) Plus de vide mort avant le footer (la section précédente gère l'espace) */
.footer { margin-top: 0; }

/* 2) Hero : occupe la vue, composition en 3 zones (haut / centre / bas) */
.hero {
  min-height: calc(100svh - var(--nav-h));
  display: flex; flex-direction: column; justify-content: center;
  padding-top: clamp(28px, 4vw, 48px);
  padding-bottom: clamp(20px, 3vw, 34px);
}
.hero__inner { width: 100%; }
.hero h1 { margin: 18px 0 14px; }
.hero .lede { font-size: clamp(1rem, 1.4vw, 1.15rem); }

/* Accès rapides sous la recherche : utile + dense (anti-template) */
.quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.quick__label { width: 100%; text-align: center; font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.quick a {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
  font-size: .88rem; font-weight: 600; box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), border-color .18s, color .18s, box-shadow .18s;
}
.quick a:hover { transform: translateY(-2px); color: var(--ca, var(--brand-600)); border-color: var(--ca, var(--brand-500)); box-shadow: var(--shadow-md); }
:root[data-theme="dark"] .quick a:hover { color: var(--cb, var(--violet-500)); }
.quick a svg { width: 15px; height: 15px; color: var(--ca, var(--brand-600)); }
:root[data-theme="dark"] .quick a svg { color: var(--cb, var(--violet-500)); }

/* Bas du hero : la preuve + l'invitation à défiler, collées en bas de vue */
.hero__foot { margin-top: auto; padding-top: clamp(26px, 5vh, 54px); }
.hero__trust { margin-top: 0; }
.scroll-cue { display: flex; justify-content: center; margin-top: 22px; }
.scroll-cue a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--ink-3); box-shadow: var(--shadow-sm); animation: bob 2.4s var(--ease) infinite; }
.scroll-cue a:hover { color: var(--brand-600); border-color: var(--brand-500); }
.scroll-cue svg { width: 17px; height: 17px; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* 3) Bande de fin : comble le trou avant le footer avec du contenu utile */
.endband { border-top: 1px solid var(--border); background: var(--bg-2); }
.endband__inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; padding-block: clamp(34px, 5vw, 56px); }
.endband h3 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); margin-bottom: 6px; }
.endband p { color: var(--ink-3); font-size: .98rem; }
.endband__links { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 700px) {
  .hero { min-height: auto; padding-block: 40px 30px; }
  .hero__foot { margin-top: 34px; }
  .scroll-cue { display: none; }
  .endband__inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .scroll-cue a { animation: none; } }

/* Écrans peu hauts : on compacte pour que le hero tienne dans la vue */
@media (min-width: 701px) and (max-height: 860px) {
  .hero .h-display { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
  .hero h1 { margin: 12px 0 10px; }
  .hero .lede { font-size: .98rem; }
  .searchbar { margin-top: 20px; }
  .searchbar input { padding-block: 15px; }
  .searchbar__hint { margin-top: 10px; }
  .quick { margin-top: 12px; }
  .hero__foot { padding-top: 18px; }
  .scroll-cue { margin-top: 14px; }
}

/* ============================================================
   v4 — Illustration de fond thématique (SVG, discrète)
   ============================================================ */
.hero__art {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: .13; color: var(--brand-600);
  -webkit-mask-image: radial-gradient(135% 120% at 50% 48%, #000 55%, transparent 100%);
          mask-image: radial-gradient(135% 120% at 50% 48%, #000 55%, transparent 100%);
}
:root[data-theme="dark"] .hero__art { opacity: .18; color: var(--violet-500); }
.hero__art svg { width: 100%; height: 100%; display: block; }
.hero__art .fl { animation: floaty 14s ease-in-out infinite; transform-origin: center; }
.hero__art .fl:nth-child(2n) { animation-duration: 18s; animation-delay: -3s; }
.hero__art .fl:nth-child(3n) { animation-duration: 22s; animation-delay: -7s; }
/* on anime `translate` (propriete independante) : elle se COMPOSE avec le transform du SVG
   au lieu de l'ecraser — sinon toutes les icones retombent a l'origine */
@keyframes floaty { 0%,100% { translate: 0 0; } 50% { translate: 0 -14px; } }
@media (prefers-reduced-motion: reduce) { .hero__art .fl { animation: none; } }
/* la grille du hero s'efface un peu pour laisser respirer l'illustration */
.hero__grid { opacity: .32; }

/* ============================================================
   v2 — Recherche, couleurs par catégorie, mise en avant
   ============================================================ */

/* ---------- Accents par catégorie (scannabilité) ---------- */
:root {
  --c-pdf:   #e11d48;  --c-pdf-s:   #fb7185;
  --c-image: #7c3aed;  --c-image-s: #a78bfa;
  --c-conv:  #0284c7;  --c-conv-s:  #38bdf8;
  --c-text:  #d97706;  --c-text-s:  #fbbf24;
  --c-gen:   #059669;  --c-gen-s:   #34d399;
  --c-calc:  #0891b2;  --c-calc-s:  #22d3ee;
}
[data-cat="pdf"]   { --ca: var(--c-pdf);   --cb: var(--c-pdf-s); }
[data-cat="image"] { --ca: var(--c-image); --cb: var(--c-image-s); }
[data-cat="convert"]{ --ca: var(--c-conv);  --cb: var(--c-conv-s); }
[data-cat="texte"] { --ca: var(--c-text);  --cb: var(--c-text-s); }
[data-cat="generateurs"] { --ca: var(--c-gen); --cb: var(--c-gen-s); }
[data-cat="calcul"]{ --ca: var(--c-calc);  --cb: var(--c-calc-s); }

/* la carte hérite de l'accent de sa catégorie */
.tool-card[data-cat] .tool-card__icon {
  background: linear-gradient(135deg, color-mix(in srgb, var(--ca) 16%, transparent), color-mix(in srgb, var(--cb) 16%, transparent));
  color: var(--ca);
}
:root[data-theme="dark"] .tool-card[data-cat] .tool-card__icon { color: var(--cb); }
.tool-card[data-cat]::after { background: linear-gradient(135deg, var(--ca), var(--cb)); }
.tool-card[data-cat] .tool-card__arrow { color: var(--ca); }
:root[data-theme="dark"] .tool-card[data-cat] .tool-card__arrow { color: var(--cb); }
.tool-card[data-cat]:hover { box-shadow: 0 18px 44px -14px color-mix(in srgb, var(--ca) 45%, transparent); }
.cat[data-cat] .cat__icon { background: linear-gradient(135deg, var(--ca), var(--cb)); box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--ca) 55%, transparent); }
.cat-pill[data-cat]:hover, .cat-pill[data-cat].on { border-color: var(--ca); color: var(--ca); }
:root[data-theme="dark"] .cat-pill[data-cat]:hover, :root[data-theme="dark"] .cat-pill[data-cat].on { color: var(--cb); }
.cat-pill[data-cat] svg { color: var(--ca); }
:root[data-theme="dark"] .cat-pill[data-cat] svg { color: var(--cb); }

/* ---------- Barre de recherche (dans le hero) ---------- */
.searchbar { position: relative; max-width: 560px; margin: 30px auto 0; }
.searchbar__icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.searchbar input {
  width: 100%; padding: 18px 54px 18px 52px; font-size: 1.05rem; font-weight: 500;
  border: 1px solid var(--border-strong); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-md);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.searchbar input::placeholder { color: var(--muted); }
.searchbar input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 16%, transparent), var(--shadow-lg); }
.searchbar__clear { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: none; background: var(--bg-2); color: var(--ink-3); border-radius: 50%; cursor: pointer; display: none; place-items: center; }
.searchbar__clear.show { display: grid; }
.searchbar__clear:hover { background: var(--border-strong); color: var(--ink); }
.searchbar__hint { text-align: center; color: var(--ink-3); font-size: .88rem; font-weight: 600; margin-top: 14px; }
.searchbar__hint b { color: var(--brand-600); }
:root[data-theme="dark"] .searchbar__hint b { color: var(--violet-500); }

/* résultats de recherche */
.cat.is-hidden, .tool-card.is-hidden { display: none !important; }
.no-result { text-align: center; padding: 60px 20px; }
.no-result__icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; color: var(--muted); }
.no-result h3 { font-size: 1.2rem; margin-bottom: 8px; }
.no-result p { color: var(--ink-3); }

/* ---------- Mise en avant (bento, casse la grille uniforme) ---------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; }
.bento .tool-card { padding: 22px; }
.bento .tool-card--xl { grid-column: span 2; grid-row: span 2; padding: 30px; justify-content: flex-start; }
.bento .tool-card--xl .tool-card__icon { width: 60px; height: 60px; border-radius: var(--r-lg); }
.bento .tool-card--xl .tool-card__icon svg { width: 30px; height: 30px; }
.bento .tool-card--xl h3 { font-size: 1.5rem; }
.bento .tool-card--xl p { font-size: 1rem; }
.bento .tool-card--w { grid-column: span 2; }
.bento__tag { position: absolute; top: 16px; right: 16px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 5px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--ca, var(--brand-500)) 14%, transparent); color: var(--ca, var(--brand-600)); }
:root[data-theme="dark"] .bento__tag { color: var(--cb, var(--violet-500)); }
@media (max-width: 900px) { .bento { grid-template-columns: repeat(2, 1fr); } .bento .tool-card--xl { grid-column: span 2; grid-row: auto; } }
@media (max-width: 560px) { .bento { grid-template-columns: 1fr; } .bento .tool-card--xl, .bento .tool-card--w { grid-column: span 1; } }

/* Illustration de fond aussi sur les pages outils */
.tool-hero { position: relative; overflow: hidden; }
.tool-hero .hero__art { opacity: .085; }
:root[data-theme="dark"] .tool-hero .hero__art { opacity: .13; }

/* ---------- Selecteur de langue ---------- */
.langsel { position: relative; }
.langsel__btn { width: auto; padding: 0 12px; gap: 7px; display: inline-flex; align-items: center; height: 40px;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm); color: var(--ink-2);
  font-weight: 700; font-size: .82rem; cursor: pointer; transition: all .2s var(--ease); }
.langsel__btn:hover { color: var(--ink); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.langsel__btn svg { width: 17px; height: 17px; }
.langsel__menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 268px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.langsel.open .langsel__menu { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
@media (max-width: 380px) { .langsel__menu { min-width: 0; width: calc(100vw - 32px); } }
.langsel__menu a { display: block; padding: 9px 12px; border-radius: var(--r-sm); font-weight: 600;
  font-size: .92rem; color: var(--ink-2); transition: background .18s, color .18s; }
.langsel__menu a:hover { background: var(--bg-2); color: var(--ink); }
.langsel__menu a.on { color: var(--brand-600); background: var(--grad-soft); }
:root[data-theme="dark"] .langsel__menu a.on { color: var(--violet-500); }
@media (max-width: 860px) { .langsel__btn span { display: none; } .langsel__btn { padding: 0 10px; } }

/* ---------- Support de l'ecriture de droite a gauche (arabe) ---------- */
[dir="rtl"] .nav__links { margin-left: 0; margin-right: auto; }
[dir="rtl"] .icon-btn[onclick] { margin-left: 0 !important; margin-right: auto; }
[dir="rtl"] .langsel__menu { right: auto; left: 0; }
[dir="rtl"] .breadcrumb svg { transform: scaleX(-1); }
[dir="rtl"] .tool-card__arrow svg,
[dir="rtl"] .btn svg:last-child { transform: scaleX(-1); }
[dir="rtl"] .file-item__actions { margin-left: 0; margin-right: auto; }
[dir="rtl"] .page-thumb__num { left: auto; right: 8px; }
[dir="rtl"] .page-thumb__order,
[dir="rtl"] .page-thumb__del { left: auto; right: 8px; }
[dir="rtl"] .page-thumb__check,
[dir="rtl"] .page-thumb__rotate { right: auto; left: 8px; }
[dir="rtl"] .searchbar__icon { left: auto; right: 20px; }
[dir="rtl"] .searchbar input { padding: 18px 52px 18px 54px; }
[dir="rtl"] .searchbar__clear { right: auto; left: 16px; }
[dir="rtl"] .prose ul { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .kv { direction: rtl; }
[dir="rtl"] .field .suffix span { right: auto; left: 14px; }
[dir="rtl"] .field .suffix input { padding-right: 14px; padding-left: 44px; }
/* le code et les valeurs techniques restent de gauche a droite */
[dir="rtl"] .mono, [dir="rtl"] code, [dir="rtl"] .dns-table td.val,
[dir="rtl"] .hdr-table td, [dir="rtl"] .addr-box .mail { direction: ltr; text-align: left; }

/* ---------- Formulaire de contact (page « A propos ») ---------- */
.contact { display: grid; gap: 16px; margin: 18px 0 6px; }
.contact__duo { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.contact textarea { resize: vertical; min-height: 132px; }
/* Le leurre a spam : hors ecran, jamais masque par display:none, que certains
   robots savent detecter. */
.contact__leurre { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact__pied { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.contact__etat { margin: 0; font-weight: 600; font-size: .92rem; }
.contact__etat.ok { color: var(--success); }
.contact__etat.ko { color: var(--danger); }
.contact__note { margin: 0; color: var(--ink-3); font-size: .86rem; }
@media (max-width: 560px) { .contact__duo { grid-template-columns: 1fr; } }
