/* ═══════════════════════════════════════════════════════════════════════════
   RÔLE   : Styles de l'outil "Convert" (Image → SVG et SVG → Image)
   CHEMIN : css/convert.css
   NOTE   : Ce fichier définit ses propres tokens (:root) pour rester
            autonome. Si un fichier de tokens partagé existe déjà ailleurs
            dans le projet (variables identiques), ce bloc :root peut être
            supprimé ici pour éviter la duplication — à vérifier côté projet.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── TOKENS — THÈME SOMBRE (défaut) ────────────────────────────────────── */
:root {
  --scaffold-bg: #0a0d14;
  --surface: #101422;
  --surface-card: #181e2e;
  --on-surface: #e8edf2;
  --on-surface-sec: #8a9bb0;
  --divider: #2a3d55;

  --success: #00c2a8;
  --warning: #f57c00;
  --danger: #e53935;
  --info: #1a73e8;

  --grad-start: #4dffd2;
  --grad-mid: #2b8fff;
  --grad-end: #5b3fe8;
  --primary: #2b8fff;

  --sp-xs: 4px;
  --sp-s: 8px;
  --sp-m: 16px;
  --sp-l: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --r-xl: 24px;
  --r-full: 100px;
}

:root[data-theme="light"] {
  --scaffold-bg: #f8faff;
  --surface: #eef2fb;
  --surface-card: #ffffff;
  --on-surface: #1c2a3a;
  --on-surface-sec: #5a6b7c;
  --divider: #c5d0de;
}

/* ── RESET & BASE ──────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}

html[dir="rtl"] .comparison-arrow svg {
  transform: scaleX(-1);
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--scaffold-bg);
  color: var(--on-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
button {
  font-family: inherit;
}

body,
header,
.tool-card,
.warning-card,
footer,
.footer-container,
.footer-col,
.nav-link,
.theme-toggle,
.lang-toggle,
.lang-menu,
.btn-primary {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SPLASH SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */
#splash {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(43, 143, 255, 0.08),
    var(--scaffold-bg) 70%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 80px var(--sp-l) 60px;
  z-index: 9999;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

#splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  animation: splashIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes splashIn {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.splash-lottie {
  width: 140px;
  height: 140px;
}

.splash-rcbg {
  width: 60px;
  height: 60px;
  object-fit: contain;
  opacity: 0.5;
}

/* État "problème réseau" — seul cas où le splash reste affiché volontairement */
.splash-retry {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-m);
  text-align: center;
  max-width: 320px;
}

#splash.splash-error .splash-retry {
  display: flex;
}
#splash.splash-error .splash-lottie {
  opacity: 0.3;
}

.splash-retry p {
  font-size: 13px;
  color: var(--on-surface-sec);
}

.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-s);
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: var(--r-m);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface);
  cursor: pointer;
}

.btn-retry:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════════ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 13, 20, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--divider);
}

:root[data-theme="light"] header {
  background: rgba(248, 250, 255, 0.92);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-m) var(--sp-l);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-m);
  flex-wrap: wrap;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
  flex-shrink: 0;
}
.nav-logo img {
  width: 32px;
  height: 32px;
}
.nav-logo span {
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-mid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── NAV LINKS (vers les autres outils) ────────────────────────────────── */
.nav-links {
  display: flex;
  gap: var(--sp-xs);
  list-style: none;
  flex-wrap: wrap;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-m);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-sec);
  white-space: nowrap;
}
.nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.nav-link:hover {
  color: var(--primary);
  background: rgba(43, 143, 255, 0.08);
}
.nav-link.active {
  color: var(--primary);
  background: rgba(43, 143, 255, 0.08);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--on-surface);
  cursor: pointer;
  padding: 8px;
}
.nav-toggle svg {
  width: 22px;
  height: 22px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
}

/* ── LANGUAGE SWITCH (façon hub) ────────────────────────────────────────── */
.lang-switch {
  position: relative;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-full);
  background: var(--surface-card);
  border: 1px solid var(--divider);
  color: var(--on-surface);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
}
.lang-toggle svg {
  width: 16px;
  height: 16px;
}
.lang-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: var(--r-m);
  list-style: none;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
  z-index: 50;
}
html[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}
.lang-switch.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-menu li {
  padding: 8px 12px;
  border-radius: var(--r-s);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--on-surface-sec);
}
.lang-menu li:hover {
  background: rgba(43, 143, 255, 0.08);
  color: var(--primary);
}
.lang-menu li.active {
  color: var(--primary);
  background: rgba(43, 143, 255, 0.1);
}

