/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #263347;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 0 0 60px;
}

a { color: inherit; }

/* ===== Header ===== */
header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

header h1 {
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 0.85rem;
}

.header-branding {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
}
.header-branding a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.header-branding a:hover {
  text-decoration: underline;
  opacity: 1;
}

/* ===== Sélecteur de langue (dropdown) ===== */
.lang-selector {
  position: relative;
  flex-shrink: 0;
}

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s;
  letter-spacing: 0.3px;
}

.lang-trigger:hover { border-color: var(--accent); }

.lang-trigger .chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.lang-selector.open .lang-trigger { border-color: var(--accent); }
.lang-selector.open .chevron { transform: rotate(180deg); }

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-width: 120px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
}

.lang-selector.open .lang-dropdown { display: block; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.lang-option:hover { background: var(--bg-card-hover); color: var(--text); }

.lang-option.active {
  color: var(--accent);
  background: rgba(245, 158, 11, 0.08);
}

.lang-option .lang-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.lang-option.active .lang-label { color: var(--accent); opacity: 0.7; }

@media (max-width: 480px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
}

.voltage-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.voltage-toggle button {
  padding: 6px 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.voltage-toggle button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f172a;
}

/* ===== Main layout ===== */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== Card ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
}

/* ===== Form header ===== */
.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.form-header h2 {
  margin-bottom: 0;
}

.btn-presets {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-presets:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Presets panel ===== */
.presets-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.preset-category-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.preset-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
}

.preset-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.preset-card.selected {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
}

.preset-card.selected .preset-name {
  color: var(--accent);
}

.preset-name {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
}

.preset-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Preset add bar ===== */
.presets-add-bar {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.btn-add-presets {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #0f172a;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add-presets:hover { background: var(--accent-dark); }

/* Dot affiliation sur les cartes */
.preset-affiliate-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ===== Badge affiliation ===== */
.affiliate-badge {
  margin-bottom: 14px;
}

.affiliate-badge a {
  display: inline-block;
  padding: 5px 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.affiliate-badge a:hover {
  background: rgba(245, 158, 11, 0.22);
}

/* ===== Form ===== */
.form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  align-items: end;
}

@media (max-width: 580px) {
  .form-grid { grid-template-columns: 1fr; }
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.input-mode-toggle {
  display: flex;
  gap: 4px;
}

.input-mode-toggle button {
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.15s;
}

.input-mode-toggle button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f172a;
}

.field-voltage-top {
  margin-bottom: 16px;
}

.voltage-form-toggle {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.voltage-form-toggle button {
  flex: 1;
  padding: 9px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.2s;
}

.voltage-form-toggle button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f172a;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-add {
  padding: 10px 24px;
  background: var(--accent);
  color: #0f172a;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add:hover { background: var(--accent-dark); }

.error-msg {
  margin-top: 10px;
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 1.2em;
}

/* ===== Table ===== */
.table-wrapper {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.table-wrapper::-webkit-scrollbar {
  height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }

tbody td {
  padding: 12px 12px;
  vertical-align: middle;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
}

.tag-cable {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
}
.tag-cable-warn {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}
.warn-max-length {
  display: block;
  font-size: 0.72rem;
  color: var(--danger);
  margin-top: 4px;
  white-space: nowrap;
}

.tag-fuse {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.tag-voltage {
  background: rgba(99, 179, 237, 0.12);
  color: #63b3ed;
}

.tag-maxcurrent {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}

.tag-overload {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* ===== Colonnes fixes dans le tableau ===== */
#equipment-table th:first-child,
#equipment-table td.td-sticky-left {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-card);
  min-width: 130px;
}

#equipment-table tbody tr:hover td.td-sticky-left {
  background: var(--bg-card-hover);
}

#equipment-table th:last-child,
#equipment-table td.td-sticky-right {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--bg-card);
}

#equipment-table tbody tr:hover td.td-sticky-right {
  background: var(--bg-card-hover);
}

#equipment-table td.td-sticky-left,
#equipment-table th:first-child {
  border-right: 1px solid var(--border);
}

#equipment-table td.td-sticky-right,
#equipment-table th:last-child {
  border-left: 1px solid var(--border);
}

#equipment-table td.td-sticky-left .btn-buy {
  display: block;
  margin-top: 4px;
}

