/* ============================================================
   conv2pdf — design system
   ============================================================ */

:root {
  --bg: #fafafa;
  --bg-subtle: #f5f5f5;
  --bg-card: #ffffff;
  --text: #171717;
  --text-strong: #0a0a0a;
  --text-mute: #525252;
  --text-soft: #737373;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --accent: #e53935;
  --accent-hover: #c62828;
  --accent-dark: #b71c1c;
  --accent-soft: #fef2f2;
  --accent-bg: #fff7f7;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-text: #14532d;
  --error: #dc2626;
  --error-bg: #fee2e2;
  --error-text: #7f1d1d;
  --warning-bg: #fef3c7;
  --warning-text: #78350f;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --gap: 1rem;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 4px 16px rgba(229, 57, 53, 0.12);
  --container: 1200px;
}

/* ============================================================
   Reset + base
   ============================================================ */

* { box-sizing: border-box; }
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--text-strong); }
h1 { font-weight: 800; letter-spacing: -0.02em; }
h2 { font-weight: 700; letter-spacing: -0.01em; }
h3 { font-weight: 700; }

/* SVG icon utility */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* ============================================================
   Header + logo
   ============================================================ */

.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-strong);
  font-family: inherit;
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: block;
}
.logo-wordmark {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-strong);
}
.logo-two {
  color: var(--accent);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.site-header nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-header nav a:hover { color: var(--accent); text-decoration: none; }
.logout-link {
  background: none;
  border: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  line-height: inherit;
}
.logout-link:hover { color: var(--accent); }

.lang-group {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  background: var(--bg);
}
.lang-group .lang-link {
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-mute);
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1;
}
.lang-group .lang-link.is-active {
  background: var(--accent);
  color: #fff;
}
.lang-group .lang-link:hover { text-decoration: none; }
.lang-group .lang-link:not(.is-active):hover { color: var(--text-strong); }

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0;
}

/* User chip (header dashboard) */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.625rem 0.25rem 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-mute);
  max-width: 220px;
}
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.user-email-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

/* ============================================================
   Layout / main
   ============================================================ */

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}
.auth-main { max-width: 480px; }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  padding: 3.5rem 0 3rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
  }
}
.hero-content { text-align: left; }
.hero h1 {
  font-size: 2.5rem;
  margin: 0 0 1rem;
}
@media (min-width: 700px) {
  .hero h1 { font-size: 3.25rem; }
}
.hero-sub {
  color: var(--text-mute);
  font-size: 1.125rem;
  margin: 0 0 1.75rem;
  max-width: 36ch;
}
@media (min-width: 700px) {
  .hero-sub { font-size: 1.25rem; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-strong);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.badge .icon { font-size: 1rem; }

.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Hero preview — formats → PDF flow (illustration, non interactive) */
.hero-preview {
  position: relative;
  background: linear-gradient(135deg, var(--accent-bg) 0%, #fff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.5rem 1.75rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.hero-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.hero-flow-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  max-width: 260px;
}
.hero-flow-file {
  padding: 0.4rem 0.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-mute);
  letter-spacing: 0.05em;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.hero-flow-file--more {
  color: var(--accent);
  border-color: rgba(229, 57, 53, 0.35);
  background: var(--accent-soft);
}
.hero-flow-arrow {
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin: 0.5rem 0 0.25rem;
  display: block;
}
.hero-flow-output {
  margin-top: 0.25rem;
}
.hero-flow-pdf {
  width: 72px;
  height: 90px;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(229, 57, 53, 0.18));
}
.hero-flow-caption {
  font-size: 0.85rem;
  color: var(--text-mute);
  margin: 1rem 0 0;
  text-align: center;
  line-height: 1.45;
}

/* ============================================================
   Tools grid
   ============================================================ */

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-strong);
  margin: 3rem 0 1.5rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
@media (min-width: 560px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 820px) {
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.tool-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 var(--accent);
  transition: box-shadow 0.15s;
}
.tool-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.tool-card:hover .tool-card-icon {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}
.tool-card:hover .tool-card-arrow {
  transform: translateX(4px);
  color: var(--accent);
}
.tool-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.tool-card-icon .icon { font-size: 1.375rem; }
.tool-card h2 {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--text-strong);
}
.tool-card p {
  margin: 0;
  color: var(--text-mute);
  font-size: 0.875rem;
  flex: 1;
}
.tool-card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mute);
  transition: color 0.15s, transform 0.15s;
  margin-top: 0.25rem;
}
.tool-card-arrow .icon { font-size: 1rem; }