/* ── THEME TOGGLE ───────────────────────────────────────────────────────── */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  background: var(--surface-card);
  border: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--on-surface);
  position: relative;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: rotate(15deg);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  position: absolute;
  transition:
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
}
.theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
.theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}
:root[data-theme="light"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}
:root[data-theme="light"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN / HERO
   ═══════════════════════════════════════════════════════════════════════════ */
.compress-main {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: var(--sp-xl) var(--sp-l) var(--sp-xxl);
  flex: 1;
}

.compress-hero {
  text-align: center;
  margin-bottom: var(--sp-l);
}
.compress-hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: var(--sp-s);
}
.compress-hero p {
  font-size: 15px;
  color: var(--on-surface-sec);
}

/* ── MODE TABS (Image→SVG / SVG→Image) ─────────────────────────────────── */
/* ── MODE TABS (compact & élégant) ─────────────────────────────────────── */
.mode-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-full);
  padding: 4px;
  margin: 0 auto var(--sp-l);
  width: fit-content;
  max-width: 100%;
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: var(--r-full);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-sec);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.mode-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.mode-tab:hover:not(.active) {
  color: var(--on-surface);
  background: rgba(43, 143, 255, 0.05);
}

.mode-tab.active {
  background: linear-gradient(135deg, var(--grad-start), var(--grad-mid));
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 194, 168, 0.3);
}

.mode-tab.active svg {
  opacity: 1;
}

/* Responsive : empiler verticalement sur petit écran */
@media (max-width: 500px) {
  .mode-tabs {
    flex-direction: column;
    width: 100%;
    border-radius: var(--r-l);
  }
  .mode-tab {
    width: 100%;
    border-radius: var(--r-m);
  }
}

/* ── WARNING (fermable) ────────────────────────────────────────────────── */
.warning-section {
  margin-bottom: var(--sp-xl);
}

.warning-card {
  background: linear-gradient(
    135deg,
    rgba(245, 124, 0, 0.08),
    rgba(245, 124, 0, 0.03)
  );
  border: 1px solid rgba(245, 124, 0, 0.3);
  border-radius: var(--r-l);
  padding: var(--sp-m);
  display: flex;
  gap: var(--sp-m);
  align-items: flex-start;
  position: relative;
}

.warning-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-s);
  background: rgba(245, 124, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warning);
  flex-shrink: 0;
}
.warning-icon svg {
  width: 22px;
  height: 22px;
}

.warning-text {
  flex: 1;
  padding-inline-end: 28px;
}
.warning-text h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--warning);
}
.warning-text p {
  font-size: 13px;
  color: var(--on-surface-sec);
  line-height: 1.6;
}
.warning-text a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}

.warning-close {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: var(--on-surface-sec);
  cursor: pointer;
  border-radius: var(--r-s);
  display: flex;
  align-items: center;
  justify-content: center;
}
.warning-close:hover {
  background: rgba(245, 124, 0, 0.15);
  color: var(--warning);
}
.warning-close svg {
  width: 16px;
  height: 16px;
}

/* ── DROP ZONE ──────────────────────────────────────────────────────────── */
.drop-section {
  margin-bottom: var(--sp-xl);
}

.drop-zone {
  background: var(--surface);
  border: 2px dashed var(--divider);
  border-radius: var(--r-xl);
  padding: var(--sp-xxl) var(--sp-xl);
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--success);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 194, 168, 0.12);
}

.drop-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--r-l);
  background: linear-gradient(
    135deg,
    rgba(0, 194, 168, 0.15),
    rgba(77, 255, 210, 0.08)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-m);
  color: var(--success);
}
.drop-icon svg {
  width: 36px;
  height: 36px;
}

.drop-zone h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--sp-xs);
}
.drop-zone p {
  font-size: 14px;
  color: var(--on-surface-sec);
  margin-bottom: var(--sp-m);
}