/* ===== Inline edit (longueur câble) ===== */
.length-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.length-cell .unit {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.inline-edit {
  width: 3.8em;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--text-muted);
  color: var(--text);
  font-size: 0.9rem;
  text-align: right;
  padding: 1px 2px;
  cursor: pointer;
}

.inline-edit:focus {
  outline: none;
  border-bottom: 2px solid var(--accent);
  background: rgba(245, 158, 11, 0.06);
  border-radius: 3px 3px 0 0;
  cursor: text;
}

/* ===== Bouton achat affilié ===== */
.btn-buy {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}

.btn-buy:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: var(--accent);
}

.btn-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.btn-delete:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* ===== Summary ===== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.summary-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.summary-item .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.summary-item .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

.summary-item .unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 3px;
}

#summary-combo {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.summary-combo-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
}

.summary-combo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 380px) {
  .summary-combo-grid { grid-template-columns: 1fr; }
}

.summary-combo-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-combo-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.summary-combo-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.summary-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0.55;
}
.summary-product-row:last-child { border-bottom: none; }
.summary-product-row.summary-product-match {
  opacity: 1;
}
.summary-product-label {
  font-size: 0.88rem;
  color: var(--text);
  flex: 1;
}
.summary-product-match .summary-product-label {
  font-weight: 700;
  color: var(--accent);
}
.summary-match-badge {
  display: inline-block;
  background: var(--accent);
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 24px 16px 0;
}
.footer-legal {
  margin-top: 6px;
}
.footer-legal a {
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.7;
}
.footer-legal a:hover {
  opacity: 1;
  color: var(--accent);
}
.footer-contact {
  margin-top: 4px;
}
.footer-contact a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  opacity: 0.5;
}
.footer-contact a:hover {
  opacity: 1;
  color: var(--accent);
}

/* ===== Disclaimer ===== */
.disclaimer {
  max-width: 860px;
  margin: 0 auto 2rem;
  padding: 14px 20px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.6;
  text-align: center;
}
.disclaimer strong {
  color: #f59e0b;
}

/* ===== Encarts formation ===== */
.promo-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0f172a;
  background: var(--accent);
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* --- Barre haute --- */
.promo-top {
  background: linear-gradient(135deg, rgba(245,158,11,0.12) 0%, rgba(245,158,11,0.04) 100%);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius);
  padding: 14px 20px;
}

.promo-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.promo-top-text {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.promo-top-headline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.promo-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* --- Carte basse --- */
.promo-bottom {
  border-color: rgba(245,158,11,0.35) !important;
  background: linear-gradient(135deg, rgba(245,158,11,0.08) 0%, var(--bg-card) 60%) !important;
  width: 100%;
  overflow: hidden;
}

.promo-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.promo-bottom-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.promo-bottom-headline {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.promo-bottom-subline {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.promo-bottom-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* --- Prix --- */
.promo-prices {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.promo-price-old {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 500;
}

.promo-price-new {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

/* Dans la barre haute les prix sont plus petits */
.promo-top-right .promo-price-new { font-size: 1.05rem; }

/* --- Boutons promo --- */
.btn-promo {
  display: inline-block;
  padding: 9px 20px;
  background: var(--accent);
  color: #0f172a;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
}

.btn-promo:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-promo-lg {
  padding: 13px 28px;
  font-size: 0.95rem;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(245,158,11,0.3);
}

.btn-promo-lg:hover {
  box-shadow: 0 6px 24px rgba(245,158,11,0.45);
}

@media (max-width: 580px) {
  .promo-top-inner { flex-direction: column; align-items: flex-start; }
  .promo-bottom-inner { flex-direction: column; }
  .promo-bottom-cta { width: 100%; }
  .btn-promo-lg { width: 100%; text-align: center; }
}

/* ===== Bouton achat câble (tableau) ===== */
.btn-cable-buy {
  display: block;
  margin-top: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.btn-cable-buy:hover { opacity: 1; }

/* ===== Bouton PDF ===== */
#pdf-btn-wrapper {
  margin-top: 20px;
  text-align: center;
}

.btn-pdf {
  padding: 11px 28px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-pdf:hover {
  background: var(--accent);
  color: #0f172a;
}

/* ===== Modal PDF ===== */
.pdf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s;
}

.pdf-modal-overlay.open { opacity: 1; }

.pdf-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 520px;
  transform: translateY(12px);
  transition: transform 0.2s;
}

.pdf-modal-overlay.open .pdf-modal { transform: translateY(0); }

.pdf-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

.pdf-modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.pdf-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .pdf-field-row { grid-template-columns: 1fr; }
}

.pdf-modal .field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}

.pdf-modal .field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.pdf-modal .field input:focus {
  outline: none;
  border-color: var(--accent);
}

.pdf-consent-field {
  margin-top: 8px;
}

.pdf-consent-label {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.4;
}

.pdf-consent-label input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent);
  min-width: 18px;
  min-height: 18px;
  cursor: pointer;
}