/* ============================================================
   Cards (génériques)
   ============================================================ */

.card {
  background: var(--bg-card);
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card h2 { margin-top: 0; }
.card h2:first-child { margin-bottom: 0.75rem; }

.auth-card {
  background: var(--bg-card);
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-card h1 { margin-top: 0; }
.auth-switch {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--text-mute);
  font-size: 0.95rem;
}

/* ============================================================
   Trust grid
   ============================================================ */

.trust {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.trust h2 { margin: 0 0 1.5rem; }

.trust-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 600px) {
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .trust-grid { grid-template-columns: repeat(4, 1fr); }
}
.trust-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.trust-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}
.trust-icon .icon { font-size: 1.25rem; }
.trust-item h3 {
  font-size: 0.95rem;
  margin: 0;
  color: var(--text-strong);
}
.trust-item p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-mute);
  line-height: 1.5;
}

/* ============================================================
   Tool page (drop-zone, formulaires)
   ============================================================ */

.tool-page {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.tool-page h1 { margin-top: 0; }
.tool-page form > button[type=submit].btn-primary {
  display: flex;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
}
@media (min-width: 540px) {
  .tool-page form > button[type=submit].btn-primary {
    width: auto;
    min-width: 240px;
    margin-left: auto;
    margin-right: auto;
    padding: 0.875rem 2rem;
  }
}
.auth-card form > button[type=submit].btn-primary {
  display: flex;
  width: 100%;
  margin-top: 1rem;
}
.share-card form > button[type=submit].btn-primary {
  display: flex;
  width: 100%;
  margin-top: 0.5rem;
}
@media (min-width: 600px) {
  .share-card form > button[type=submit].btn-primary {
    width: auto;
    min-width: 200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0.875rem 2rem;
  }
}

.drop-zone {
  position: relative;
  display: block;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2.75rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s, padding 0.15s;
  margin-top: 1rem;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.drop-zone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.drop-zone-empty[hidden],
.drop-zone-filled[hidden] {
  display: none;
}
.drop-zone-icon {
  margin: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.25);
  transition: transform 0.15s;
}
.drop-zone:hover .drop-zone-icon,
.drop-zone.dragover .drop-zone-icon {
  transform: scale(1.05);
}
.drop-zone-icon svg { display: block; }
.drop-zone-text { color: var(--text); font-size: 1rem; font-weight: 500; }
.drop-zone-text small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-mute);
  font-weight: 400;
}

/* Filled state: file selected, info integrated inside the zone */
.drop-zone.is-filled {
  border-style: solid;
  border-color: var(--border-strong);
  background: #fff;
  cursor: default;
  padding: 1rem 1.125rem;
  text-align: left;
}
.drop-zone.is-filled:hover {
  border-color: var(--border-strong);
  background: #fff;
}
.drop-zone-filled {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}
.drop-zone-filled.is-multi {
  flex-direction: column;
  align-items: stretch;
  gap: 0.625rem;
}
.drop-zone-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}
.drop-zone-preview {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  overflow: hidden;
}
.drop-zone-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.drop-zone-preview-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  padding: 0.22rem 0.45rem;
  border-radius: 3px;
  background: var(--text-mute);
  line-height: 1;
}
.drop-zone-preview-badge.is-pdf { background: #e53935; }
.drop-zone-preview-badge.is-doc { background: #2b5db5; }
.drop-zone-preview-badge.is-xls { background: #1f7d3a; }
.drop-zone-preview-badge.is-ppt { background: #b7472a; }
.drop-zone-preview-badge.is-img { background: #6b4ea2; }
.drop-zone-info {
  flex: 1;
  min-width: 0;
}
.drop-zone-filename {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drop-zone-meta {
  font-size: 0.8rem;
  color: var(--text-mute);
  margin: 0.2rem 0 0;
}
.drop-zone-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-mute);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.drop-zone-remove:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.drop-zone-progress {
  margin-top: 0.625rem;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.drop-zone-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s;
}
.drop-zone-files-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
}
.drop-zone-file-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.85rem;
}
.drop-zone-file-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.drop-zone-file-size {
  color: var(--text-mute);
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Manageable list (merge-pdf): reorderable rows + per-row remove */
.drop-zone-files-list.is-manageable .drop-zone-file-row {
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  user-select: none;
}
.drop-zone-files-list.is-manageable .drop-zone-file-row:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}
.drop-zone-files-list.is-manageable .drop-zone-file-row.is-dragging {
  opacity: 0.4;
}
.drop-zone-files-list.is-manageable .drop-zone-file-row.is-drop-before {
  box-shadow: 0 -2px 0 0 var(--accent);
}
.drop-zone-files-list.is-manageable .drop-zone-file-row.is-drop-after {
  box-shadow: 0 2px 0 0 var(--accent);
}
.drop-zone-file-handle {
  color: var(--text-mute);
  font-size: 1rem;
  line-height: 1;
  cursor: grab;
  padding: 0 0.15rem;
  flex-shrink: 0;
}
.drop-zone-file-handle:active { cursor: grabbing; }
.drop-zone-file-remove {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-mute);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.drop-zone-file-remove:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.drop-zone-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.75rem 1rem;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.drop-zone-add:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.drop-zone-add-icon {
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
}

/* ============================================================
   Forms
   ============================================================ */

.field { margin-top: 1.25rem; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-strong);
}
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=number],
.field select,
.field textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
}
.field small {
  display: block;
  margin-top: 0.375rem;
  color: var(--text-mute);
  font-size: 0.85rem;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.375rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s, border-color 0.15s;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(229, 57, 53, 0.2);
  font-family: inherit;
  line-height: 1.2;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.28);
  color: #fff;
}
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled {
  background: #e5e5e5;
  border-color: #e5e5e5;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.375rem;
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.05s;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.2;
}
.btn-secondary:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.btn-secondary:active:not(:disabled) { transform: translateY(1px); }