.drop-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: var(--sp-s);
}
.drop-formats span {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: var(--r-full);
  color: var(--on-surface-sec);
}

.drop-limits {
  margin-bottom: var(--sp-l);
  font-size: 12px;
  color: var(--on-surface-sec);
  font-style: italic;
}

.btn-select {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-s);
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: var(--r-m);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface);
  cursor: pointer;
}
.btn-select:hover {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

/* ── CONFIG BLOCKS ──────────────────────────────────────────────────────── */
.config-section {
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preview-block,
.config-block {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-xl);
  padding: var(--sp-l);
  margin-bottom: var(--sp-m);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-m);
}
.config-title {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
  font-size: 16px;
  font-weight: 700;
}
.config-title svg {
  width: 20px;
  height: 20px;
  color: var(--success);
}

.btn-clear {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-sec);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--r-s);
}
.btn-clear:hover {
  background: var(--surface-card);
  color: var(--primary);
}

.preview-container {
  display: flex;
  gap: var(--sp-l);
  align-items: center;
  flex-wrap: wrap;
}
.preview-img {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--r-m);
  object-fit: contain;
  background: var(--surface-card);
  border: 1px solid var(--divider);
}
.preview-info {
  flex: 1;
  min-width: 180px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  padding: var(--sp-s) 0;
  border-bottom: 1px solid var(--divider);
  gap: var(--sp-m);
}
.info-row:last-child {
  border-bottom: none;
}
.info-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-sec);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
  word-break: break-all;
  text-align: end;
}

.config-row {
  margin-bottom: var(--sp-m);
}
.config-row:last-child {
  margin-bottom: 0;
}
.config-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: var(--sp-s);
}

.colors-selector,
.format-selector,
.scale-selector {
  display: flex;
  gap: var(--sp-xs);
  flex-wrap: wrap;
}
.color-btn,
.format-btn,
.scale-btn {
  flex: 1;
  min-width: 50px;
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: var(--r-s);
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface);
  cursor: pointer;
}
.color-btn:hover,
.format-btn:hover,
.scale-btn:hover {
  border-color: var(--success);
}
.color-btn.active,
.format-btn.active,
.scale-btn.active {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.detail-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-s);
}
.detail-btn {
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: var(--r-m);
  padding: var(--sp-m);
  cursor: pointer;
  text-align: center;
}
.detail-btn:hover {
  border-color: var(--success);
  transform: translateY(-2px);
}
.detail-btn.active {
  border-color: var(--success);
  background: rgba(0, 194, 168, 0.08);
  box-shadow: 0 4px 12px rgba(0, 194, 168, 0.15);
}
.detail-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 2px;
}
.detail-desc {
  display: block;
  font-size: 11px;
  color: var(--on-surface-sec);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-s);
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
  cursor: pointer;
  padding: var(--sp-s);
  border-radius: var(--r-s);
}
.checkbox-label:hover {
  background: var(--surface-card);
}
.checkbox-label input[type="checkbox"] {
  display: none;
}
.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--divider);
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
}
.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: var(--success);
  border-color: var(--success);
}
.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.bg-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-s);
}
.bg-btn {
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: var(--r-m);
  padding: var(--sp-s);
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.bg-btn:hover {
  border-color: var(--success);
  transform: translateY(-2px);
}
.bg-btn.active {
  border-color: var(--success);
  background: rgba(0, 194, 168, 0.08);
  box-shadow: 0 4px 12px rgba(0, 194, 168, 0.15);
}
.bg-preview {
  width: 36px;
  height: 36px;
  border-radius: var(--r-s);
  border: 1px solid var(--divider);
}
.bg-transparent {
  background: repeating-conic-gradient(#808080 0% 25%, transparent 0% 50%) 50% /
    12px 12px;
}
.bg-white {
  background: #ffffff;
}
.bg-black {
  background: #000000;
}
.bg-custom {
  background: #f8faff;
}
.bg-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface);
}

.custom-color-row {
  display: flex;
  align-items: center;
  gap: var(--sp-m);
  margin-top: var(--sp-s);
  padding: var(--sp-s);
  background: var(--surface-card);
  border-radius: var(--r-s);
}
.color-picker {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--r-s);
  cursor: pointer;
  padding: 0;
  background: none;
}
.color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-picker::-webkit-color-swatch {
  border: 2px solid var(--divider);
  border-radius: var(--r-s);
}
.color-hex {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-sec);
  font-family: monospace;
}

