/* =========================
   Variables & thème
========================= */

:root {
  --font-main: "Archivo", "Segoe UI", Arial, sans-serif;

  --color-bg:           #0f1413;
  --color-surface:      #161d1b;
  --color-surface-light:#1f2926;
  --color-text:         #f4f7f6;
  --color-muted:        #9ba8a4;
  --color-border:       rgba(255, 255, 255, 0.08);
  --color-primary:      #037a68;
  --color-primary-hover:#04977f;
  --color-card-shadow:  rgba(0, 0, 0, 0.28);
  --color-error:        #ff8f8f;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --container-width: 1080px;
  --header-height:   72px;
}

html[data-theme="light"] {
  --color-bg:           #f1f7f5;
  --color-surface:      #fbfdfc;
  --color-surface-light:#e8f2ef;
  --color-text:         #141817;
  --color-muted:        #66736f;
  --color-border:       rgba(0, 0, 0, 0.08);
  --color-card-shadow:  rgba(0, 0, 0, 0.08);
  --color-error:        #c0392b;
}

/* =========================
   Reset minimal
========================= */

*  { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-main);
  background:
    radial-gradient(circle at top left, rgba(3, 122, 104, 0.18), transparent 36rem),
    var(--color-bg);
  color: var(--color-text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

[hidden] { display: none !important; }

/* =========================
   Header
========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
  background: rgba(15, 20, 19, 0.82);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .site-header {
  background: rgba(246, 248, 247, 0.82);
}

.header-container {
  width: min(100% - 32px, var(--container-width));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-name {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.nav-link {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--color-surface-light);
  color: var(--color-text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── Sélecteur de langue ── */

.language-selector {
  position: relative;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  cursor: pointer;
}

.language-toggle img {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  object-fit: cover;
}

.language-arrow {
  font-size: 0.7rem;
  opacity: 0.65;
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 145px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: 0 18px 50px var(--color-card-shadow);
  display: none;
  z-index: 50;
}

.language-selector.open .language-dropdown {
  display: grid;
  gap: 4px;
}

.language-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  font-size: 0.92rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.language-dropdown button:hover {
  background: var(--color-surface-light);
}

.language-dropdown img {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  object-fit: cover;
}

/* ── Bouton thème ── */

.theme-toggle {
  width: 38px;
  height: 38px;
  padding: 9px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: var(--color-surface-light);
}

/* =========================
   Layout global
========================= */

.main-content {
  width: min(100% - 32px, var(--container-width));
  margin: 0 auto;
  padding: 48px 0 56px;
}

.site-footer {
  width: min(100% - 32px, var(--container-width));
  margin: 0 auto;
  padding: 34px 0 42px;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  text-align: center;
  font-size: 0.88rem;
}

.site-footer p {
  margin: 6px 0;
}

/* =========================
   Page d'accueil
========================= */

.hero-section {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 32px;
}

.hero-tagline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 0;
  padding: 10px 18px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.18);
  font-size: 1.05rem;
  font-weight: 700;
}

.tools-section {
  max-width: 820px;
  margin: 0 auto;
}

.tools-section h2,
.coming-section h2 {
  margin: 0 0 18px;
  font-size: 1rem;
  color: var(--color-muted);
  font-weight: 600;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
}

/* ── Cartes outils ── */

.tool-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 130px;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--color-surface), var(--color-surface-light));
  box-shadow: 0 18px 50px var(--color-card-shadow);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.tool-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(3, 122, 104, 0.52);
  box-shadow: 0 24px 70px var(--color-card-shadow);
}

.tool-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.tool-card p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.55;
}

.tool-illustration {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.home-tool-card {
  width: 100%;
  min-height: 220px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 26px;
}

.home-tool-card .tool-illustration {
  width: 62px;
  height: 62px;
}

.home-tool-card h3 { margin-top: 2px; }
.home-tool-card p  { font-size: 0.94rem; }

/* ── Section "À venir" ── */

.coming-section {
  max-width: 820px;
  margin: 84px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
}

.coming-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.coming-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 110px;
  padding: 18px 12px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  color: var(--color-muted);
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.45;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.coming-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] .coming-card {
  background: rgba(0, 0, 0, 0.02);
}