.btn-small {
  padding: 0.45rem 0.875rem;
  font-size: 0.85rem;
}

.btn-link {
  display: inline-block;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  font-family: inherit;
  text-decoration: underline;
}
.btn-link:hover { color: var(--accent-hover); }
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  background: var(--error);
  color: #fff;
  border: 1px solid var(--error);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn-danger:hover:not(:disabled) {
  background: #7f1d1d;
  border-color: #7f1d1d;
  color: #fff;
  text-decoration: none;
}
.btn-danger:active:not(:disabled) { transform: translateY(1px); }
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-mute);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.btn-icon.is-danger:hover {
  border-color: var(--error);
  color: var(--error);
  background: var(--error-bg);
}

/* ============================================================
   Dashboard — plan / KPI / activity
   ============================================================ */

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.dashboard-header h1 { margin: 0 0 0.375rem; }
.dashboard-subtitle {
  color: var(--text-mute);
  margin: 0;
  font-size: 1rem;
}

.plan-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.plan-badge-free {
  background: var(--bg-subtle);
  color: var(--text-mute);
  border: 1px solid var(--border);
}
.plan-badge-pro {
  background: var(--accent);
  color: #fff;
}
.plan-meta {
  color: var(--text-mute);
  font-size: 0.9rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
@media (min-width: 560px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
}
.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.375rem;
}
.kpi-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-strong);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-mute);
  margin: 0.25rem 0 0;
}