.action-buttons {
  display: flex;
  gap: var(--sp-m);
  margin-top: var(--sp-l);
}
.btn-primary-large {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-s);
  background: linear-gradient(
    135deg,
    var(--grad-start),
    var(--grad-mid),
    var(--grad-end)
  );
  border: none;
  border-radius: var(--r-m);
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 194, 168, 0.25);
}
.btn-primary-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 194, 168, 0.35);
}
.btn-primary-large:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── PROGRESS ───────────────────────────────────────────────────────────── */
.progress-section {
  animation: fadeIn 0.4s ease;
}
.progress-card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  text-align: center;
}
.progress-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--sp-l);
}
.progress-bar-container {
  height: 8px;
  background: var(--surface-card);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--sp-m);
}
.progress-bar {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--grad-start),
    var(--grad-mid),
    var(--grad-end)
  );
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}
.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--on-surface-sec);
}

/* ── RESULTS ────────────────────────────────────────────────────────────── */
.results-section {
  animation: fadeIn 0.5s ease;
}
.results-card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  text-align: center;
}
.results-success {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--sp-l);
}
.results-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: var(--sp-l);
}

.comparison-container {
  display: flex;
  align-items: center;
  gap: var(--sp-m);
  margin-bottom: var(--sp-xl);
  padding: var(--sp-m);
  background: var(--surface-card);
  border-radius: var(--r-l);
}
.comparison-side {
  flex: 1;
  text-align: center;
  min-width: 0;
}
.comparison-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--on-surface-sec);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--sp-s);
}
.comparison-preview {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: var(--r-m);
  overflow: hidden;
  margin-bottom: var(--sp-s);
  background-image: repeating-conic-gradient(
    rgba(128, 128, 128, 0.15) 0% 25%,
    transparent 0% 50%
  );
  background-size: 14px 14px;
}
.comparison-preview img,
.comparison-preview .svg-preview {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.svg-preview {
  width: 100%;
  height: 100%;
}
.svg-preview svg {
  width: 100%;
  height: 100%;
}
.comparison-size {
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface);
}
.comparison-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.comparison-arrow svg {
  width: 20px;
  height: 20px;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-m);
  margin-bottom: var(--sp-xl);
}
.result-stat {
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: var(--r-m);
  padding: var(--sp-m);
}
.result-stat.result-success {
  border-color: var(--success);
  background: rgba(0, 194, 168, 0.05);
}
.result-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface-sec);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.result-value {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--on-surface);
}
.result-success .result-value {
  color: var(--success);
}

.results-actions {
  display: flex;
  gap: var(--sp-m);
  justify-content: center;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-s);
  background: linear-gradient(
    135deg,
    var(--grad-start),
    var(--grad-mid),
    var(--grad-end)
  );
  color: #fff;
  border: none;
  border-radius: var(--r-m);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 194, 168, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 194, 168, 0.35);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--divider);
  border-radius: var(--r-m);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface);
  cursor: pointer;
}
.btn-ghost:hover {
  border-color: var(--success);
  background: var(--surface-card);
}

/* Toasts (erreurs) */
.toast {
  position: fixed;
  top: 80px;
  inset-inline-end: 20px;
  background: var(--danger);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(229, 57, 53, 0.3);
  z-index: 10000;
  max-width: 320px;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
html[dir="rtl"] .toast {
  animation: toastInRtl 0.3s ease;
}
@keyframes toastInRtl {
  from {
    transform: translateX(-120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER — grille sur desktop, empilé et centré sur mobile
   ═══════════════════════════════════════════════════════════════════════════ */
footer {
  background: var(--surface);
  border-top: 1px solid var(--divider);
  padding: var(--sp-xxl) var(--sp-l) var(--sp-l);
  margin-top: auto;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-xl);
  margin-bottom: var(--sp-xl);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-m);
}
.footer-brand .logos {
  display: flex;
  align-items: center;
  gap: var(--sp-m);
}
.footer-brand .logos img {
  height: 32px;
  opacity: 0.85;
}
.footer-brand .logos .separator {
  width: 1px;
  height: 22px;
  background: var(--divider);
}
.footer-brand p {
  color: var(--on-surface-sec);
  font-size: 13px;
  max-width: 350px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--on-surface);
  margin-bottom: var(--sp-m);
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: var(--sp-s);
}
.footer-col ul a {
  color: var(--on-surface-sec);
  text-decoration: none;
  font-size: 13px;
}
.footer-col ul a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: var(--sp-l);
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-m);
  font-size: 12px;
  color: var(--on-surface-sec);
}
.footer-bottom .rcbg {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
}
.footer-bottom .rcbg img {
  height: 20px;
  opacity: 0.7;
}