.coming-card img {
  width: 28px;
  height: 28px;
  opacity: 0.72;
}

.coming-card span {
  font-size: 0.85rem;
  line-height: 1.35;
}

.coming-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(3, 122, 104, 0.12);
  color: var(--color-primary);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* =========================
   Pages outils — layout
========================= */

.tool-page {
  max-width: 920px;
}

.tool-page-hero {
  text-align: center;
  margin: 0 auto 36px;
}

.tool-page-hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.tool-page-hero p {
  max-width: 560px;
  margin: 20px auto 0;
  color: var(--color-muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

/* =========================
   Boutons globaux
========================= */

.primary-button,
.ghost-button {
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform   0.2s ease,
    opacity     0.2s ease,
    background  0.2s ease,
    color       0.2s ease;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
  padding: 15px 22px;
  border: 0;
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 14px 36px rgba(3, 122, 104, 0.32);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-muted);
}

.ghost-button:hover {
  transform: translateY(-2px);
  background: var(--color-surface-light);
  color: var(--color-text);
}

/* ── Spinner ── */

.button-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

.primary-button.is-loading .button-spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================
   Formulaires
========================= */

.form-label {
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-input {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  color: var(--color-text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(3, 122, 104, 0.14);
}

.form-input::placeholder {
  color: var(--color-muted);
}

.form-error {
  margin: -4px 0 0;
  color: var(--color-error);
  font-size: 0.88rem;
  font-weight: 700;
}

/* =========================
   Page PDF
========================= */

.pdf-upload-panel {
  max-width: 680px;
  margin: 0 auto;
  padding: 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top, rgba(3, 122, 104, 0.12), transparent 22rem),
    var(--color-surface);
  box-shadow: 0 22px 70px var(--color-card-shadow);
}

.pdf-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 230px;
  padding: 34px 24px;
  border: 1px dashed rgba(244, 247, 246, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

html[data-theme="light"] .pdf-dropzone {
  border-color: rgba(0, 0, 0, 0.14);
}

.pdf-dropzone:hover,
.pdf-dropzone.drag-over {
  border-color: var(--color-primary);
  background: rgba(3, 122, 104, 0.12);
  transform: translateY(-2px);
}

.pdf-dropzone-icon {
  display: none;
}

.pdf-dropzone-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 14px 36px rgba(3, 122, 104, 0.32);
}

.pdf-dropzone-subtitle {
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* ── Carte fichier (partagée PDF & Images) ── */

.pdf-file-card,
.image-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
}

.pdf-file-label {
  margin: 0 0 4px;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pdf-file-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-file-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  object-fit: contain;
}

.pdf-file-name {
  margin: 0;
  font-weight: 800;
  line-height: 1;
}

.pdf-file-size {
  margin: 6px 0 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* =========================
   Page QR Code
========================= */

.qr-panel {
  max-width: 680px;
  margin: 0 auto;
  padding: 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top, rgba(3, 122, 104, 0.12), transparent 22rem),
    var(--color-surface);
  box-shadow: 0 22px 70px var(--color-card-shadow);
}

.qr-form {
  display: grid;
  gap: 14px;
}

.qr-preview-card {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.035);
}

.qr-preview {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 24px;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.qr-preview svg {
  width: min(100%, 240px);
  height: auto;
}

.qr-status {
  margin: 20px 0 10px;
  text-align: center;
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.qr-destination {
  margin: 10px 0 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.qr-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.qr-actions .ghost-button {
  flex: 1;
}

.qr-filename-options {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

.qr-custom-name-field {
  display: grid;
  gap: 8px;
}

.input-counter {
  margin: -2px 0 0;
  color: var(--color-muted);
  font-size: 0.8rem;
  text-align: right;
}

.qr-file-preview {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

/* ── Historique QR ── */

.qr-history {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.035);
}

.qr-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.qr-history-header h2 {
  margin: 0;
  font-size: 1rem;
}

.qr-history-header .ghost-button {
  flex: 0 0 auto;
  padding: 9px 14px;
}

.qr-history-list {
  display: grid;
  gap: 10px;
}

.qr-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.qr-history-item strong {
  display: block;
  font-size: 0.92rem;
}

.qr-history-item span {
  display: block;
  margin-top: 4px;
  color: var(--color-muted);
  font-size: 0.82rem;
  word-break: break-word;
}

/* =========================
   Page Images
========================= */

.images-panel {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(3, 122, 104, 0.1), transparent 22rem),
    var(--color-surface);
  box-shadow: 0 22px 70px var(--color-card-shadow);
}

/* ── Sélecteur de mode ── */

.mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 620px;
  margin: 0 auto 20px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.mode-button {
  min-height: 44px;
  padding: 12px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.mode-button:hover {
  color: var(--color-text);
  transform: translateY(-1px);
}

.mode-button.active {
  color: #ffffff;
  background: var(--color-primary);
  box-shadow: 0 10px 24px rgba(3, 122, 104, 0.28);
}

/* ── Zone de dépôt ── */

.image-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 620px;
  margin: 0 auto 28px;
  align-items: start;
}

.image-workspace.pdf-active {
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.image-upload-column {
  min-width: 0;
}

.image-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 220px;
  margin: 0;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 18px 44px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

html[data-theme="light"] .image-dropzone {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.035),
    0 18px 44px rgba(15, 23, 42, 0.08);
}

.image-dropzone:hover,
.image-dropzone.drag-over {
  border-color: var(--color-primary);
  background: rgba(3, 122, 104, 0.08);
  box-shadow:
    0 0 0 4px rgba(3, 122, 104, 0.12),
    0 24px 60px rgba(3, 122, 104, 0.14);
  transform: translateY(-2px);
}

.image-dropzone-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(3, 122, 104, 0.14);
}

.image-dropzone-icon img {
  width: 30px;
  height: 30px;
}

.image-dropzone-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.image-dropzone-subtitle {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.image-supported-formats {
  margin: 14px 0 0;
  color: var(--color-muted);
  font-size: 0.82rem;
  text-align: center;
  line-height: 1.5;
}

.image-mode-note {
  margin: 12px 0 0;
  padding: 10px 14px;
  border: 1px solid rgba(3, 122, 104, 0.22);
  border-radius: 999px;
  background: rgba(3, 122, 104, 0.1);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}

#image-error {
  margin: 12px 0 0;
  text-align: center;
}

/* ── Options format de sortie ── */

.image-options {
  display: grid;
  gap: 8px;
  max-width: 620px;
  margin: 0 auto 28px;
}

.image-options .form-label {
  margin: 0 0 10px;
}

.format-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.format-button {
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.format-button:hover {
  color: var(--color-text);
  transform: translateY(-1px);
}

.format-button.active {
  color: #ffffff;
  background: var(--color-primary);
  box-shadow: 0 10px 24px rgba(3, 122, 104, 0.24);
}

/* ── Options PDF image ── */

.image-pdf-options {
  width: 100%;
  margin: 0;
  padding: 16px;
  align-self: start;
  border: 1px solid var(--color-border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.025);
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

.image-pdf-options:hover {
  opacity: 1;
}

.image-pdf-options > .form-label {
  display: block;
  margin: 0 0 14px;
  text-align: center;
}

.pdf-options-grid {
  display: grid;
  gap: 14px;
}

.pdf-option-group {
  display: grid;
  gap: 8px;
}

.pdf-option-title {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compact-selector {
  grid-template-columns: 1fr;
  border-radius: 16px;
}

.compact-selector .format-button {
  padding: 10px 12px;
  font-size: 0.84rem;
}

/* ── Carte fichier image ── */

.image-file-card,
#image-process-button {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.image-file-card {
  margin-bottom: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

#image-process-button {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* ── Liste fichiers (mode PDF) ── */

.image-file-list {
  max-width: 620px;
  margin: -4px auto 22px;
  display: grid;
  gap: 10px;
}

.image-file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.image-file-item-info {
  min-width: 0;
}

.image-file-item-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  word-break: break-word;
}

.image-file-item-meta {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 0.8rem;
}

.image-file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-action-button {
  min-width: 36px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: transparent;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.file-action-button:hover:not(:disabled) {
  background: var(--color-surface-light);
  color: var(--color-text);
  transform: translateY(-1px);
}

.file-action-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.file-action-button.remove {
  color: #ffaaaa;
}

/* ── Mode PDF : hauteurs ── */

.image-workspace.pdf-active .image-upload-column {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.image-workspace.pdf-active .image-dropzone {
  min-height: 300px;
}

/* =========================
   Responsive — 900px
========================= */

@media (max-width: 900px) {
  .tools-grid {
    grid-template-columns: 1fr;
    max-width: 620px;
  }

  .home-tool-card {
    min-height: auto;
  }
}

/* =========================
   Responsive — 760px
========================= */

@media (max-width: 760px) {
  .site-header {
    height: auto;
    min-height: var(--header-height);
  }

  .header-container {
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .header-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .main-content  { padding-top: 72px; }
  .tool-page     { padding-top: 48px; }

  .tool-card     { min-height: auto; }

  .tool-illustration {
    width: 60px;
    height: 60px;
  }

  .coming-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pdf-upload-panel,
  .qr-panel,
  .images-panel {
    padding: 18px;
  }

  .pdf-dropzone {
    min-height: 210px;
    padding: 28px 18px;
  }

  .pdf-file-card,
  .image-file-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .pdf-file-card .ghost-button,
  .image-file-card .ghost-button {
    width: 100%;
  }

  .qr-actions {
    flex-direction: column;
  }

  .qr-actions .ghost-button {
    width: 100%;
  }

  .qr-history-header {
    align-items: flex-start;
  }

  .qr-history-header .ghost-button {
    width: auto;
    min-width: 96px;
  }

  .qr-history-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .qr-history-item .ghost-button {
    width: 100%;
  }

  .mode-selector {
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .mode-button { width: 100%; }

  .image-workspace,
  .image-workspace.pdf-active {
    max-width: 620px;
    grid-template-columns: 1fr;
  }

  .image-workspace.pdf-active .image-upload-column {
    min-height: auto;
    display: block;
  }

  .image-workspace.pdf-active .image-dropzone {
    min-height: 190px;
  }

  .image-dropzone {
    min-height: 190px;
    padding: 22px;
  }

  .image-supported-formats { margin-top: 12px; }

  .image-mode-note {
    margin-top: 12px;
    border-radius: 18px;
  }

  .format-selector    { grid-template-columns: 1fr; }
  .format-button      { width: 100%; }
  .compact-selector   { grid-template-columns: 1fr; }

  .image-file-item    { grid-template-columns: 1fr; }

  .image-file-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* =========================
   Responsive — 440px
========================= */

@media (max-width: 440px) {
  .main-content,
  .header-container,
  .site-footer {
    width: min(100% - 24px, var(--container-width));
  }

  .tool-card {
    flex-direction: column;
    padding: 24px;
  }

  .coming-grid {
    grid-template-columns: 1fr;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 0.86rem;
  }
}

/* =========================
   Toast
========================= */

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: 0 8px 30px rgba(3, 122, 104, 0.38);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 440px) {
  .toast {
    bottom: 20px;
    font-size: 0.88rem;
    padding: 11px 20px;
  }
}