.tool-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.625rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.825rem;
  color: var(--text);
}
.tool-pill .icon {
  font-size: 0.95rem;
  color: var(--accent);
}
.tool-pill strong { color: var(--text-strong); font-weight: 700; }
.tool-pill-count {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.125rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-badge-success {
  background: var(--success-bg);
  color: var(--success-text);
}
.status-badge-error {
  background: var(--error-bg);
  color: var(--error-text);
}
.status-badge-pending {
  background: var(--warning-bg);
  color: var(--warning-text);
}
.status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.source-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quota-bar {
  position: relative;
  width: 110px;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.25rem;
}
.quota-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: inherit;
  transition: width 0.3s ease;
}
.quota-bar-fill.is-warning {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}
.quota-bar-fill.is-full {
  background: linear-gradient(90deg, var(--error), #991b1b);
}
.quota-text {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
}
.quota-text small {
  color: var(--text-mute);
  font-size: 0.75rem;
}

/* New API key reveal */
.new-key-reveal {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  background: var(--success-bg);
  border: 1px solid #86efac;
  border-radius: var(--radius);
  color: var(--success-text);
}
.new-key-reveal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.new-key-reveal-title .icon { font-size: 1.125rem; }
.new-key-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.api-key {
  flex: 1 1 320px;
  display: block;
  padding: 0.625rem 0.875rem;
  background: #fff;
  border: 1px solid #86efac;
  border-radius: var(--radius-sm);
  word-break: break-all;
  font-family: ui-monospace, "SF Mono", Consolas, Menlo, monospace;
  font-size: 0.85rem;
  color: var(--text-strong);
  margin: 0;
}
.new-key-warning {
  display: block;
  margin-top: 0.625rem;
  font-size: 0.85rem;
  color: var(--success-text);
  opacity: 0.85;
}

/* ============================================================
   Tables — API keys, recent jobs, pricing
   ============================================================ */

.api-key-create {
  display: flex;
  gap: 0.625rem;
  margin: 1rem 0;
  align-items: stretch;
  flex-wrap: wrap;
}
.api-key-create select,
.api-key-create input[type="text"] {
  flex: 1 1 280px;
  min-width: 0;
  padding: 0.55rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
}
.api-key-create input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.api-key-create .btn-primary {
  padding: 0.55rem 1.125rem;
  flex: 0 0 auto;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.api-keys-table,
.recent-jobs,
.shares-table,
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.api-keys-table th, .recent-jobs th, .shares-table th, .pricing-table th,
.api-keys-table td, .recent-jobs td, .shares-table td, .pricing-table td {
  text-align: left;
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.api-keys-table tr:last-child td,
.recent-jobs tr:last-child td,
.shares-table tr:last-child td,
.pricing-table tr:last-child td { border-bottom: none; }
.api-keys-table th, .recent-jobs th, .shares-table th, .pricing-table th {
  font-weight: 700;
  color: var(--text-mute);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.api-keys-table tbody tr:hover,
.recent-jobs tbody tr:hover,
.shares-table tbody tr:hover {
  background: var(--accent-soft);
}
.shares-table td:last-child {
  white-space: nowrap;
  text-align: right;
}
.shares-table td:last-child .btn-icon + .btn-icon {
  margin-left: 0.25rem;
}

/* --- Account layout : sidebar + content --- */
.account-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 760px) {
  .account-layout {
    grid-template-columns: 220px 1fr;
    gap: 2rem;
  }
}

.account-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
@media (min-width: 760px) {
  .account-nav {
    flex-direction: column;
    border-bottom: none;
    padding-bottom: 0;
    position: sticky;
    top: 1rem;
  }
}
.account-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  color: var(--text-mute);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.account-tab:hover {
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}
.account-tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}
.account-tab .icon {
  width: 1.05em;
  height: 1.05em;
}

.account-content > .account-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.account-content > .account-panel[hidden] {
  display: none;
}
.recent-jobs td code {
  background: transparent;
  padding: 0;
}
.tool-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.tool-cell-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tool-cell-icon .icon { font-size: 0.875rem; }

/* ============================================================
   Pricing (Web + API)
   ============================================================ */

.pricing-intro {
  color: var(--text-mute);
  max-width: 60ch;
  margin: 0 0 2rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 1rem auto 0;
  max-width: 640px;
}
@media (min-width: 600px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
.pricing-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.pricing-card-highlight {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(229, 57, 53, 0.14);
}
.popular-pill {
  position: absolute;
  top: -12px;
  right: 1.25rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pricing-card h3 { margin: 0 0 0.25rem; font-size: 1.25rem; }
.pricing-card .price {
  font-size: 2.25rem;
  font-weight: 800;
  margin: 0.5rem 0 0;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}
.pricing-card .price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-mute);
}
.pricing-card .price-secondary {
  color: var(--text-mute);
  font-size: 0.875rem;
  margin: 0.25rem 0 1.25rem;
}
.pricing-card ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  flex: 1;
}
.pricing-card ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.95rem;
}
.pricing-card ul li:last-child { border-bottom: none; }
.pricing-card ul li::before {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 0.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

/* API pricing — cards grid (remplace le tableau) */
.api-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}
@media (min-width: 560px) {
  .api-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .api-grid { grid-template-columns: repeat(4, 1fr); }
}
.api-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.125rem 1.5rem;
  display: flex;
  flex-direction: column;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.api-card-highlight {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(229, 57, 53, 0.14);
}
.api-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-strong);
  margin: 0 0 0.375rem;
}
.api-card-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-strong);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.api-card-price span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-mute);
}
.api-card-quota {
  font-size: 0.875rem;
  color: var(--text);
  margin: 0.75rem 0 0.25rem;
  font-weight: 600;
}
.api-card-overage {
  font-size: 0.8rem;
  color: var(--text-mute);
  margin: 0;
  flex: 1;
}
.api-card .btn-secondary,
.api-card .btn-primary {
  margin-top: 1rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  width: 100%;
}
.api-enterprise {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
  color: var(--text);
}
.api-enterprise-name { font-weight: 600; color: var(--text-strong); }
.api-enterprise-cta {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.api-enterprise-cta:hover { text-decoration: none; opacity: 0.8; }
@media (max-width: 600px) {
  .api-enterprise { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

.pricing-dev-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3rem;
  padding: 1.5rem 1.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
}
.pricing-dev-cta-text h2 { margin: 0 0 0.25rem; font-size: 1.15rem; }
.pricing-dev-cta-text p { margin: 0; color: var(--text-mute); font-size: 0.95rem; }
.pricing-dev-cta .btn-primary { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 600px) {
  .pricing-dev-cta { flex-direction: column; align-items: flex-start; }
}

.api-pricing-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.25rem;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}
.api-pricing-teaser p { margin: 0; font-size: 0.95rem; color: var(--text); }
.api-pricing-teaser .btn-primary { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 600px) {
  .api-pricing-teaser { flex-direction: column; align-items: flex-start; }
}

.back-to-docs {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.95rem;
}
.back-to-docs a { color: var(--accent); font-weight: 600; }
.back-to-docs a:hover { text-decoration: none; opacity: 0.8; }

/* ============================================================
   Status messages (alerts)
   ============================================================ */

.status {
  margin: 1rem 0;
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.status.is-loading { background: var(--warning-bg); color: var(--warning-text); }
.status.is-success { background: var(--success-bg); color: var(--success-text); }
.status.is-error { background: var(--error-bg); color: var(--error-text); }

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  margin-top: 4rem;
  padding: 1.5rem 1.5rem 2rem;
  color: var(--text-mute);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.site-footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.site-footer-left { flex: 1 1 auto; min-width: 0; }
.site-footer-right { flex: 0 0 auto; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--text-mute); }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 600px) {
  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
  }
}