.pdf-error {
  color: #ef4444;
  font-size: 0.82rem;
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
  border-left: 3px solid #ef4444;
}

.pdf-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-pdf-cancel {
  padding: 10px 20px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-pdf-cancel:hover { border-color: var(--text-muted); color: var(--text); }

.btn-pdf-generate {
  padding: 10px 22px;
  background: var(--accent);
  color: #0f172a;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-pdf-generate:hover { background: var(--accent-dark); }

/* ===== Loading PDF ===== */
.pdf-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s;
}

.pdf-loading-overlay.open { opacity: 1; }

.pdf-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 420px;
  text-align: center;
}

/* Cercle de progression */
.pdf-ring-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
}

.pdf-ring-svg {
  width: 110px;
  height: 110px;
  transform: rotate(-90deg);
}

.pdf-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.pdf-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 276;
  stroke-dashoffset: 276;
  animation: pdf-ring-progress 12s linear forwards;
}

@keyframes pdf-ring-progress {
  from { stroke-dashoffset: 276; }
  to   { stroke-dashoffset: 0; }
}

.pdf-ring-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.pdf-loading-msg {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Encart promo dans le loading */
.pdf-loading-promo {
  background: var(--bg-card);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.pdf-loading-promo-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
  margin: 0;
}

/* ===== Video Section ===== */
.video-section {
  background: var(--bg);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 48px 16px;
}

.video-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  align-items: center;
}

.video-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0f172a;
  background: #ef4444;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.video-text h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 12px;
}

.video-text p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.video-checklist {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-checklist li {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-left: 24px;
  position: relative;
}

.video-checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

/* Video embed / placeholder */
.video-embed {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.video-placeholder {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  cursor: pointer;
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
  z-index: 2;
}

.video-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.12);
  filter: brightness(1.2);
}

.video-placeholder-text {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  z-index: 2;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 700px) {
  .video-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .video-text { order: 2; }
  .video-embed { order: 1; }
}

/* ===== SEO Content Section ===== */
.seo-content {
  background: var(--bg);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 48px 16px 60px;
}

.seo-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.seo-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.35;
}

.seo-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
  line-height: 1.35;
}

.seo-content p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.seo-content strong {
  color: var(--text);
  font-weight: 600;
}

/* Intro */
.seo-intro {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

/* Steps guide */
.seo-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.seo-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.seo-step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #0f172a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  margin-top: 2px;
}

.seo-step h3 {
  margin-bottom: 6px;
}

/* SEO Table */
.seo-table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.seo-table thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-card);
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.seo-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.seo-table tbody tr:hover {
  background: var(--bg-card);
}

.seo-table-note {
  font-size: 0.82rem !important;
  font-style: italic;
  margin-top: 8px;
}

/* Vehicle cards */
.seo-vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.seo-vehicle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  transition: border-color 0.2s;
}

.seo-vehicle-card:hover {
  border-color: var(--accent);
}

/* FAQ */
.seo-faq {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.seo-faq h2 {
  margin-bottom: 20px;
}

.seo-faq-item {
  border-bottom: 1px solid var(--border);
}

.seo-faq-item:first-of-type {
  border-top: 1px solid var(--border);
}

.seo-faq-item summary {
  padding: 16px 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: color 0.2s;
}

.seo-faq-item summary:hover {
  color: var(--accent);
}

.seo-faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: all 0.2s;
}

.seo-faq-item[open] summary::after {
  content: '−';
  background: var(--accent);
  border-color: var(--accent);
  color: #0f172a;
}

.seo-faq-item summary::-webkit-details-marker {
  display: none;
}

.seo-faq-item p {
  padding: 0 4px 18px;
}

/* Related keywords cards */
.seo-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.seo-related-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
}

.seo-related-item h3 {
  font-size: 0.92rem;
}

.seo-related-item p {
  font-size: 0.84rem;
}