/* ── BOUTON FLOTTANT DON ────────────────────────────────────────────────── */
.donate-float {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(
    135deg,
    var(--grad-start),
    var(--grad-mid),
    var(--grad-end)
  );
  color: #fff;
  padding: 12px 8px;
  border-radius: var(--r-m);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(43, 143, 255, 0.3);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 1px;
}
html[dir="rtl"] .donate-float {
  left: auto;
  right: 24px;
  writing-mode: vertical-lr;
}
.donate-float svg {
  width: 20px;
  height: 20px;
}
.donate-float:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 12px 32px rgba(43, 143, 255, 0.4);
}
.donate-text {
  font-size: 10px;
  opacity: 0.9;
}

@media (max-width: 1200px) {
  .donate-float {
    left: 12px;
    padding: 10px 6px;
  }
  html[dir="rtl"] .donate-float {
    left: auto;
    right: 12px;
  }
  .donate-text {
    display: none;
  }
  .donate-float svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 760px) {
  .donate-float {
    left: auto;
    right: 16px;
    top: auto;
    bottom: 24px;
    transform: none;
    writing-mode: horizontal-tb;
    padding: 10px 14px;
    border-radius: var(--r-full);
    flex-direction: row;
    gap: 6px;
  }
  html[dir="rtl"] .donate-float {
    right: auto;
    left: 16px;
  }
  .donate-float:hover {
    transform: none;
  }
  .donate-text {
    display: inline;
    font-size: 12px;
  }
  .donate-float svg {
    width: 18px;
    height: 18px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-l);
  }
  .footer-brand {
    grid-column: 1 / -1;
    text-align: center;
    align-items: center;
  }
  .footer-brand .logos {
    justify-content: center;
  }
  .footer-brand p {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: var(--sp-m);
    border-bottom: 1px solid var(--divider);
    gap: var(--sp-xs);
  }
  .nav-links.open .nav-link {
    padding: var(--sp-s) var(--sp-m);
    border-radius: var(--r-m);
  }
  .nav-links.open .nav-link:hover {
    background: rgba(43, 143, 255, 0.08);
  }
  html[dir="rtl"] .lang-menu {
    right: auto;
    left: 0;
  }
}

@media (max-width: 700px) {
  .nav-container {
    padding: var(--sp-s) var(--sp-m);
  }
  .compress-main {
    padding: var(--sp-m) var(--sp-m) var(--sp-xl);
  }
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--sp-l);
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-col {
    margin: 0 auto;
    max-width: 300px;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: var(--sp-m);
  }
  .footer-bottom .rcbg {
    justify-content: center;
  }
  .mode-tab span {
    font-size: 12px;
  }
  .drop-zone {
    padding: var(--sp-xl) var(--sp-m);
  }
  .preview-container {
    flex-direction: column;
  }
  .preview-img {
    max-width: 100%;
  }
  .info-row {
    flex-wrap: wrap;
  }
  .detail-selector {
    grid-template-columns: 1fr;
  }
  .bg-selector {
    grid-template-columns: repeat(2, 1fr);
  }
  .comparison-container {
    flex-direction: column;
  }
  .comparison-arrow {
    transform: rotate(90deg);
  }
  html[dir="rtl"] .comparison-arrow {
    transform: rotate(90deg) scaleX(-1);
  }
  .results-stats {
    grid-template-columns: 1fr;
  }
  .results-actions {
    flex-direction: column;
  }
  .results-actions button {
    width: 100%;
  }
  footer {
    padding: var(--sp-l) var(--sp-m);
  }
  .footer-container {
    gap: var(--sp-s);
  }
}