/* --- Profil : affichage email + form de changement --- */
.profile-email-row-display {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0;
}
.profile-email-current {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-strong);
  font-size: 0.95rem;
  line-height: 1.2;
  min-height: 2.5rem;
  flex: 0 1 auto;
  max-width: 100%;
  word-break: break-all;
}
.profile-email-icon {
  display: inline-flex;
  align-items: center;
  color: var(--text-mute);
  flex-shrink: 0;
}
.profile-email-icon .icon {
  width: 1.1em;
  height: 1.1em;
  vertical-align: 0;
}
.profile-email-edit-btn {
  flex-shrink: 0;
  padding: 0.375rem 0.5rem;
}

.profile-email-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}
.profile-email-form[hidden],
.profile-email-edit-btn[hidden] {
  display: none;
}
.profile-email-form label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-mute);
}
.profile-email-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.profile-email-row input[type="email"] {
  flex: 1 1 240px;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.profile-email-row input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
}
.profile-email-row .btn-secondary {
  flex-shrink: 0;
}
.profile-email-hint {
  margin: 0;
  font-size: 0.825rem;
  color: var(--text-mute);
}
.profile-email-status {
  margin: 0.5rem 0 0;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
}
.profile-email-status.is-success {
  background: var(--success-bg);
  color: var(--success-text);
}
.profile-email-status.is-error {
  background: var(--error-bg);
  color: var(--error-text);
}

/* --- Danger zone (suppression compte) --- */
.card-danger {
  border: 1px solid #fecaca;
  background: #fef2f2;
}
.card-danger h2 {
  color: var(--error-text);
}
.card-danger p {
  color: var(--text);
}

/* --- Modal (overlay + content) --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  animation: modal-fade-in 0.15s ease-out;
}
@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem 1.5rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content h3 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  color: var(--text-strong);
}
.modal-content p {
  margin: 0 0 0.75rem;
  color: var(--text);
}
.modal-content code {
  background: var(--bg);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.875rem;
  border: 1px solid var(--border);
}
.modal-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  color: var(--text);
  font-size: 0.92rem;
}
.modal-list li { margin-bottom: 0.25rem; }
.modal-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  margin: 0.5rem 0 1.25rem;
  letter-spacing: 0.05em;
}
.modal-input:focus {
  outline: none;
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.modal-actions {
  display: flex;
  gap: 0.625rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ============================================================
   Article (docs, legal)
   ============================================================ */