@media (max-width: 580px) {
  .seo-content { padding: 32px 12px 40px; }
  .seo-inner { gap: 36px; }
  .seo-vehicle-grid { grid-template-columns: 1fr; }
  .seo-related-grid { grid-template-columns: 1fr; }
  .seo-step { flex-direction: column; gap: 10px; }
}

/* ===== Print styles ===== */
#print-content { display: none; }

@media print {
  /* Masquer toute l'interface */
  body > *:not(#print-content) { display: none !important; }
  #print-content { display: block !important; }

  /* Reset print */
  body {
    background: #fff !important;
    color: #111 !important;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 11pt;
    padding: 0;
    margin: 0;
  }

  .print-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 2px solid #f59e0b;
    padding-bottom: 10px;
    margin-bottom: 16px;
  }

  .print-header h1 {
    font-size: 14pt;
    color: #111;
    margin: 0;
    white-space: nowrap;
  }

  .print-header-meta {
    font-size: 8.5pt;
    color: #64748b;
    white-space: nowrap;
  }

  .print-branding {
    font-size: 10pt;
    color: #64748b;
    margin: -10px 0 16px;
  }
  .print-branding a {
    color: #f59e0b;
    text-decoration: none;
    font-weight: 700;
  }

  .print-section-title {
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #f59e0b;
    margin: 20px 0 10px;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9.5pt;
  }

  .print-table th {
    text-align: left;
    padding: 6px 8px;
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
    font-size: 8pt;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.3px;
  }

  .print-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
  }

  .print-table tr:last-child td { border-bottom: none; }

  .print-reco-grid {
    display: flex;
    gap: 20px;
    margin-top: 4px;
  }

  .print-reco-item {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    background: #f8fafc;
  }

  .print-reco-label {
    font-size: 8pt;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
  }

  .print-reco-value {
    font-size: 18pt;
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 6px;
  }

  .print-link {
    display: inline-block;
    font-size: 9pt;
    color: #2563eb;
    text-decoration: underline;
  }

  .print-equip-name {
    display: inline;
    font-weight: 600;
  }

  .print-buy-inline {
    display: inline-block;
    margin-top: 0;
    margin-left: 8px;
    vertical-align: middle;
    font-size: 7.5pt;
    padding: 2px 7px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 4px;
    color: #92400e !important;
    text-decoration: none !important;
  }

  .print-product-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .print-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 8.5pt;
    color: #475569;
  }

  .print-product-row:last-child { border-bottom: none; }

  .print-product-match {
    color: #1e293b;
    font-weight: 600;
  }

  .print-match-badge {
    display: inline-block;
    background: #f59e0b;
    color: #0f172a;
    font-size: 7pt;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 4px;
  }

  .print-product-label { flex: 1; }

  .print-calc-note {
    margin-top: 14px;
    font-size: 8pt;
    color: #94a3b8;
    font-style: italic;
  }

  /* Bandeau fin en haut du PDF */
  .print-promo-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 7px 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
  }

  .print-promo-banner-text {
    flex: 1;
    font-size: 8.5pt;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
  }

  .print-promo-banner-prices {
    display: flex;
    align-items: baseline;
    gap: 6px;
  }

  /* Encarts formation dans le PDF */
  .print-promo-row {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    page-break-inside: avoid;
  }

  .print-promo-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fffbeb;
    border: 1.5px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 14px;
  }

  .print-promo-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
  }

  .print-promo-badge {
    font-size: 7.5pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #92400e;
    background: #fde68a;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
    margin-bottom: 4px;
  }

  .print-promo-headline {
    font-size: 10pt;
    font-weight: 700;
    color: #1e293b;
    display: block;
  }

  .print-promo-subline {
    font-size: 8pt;
    color: #64748b;
    line-height: 1.4;
    display: block;
  }

  .print-promo-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    text-align: center;
  }

  .print-promo-price-old {
    font-size: 9pt;
    color: #94a3b8;
    text-decoration: line-through;
  }

  .print-promo-price-new {
    font-size: 16pt;
    font-weight: 800;
    color: #f59e0b;
    line-height: 1;
  }

  .print-promo-link {
    display: inline-block;
    padding: 7px 16px;
    background: #f59e0b !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color: #0f172a !important;
    font-size: 9pt;
    font-weight: 700;
    text-decoration: none !important;
    border-radius: 6px;
    border: 2px solid #d97706;
    white-space: nowrap;
  }
}