article {
  max-width: 960px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-sm);
}
article h1, article h2 { margin-top: 2rem; }
article h1:first-child { margin-top: 0; }
article h2 {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 1.375rem;
}
article h1 + h2, article > h2:first-of-type {
  border-top: none;
  padding-top: 0;
}
article h3 { margin-top: 1.5rem; font-size: 1.125rem; }
article h4 { margin-top: 1.25rem; font-size: 1rem; }
article p, article ul, article ol { margin: 1rem 0; }
article pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.65;
  border: 1px solid #334155;
}
article pre code {
  font-family: ui-monospace, "SF Mono", Consolas, Menlo, monospace;
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Syntax highlighting tokens (pré-annotés dans le HTML) */
.tok-kw   { color: #f472b6; }                            /* keyword: import, const, await, def, curl */
.tok-str  { color: #86efac; }                            /* string */
.tok-key  { color: #93c5fd; }                            /* JSON key */
.tok-bool { color: #fbbf24; }                            /* true/false */
.tok-num  { color: #fdba74; }                            /* number */
.tok-fn   { color: #c4b5fd; }                            /* function name */
.tok-com  { color: #94a3b8; font-style: italic; }        /* comment */
.tok-flag { color: #f0abfc; }                            /* CLI flag: -H, -F */
.tok-url  { color: #67e8f9; }                            /* URL */
article code {
  font-family: ui-monospace, "SF Mono", Consolas, Menlo, monospace;
  background: var(--bg-subtle);
  padding: 0.125rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-dark);
}

/* ============================================================
   Share flow — sharing form + generated link result
   ============================================================ */

.sharing-form .field { margin-top: 1rem; }
.sharing-form .field:first-child { margin-top: 1rem; }
.sharing-form > .btn-primary {
  display: block;
  margin: 1.25rem auto 0;
}

.share-result {
  padding: 1.125rem 1.25rem;
  background: var(--accent-soft);
  border: 1px solid #fde2e2;
  border-radius: var(--radius);
}
.share-result-title {
  font-weight: 600;
  margin: 0 0 0.625rem;
  color: var(--text-strong);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.share-result-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.share-result-row input[type=text] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, "SF Mono", Consolas, Menlo, monospace;
  font-size: 0.85rem;
  background: #fff;
  color: var(--text-strong);
}
.share-result-meta {
  margin: 0.625rem 0 0;
  font-size: 0.825rem;
  color: var(--text-mute);
}
.sharing-error {
  margin-top: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: var(--error-bg);
  border-radius: var(--radius-sm);
  color: var(--error-text);
  font-size: 0.875rem;
}

/* ============================================================
   Result page (/r/:jobId) — post-conversion download + share
   ============================================================ */

.result-page {
  max-width: 680px;
  margin: 2.5rem auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-intro {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}
.result-intro h1 {
  margin: 0 0 0.375rem;
  font-size: 1.75rem;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}
.result-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-mute);
}

/* --- Niveau 1 : bloc download mis en valeur --- */
.result-download {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2.5rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.result-download-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.result-download-icon svg {
  width: 38px;
  height: 38px;
}
.result-download-name {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Consolas, Menlo, monospace;
  font-size: 1rem;
  color: var(--text-strong);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-download-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-mute);
}
.result-download-cta {
  margin-top: 1rem;
  padding: 0.875rem 2rem;
  font-size: 1.05rem;
  min-width: 260px;
}
@media (max-width: 560px) {
  .result-download { padding: 2rem 1.25rem; }
  .result-download-cta { width: 100%; min-width: 0; justify-content: center; }
}

/* --- Niveau 2 : bloc partage --- */
.result-share {
  padding: 1.5rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.result-share-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}
.result-share-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.result-share-icon .icon { width: 20px; height: 20px; }
.result-share-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  color: var(--text-strong);
  font-weight: 600;
}
.result-share-intro {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-mute);
  line-height: 1.5;
}
.result-share-locked .btn-secondary {
  display: inline-block;
  margin-top: 0.25rem;
}
.result-share .sharing-form {
  padding: 0;
  border: 0;
  background: transparent;
}
.result-share .sharing-form .field:first-child { margin-top: 0; }

/* Toggle password optionnel (details/summary natif) */
.password-toggle {
  margin-top: 1rem;
}
.password-toggle > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-mute);
  font-weight: 500;
  padding: 0.375rem 0;
  user-select: none;
}
.password-toggle > summary::-webkit-details-marker { display: none; }
.password-toggle > summary:hover { color: var(--accent); }
.password-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-strong);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s, transform 0.15s;
}
.password-toggle[open] > summary { color: var(--text-strong); }
.password-toggle[open] .password-toggle-icon {
  background: var(--accent);
  color: #fff;
  transform: rotate(45deg);
}
.password-toggle > input[type=text] {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.password-toggle > input[type=text]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
}

/* --- Niveau 2 bis : bloc révocation (delete_token) --- */
.share-revoke {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}
.share-revoke > summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-mute);
  font-weight: 500;
  padding: 0.25rem 0;
  user-select: none;
}
.share-revoke > summary::-webkit-details-marker { display: none; }
.share-revoke > summary::before {
  content: "+ ";
  font-weight: 700;
  color: var(--text-strong);
}
.share-revoke[open] > summary::before { content: "− "; }
.share-revoke > summary:hover { color: var(--accent); }
.share-revoke-intro {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-mute);
}
.share-revoke .btn-secondary {
  margin-top: 0.75rem;
}

/* --- Niveau 3 : autres outils --- */
.result-more {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.result-more h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--text-strong);
  font-weight: 600;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}
.tool-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-strong);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.tool-card:hover {
  border-color: var(--accent);
  background: var(--bg-card);
  transform: translateY(-1px);
}
.tool-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tool-card-icon .icon { width: 18px; height: 18px; }

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.share-actions .share-result-title {
  margin: 0;
  font-size: 0.95rem;
}
.share-actions .share-result-meta {
  margin: 0;
}

.share-channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.625rem;
  margin-top: 0.5rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  filter: brightness(1.05);
}
.share-btn .icon { width: 18px; height: 18px; flex-shrink: 0; }
.share-btn-email     { background: var(--accent); border-color: var(--accent); }
.share-btn-whatsapp  { background: #25d366; border-color: #25d366; }
.share-btn-telegram  { background: #229ed9; border-color: #229ed9; }
.share-btn-native {
  grid-column: 1 / -1;
  background: var(--text-strong);
  border-color: var(--text-strong);
}

/* ============================================================
   Share page (/s/:id) — minimal layout served from Fastify
   ============================================================ */

.share-card {
  max-width: 540px;
  margin: 2rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow);
}
.share-card h1 { margin: 0 0 0.5rem; }
.share-card-file {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0.5rem 0 1rem;
  font-size: 0.95rem;
}
.share-card-file-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.share-card-meta {
  color: var(--text-mute);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}
.share-card form { margin-top: 1.5rem; }

/* ============================================================
   Legacy compat
   ============================================================ */

.user-email {
  margin-left: 1rem;
  color: var(--text-mute);
  font-size: 0.9rem;
}
.new-key-display { margin: 1rem 0; }

/* ============================================================
   Utilities — remplacent les style="" inline (CSP strict)
   ============================================================ */
.text-mute { color: var(--text-mute); }
.text-success { color: var(--success); }
.text-sm { font-size: 0.85rem; }
.mt-md { margin-top: 1rem; }
.trust.is-spaced { margin-top: 3rem; }
.kpi-value.is-text { font-size: 1.25rem; }

/* ============================================================
   Contact form
   ============================================================ */

.contact-main { max-width: 920px; }
.contact-card {
  background: var(--bg-card);
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.contact-card h1 { margin-top: 0; }
.contact-intro {
  color: var(--text-mute);
  margin: 0 0 1rem;
  line-height: 1.6;
}
.contact-card form > button[type=submit].btn-primary {
  display: flex;
  width: 100%;
  margin-top: 1.25rem;
}
@media (min-width: 600px) {
  .contact-card form > button[type=submit].btn-primary {
    width: auto;
    min-width: 220px;
    margin-left: auto;
    margin-right: 0;
  }
}
.contact-card .field label .req {
  color: var(--accent);
  margin-left: 0.15rem;
}
.contact-card .field-optional {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-mute);
  margin-left: 0.25rem;
}
.contact-card .field-hint {
  margin: 0.375rem 0 0;
  color: var(--text-mute);
  font-size: 0.85rem;
  line-height: 1.5;
}
.contact-card .field input[type=file] {
  width: 100%;
  padding: 0.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
}
.contact-card textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.5;
}
.contact-consent {
  margin: 1.5rem 0 0;
  padding: 0.75rem 1rem;
  background: var(--bg-soft, #fafafa);
  border-left: 3px solid var(--accent-soft);
  color: var(--text-mute);
  font-size: 0.85rem;
  line-height: 1.5;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.contact-hp {
  position: absolute;
  left: -10000px;
  top: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-success p { line-height: 1.6; }
.contact-success-cta { margin-top: 2rem; }
.contact-success-cta .btn-secondary {
  display: inline-flex;
}

/* ============================================================
   Developer panel — plan API, banners, plan picker, key drawer
   ============================================================ */

.plan-badge-dev {
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.plan-badge-starter {
  background: var(--accent-soft);
  color: var(--accent-strong, var(--accent));
}
.plan-badge-growth {
  background: var(--accent);
  color: #fff;
}
.plan-badge-business {
  background: #1f2937;
  color: #fff;
}

.api-banner {
  display: flex;
  gap: 0.875rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.api-banner[hidden] { display: none; }
.api-banner-warning {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #78350f;
}
.api-banner-orange {
  background: #ffedd5;
  border-color: #fb923c;
  color: #7c2d12;
}
.api-banner-soft {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text);
}
.api-banner .btn-link {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

.api-plan-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.api-plan-card-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
}
.api-plan-card-date {
  color: var(--text-mute);
  font-size: 0.9rem;
}
.api-plan-card-date strong {
  color: var(--text);
  font-weight: 600;
}
.api-plan-card-quota-label {
  font-size: 0.85rem;
  color: var(--text-mute);
  margin-bottom: 0.375rem;
}

.modal-plan-picker {
  max-width: 920px;
}
.plan-cycle-toggle {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.25rem;
  background: var(--bg);
  margin: 0 auto 1.25rem;
  align-self: center;
}
.modal-plan-picker {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.modal-plan-picker > .plan-cycle-toggle {
  margin-left: auto;
  margin-right: auto;
}
.plan-cycle-btn {
  border: none;
  background: transparent;
  padding: 0.5rem 1.125rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-mute);
  cursor: pointer;
  font-family: inherit;
}
.plan-cycle-btn.is-active {
  background: var(--accent);
  color: #fff;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1rem;
}
.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.125rem 1rem 1rem;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.plan-card.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.plan-card-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 0.02em;
}
.plan-card-price {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-strong);
}
.plan-card-price span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-mute);
}
.plan-card-quota {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-mute);
}
.plan-card-cta {
  margin-top: auto;
  padding-top: 0.5rem;
}
.plan-card-cta .btn-primary,
.plan-card-cta .btn-secondary,
.plan-card-cta .btn-link {
  width: 100%;
  justify-content: center;
}
.plan-current-pill {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong, var(--accent));
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-icon-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  margin-left: 0.375rem;
  border: none;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  border-radius: 4px;
  vertical-align: middle;
}
.btn-icon-mini:hover { background: var(--accent-soft); color: var(--accent); }
.btn-icon-mini .icon { width: 14px; height: 14px; }

.key-label {
  display: inline-block;
  vertical-align: middle;
  font-weight: 500;
}
.key-label-input {
  display: inline-block;
  width: 160px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg-card);
}
.key-label-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: none;
  background: transparent;
  padding: 0.5rem 0.75rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius);
}
.btn-link:hover { background: var(--accent-soft); }
.btn-link.is-danger {
  color: var(--error);
}
.btn-link.is-danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

.key-drawer-overlay {
  justify-content: flex-end;
  padding: 0;
}
.key-drawer {
  background: var(--bg-card);
  width: 100%;
  max-width: 480px;
  height: 100vh;
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: key-drawer-slide 0.2s ease-out;
}
@keyframes key-drawer-slide {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.key-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}
.key-drawer-head h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-strong);
}
.key-drawer-body h4 {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
}
.key-stats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.625rem;
  margin-top: 0.75rem;
}

.sparkline {
  display: block;
  width: 100%;
  height: 60px;
  color: var(--accent);
}
.sparkline-caption {
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .modal-plan-picker { max-width: 100%; }
  .plan-grid { grid-template-columns: 1fr; }
  .key-drawer { max-width: 100%; }
}
