/* ===== Shared design tokens ===== */
:root {
  --ink: #12213B;
  --green: #1E3D2F;
  --sand: #EDE7D9;
  --plate: #B8BCC2;
  --plate-dark: #8b8f96;
  --stamp: #C2410C;
  --charcoal: #2A2A28;
  --paper-line: rgba(18,33,59,0.12);
  --text-primary: var(--ink);
  --on-dark: #EDE7D9;
  --card-bg: #fff;
  --card-border: rgba(18,33,59,0.12);
  --box-border: rgba(18,33,59,0.25);
}

[data-theme="dark"] {
  --sand: #12161c;
  --charcoal: #C9C7BE;
  --green: #4C8567;
  --paper-line: rgba(237,231,217,0.14);
  --text-primary: #EDE7D9;
  --card-bg: #1A1F26;
  --card-border: rgba(237,231,217,0.14);
  --box-border: rgba(237,231,217,0.25);
}

[data-theme="dark"] .section-alt { background: #1A1F26; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html[dir="rtl"] body { font-family: 'IBM Plex Sans Arabic', sans-serif; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] .display {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  text-transform: none;
  letter-spacing: 0;
}
html[dir="rtl"] .mono { font-family: 'IBM Plex Sans Arabic', monospace; }
html[dir="rtl"] .order-form { text-align: right; }
html[dir="rtl"] .eyebrow, html[dir="rtl"] .tag { letter-spacing: 0; }

body, .btn, .card-btn, input, select {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--charcoal);
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.5;
}

h1, h2, h3, .display {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin: 0;
}

.mono { font-family: 'IBM Plex Mono', monospace; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ===== Nav ===== */
nav.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; max-width: 1120px; margin: 0 auto; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 4px; background: var(--green);
  display: flex; align-items: center; justify-content: center; color: var(--on-dark);
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 15px;
}
.brand-name {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 20px;
  letter-spacing: 0.03em; color: var(--text-primary);
}
html[dir="rtl"] .brand-name { font-family: 'IBM Plex Sans Arabic', sans-serif; letter-spacing: 0; }

.nav-links { display: flex; gap: 28px; font-size: 14px; font-weight: 500; }
.nav-links a { text-decoration: none; color: var(--charcoal); }
.nav-links a:hover { color: var(--stamp); }
@media (max-width: 900px) { .nav-links { display: none; } }

.nav-hamburger {
  display: none; background: transparent; border: 1.5px solid var(--text-primary); color: var(--text-primary);
  width: 38px; height: 38px; border-radius: 4px; cursor: pointer; align-items: center; justify-content: center; font-size: 18px;
}
@media (max-width: 900px) { .nav-hamburger { display: flex; } }

.nav-mobile-panel {
  display: none; flex-direction: column; gap: 4px; padding: 12px 24px 20px;
  background: var(--sand); border-bottom: 1px solid var(--paper-line);
}
.nav-mobile-panel.show { display: flex; }
.nav-mobile-panel a {
  text-decoration: none; color: var(--charcoal); font-size: 15px; padding: 10px 0;
  border-bottom: 1px solid var(--paper-line);
}
.nav-mobile-panel a:last-child { border-bottom: none; }

.lang-switch { display: flex; gap: 4px; border: 1.5px solid var(--text-primary); border-radius: 4px; padding: 2px; }
.lang-switch button {
  background: transparent; border: none; color: var(--text-primary); font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; font-weight: 600; padding: 6px 8px; border-radius: 3px; cursor: pointer; letter-spacing: 0.05em;
}
.lang-switch button.active { background: var(--text-primary); color: var(--sand); }

.nav-controls { display: flex; align-items: center; gap: 10px; }

/* ===== Hero ===== */
.hero { padding: 56px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green);
  border: 1px solid var(--green); padding: 5px 10px; border-radius: 3px; margin-bottom: 20px;
}

.hero h1 { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.15; margin-bottom: 20px; }
.hero h1 .accent { color: var(--stamp); }
.hero p.lead { font-size: 17px; max-width: 46ch; color: var(--charcoal); margin-bottom: 30px; }

.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===== Buttons (main site) ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 4px;
  font-weight: 600; font-size: 15px; text-decoration: none; border: 2px solid transparent;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary { background: var(--stamp); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(194,65,12,0.35); }
.btn-ghost { background: transparent; border-color: var(--text-primary); color: var(--text-primary); }
.btn-ghost:hover { background: var(--ink); color: var(--on-dark); }

/* ===== VIN plate widget ===== */
.plate-stage { display: flex; justify-content: center; position: relative; }
.plate {
  width: 100%; max-width: 380px; background: linear-gradient(180deg, #c7cbd1 0%, var(--plate) 55%, var(--plate-dark) 100%);
  border-radius: 10px; padding: 26px 24px 30px; position: relative;
  box-shadow: 0 18px 40px rgba(18,33,59,0.28), inset 0 1px 0 rgba(255,255,255,0.4); border: 1px solid rgba(0,0,0,0.15);
}
.plate::before {
  content: ""; position: absolute; top: 10px; left: 10px; right: 10px; bottom: 10px;
  border: 1.5px dashed rgba(18,33,59,0.35); border-radius: 6px; pointer-events: none;
}
.plate-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--ink); opacity: 0.7; margin-bottom: 10px; text-align: center;
}
.plate-vin {
  font-family: 'IBM Plex Mono', monospace; font-size: clamp(18px, 4vw, 24px); font-weight: 600; letter-spacing: 0.14em;
  color: var(--ink); text-align: center; padding: 14px 8px; border-top: 2px solid rgba(18,33,59,0.25);
  border-bottom: 2px solid rgba(18,33,59,0.25); background: rgba(255,255,255,0.25); border-radius: 4px;
  margin-bottom: 18px; word-break: break-all; direction: ltr;
}
.plate-meta {
  display: flex; justify-content: space-between; font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  color: var(--ink); opacity: 0.75; margin-bottom: 20px;
}
select.origin-select {
  width: 100%; font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; padding: 10px 12px;
  border-radius: 4px; border: 1.5px solid rgba(18,33,59,0.35); background: #f4f2ec; color: var(--ink); margin-bottom: 16px;
}
.verify-btn {
  width: 100%; background: var(--ink); color: var(--on-dark); font-family: 'IBM Plex Mono', monospace; font-weight: 600;
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; padding: 13px; border: none; border-radius: 4px; cursor: pointer;
}
.verify-btn:hover { background: var(--stamp); }
.stamp {
  position: absolute; top: 38%; left: 50%; width: 130px; height: 130px; margin-left: -65px; margin-top: -65px;
  border: 4px solid var(--stamp); border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--stamp); font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: 0.05em;
  text-align: center; text-transform: uppercase; transform: rotate(-16deg) scale(1.6); opacity: 0; pointer-events: none;
  transition: transform 0.35s cubic-bezier(.2,1.6,.4,1), opacity 0.35s ease;
}
.stamp.show { opacity: 0.92; transform: rotate(-16deg) scale(1); }

/* ===== Sections ===== */
section { padding: 64px 0; }
.section-alt { background: #E4DDCB; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head .tag {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--stamp); display: block; margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 10px; }
.section-head p { color: var(--charcoal); font-size: 15.5px; max-width: 54ch; }

.problem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 780px) { .problem-grid { grid-template-columns: 1fr; } }
.problem-card { background: var(--sand); border: 1px solid var(--paper-line); border-radius: 6px; padding: 24px; }
.problem-card .num { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; color: var(--green); margin-bottom: 12px; }
.problem-card h3 { font-size: 17px; margin-bottom: 8px; }
.problem-card p { font-size: 14px; color: var(--charcoal); margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 0 28px 0 0; border-right: 1px dashed var(--paper-line); }
.step:last-child { border-right: none; padding-right: 0; }
html[dir="rtl"] .step { padding: 0 0 0 28px; border-right: none; border-left: 1px dashed var(--paper-line); }
html[dir="rtl"] .step:last-child { border-left: none; padding-left: 0; }
@media (max-width: 780px) {
  .step { border-right: none; border-bottom: 1px dashed var(--paper-line); padding: 0 0 28px 0; margin-bottom: 28px; }
  .step:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
  html[dir="rtl"] .step { border-left: none; border-bottom: 1px dashed var(--paper-line); }
}
.step .step-num { font-family: 'Oswald', sans-serif; font-size: 38px; font-weight: 700; color: var(--green); opacity: 0.9; margin-bottom: 14px; }
.step h3 { font-size: 16.5px; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--charcoal); margin: 0; }

.coverage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 780px) { .coverage-grid { grid-template-columns: repeat(2, 1fr); } }
.coverage-card { background: var(--ink); color: var(--on-dark); border-radius: 6px; padding: 20px 18px; }
.coverage-card .flag { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #cfd6e6; margin-bottom: 8px; display: block; }
.coverage-card h3 { color: var(--on-dark); font-size: 16px; margin-bottom: 6px; }
.coverage-card p { font-size: 13px; color: #b9c0d1; margin: 0; }

.price-card {
  background: var(--sand); border: 2px solid var(--ink); border-radius: 8px; padding: 32px; max-width: 480px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.price-amount { font-family: 'Oswald', sans-serif; font-size: 40px; font-weight: 700; color: var(--text-primary); }
.price-amount span { font-family: 'IBM Plex Mono', monospace; font-size: 14px; font-weight: 500; color: var(--charcoal); display: block; margin-top: 4px; text-transform: none; letter-spacing: 0; }
.price-note { font-size: 13px; color: var(--charcoal); max-width: 22ch; }

.final-cta { background: var(--green); color: var(--on-dark); border-radius: 10px; padding: 48px 40px; text-align: center; }
.final-cta h2 { color: var(--on-dark); font-size: clamp(24px, 3.4vw, 34px); margin-bottom: 14px; }
.final-cta p { color: #cfe0d4; max-width: 50ch; margin: 0 auto 26px; font-size: 15.5px; }

/* ===== Order form ===== */
.order-form { max-width: 520px; margin: 0 auto; text-align: left; display: grid; gap: 14px; }
.order-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .order-form .field-row { grid-template-columns: 1fr; } }
.order-form label { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #cfe0d4; margin-bottom: 6px; display: block; }
html[dir="rtl"] .order-form label { font-family: 'IBM Plex Sans Arabic', sans-serif; letter-spacing: 0; text-transform: none; }
.order-form input, .order-form select { width: 100%; font-family: 'IBM Plex Sans', sans-serif; font-size: 14.5px; padding: 11px 12px; border-radius: 4px; border: 1.5px solid rgba(237,231,217,0.35); background: rgba(237,231,217,0.95); color: var(--ink); }
html[dir="rtl"] .order-form input, html[dir="rtl"] .order-form select { font-family: 'IBM Plex Sans Arabic', sans-serif; }
.order-form input:focus, .order-form select:focus { outline: 2px solid var(--stamp); outline-offset: 1px; }
.order-form .submit-btn { width: 100%; background: var(--stamp); color: #fff; font-weight: 600; font-size: 15px; padding: 14px; border: none; border-radius: 4px; cursor: pointer; margin-top: 4px; }
.order-form .submit-btn:hover { filter: brightness(1.08); }
.form-note { font-size: 12.5px; color: #a9c2b1; text-align: center; margin-top: 2px; }
.confirm-msg { display: none; background: rgba(237,231,217,0.12); border: 1px solid rgba(237,231,217,0.3); border-radius: 6px; padding: 16px; text-align: center; font-size: 14px; color: var(--on-dark); }
.confirm-msg.show { display: block; }
#errorMsg { background: rgba(194,65,12,0.15); border-color: rgba(194,65,12,0.4); }

footer { padding: 32px 0 48px; font-size: 13px; color: var(--charcoal); text-align: center; }
footer a { color: var(--text-primary); font-weight: 600; text-decoration: none; }

/* ===== Confirmation pages (merci.html / paiement-echoue.html) =====
   Scoped under .result-card so these never collide with the main
   site's h1/.btn rules above. */
.result-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.result-card {
  max-width: 460px; width: 100%; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 36px 32px; text-align: center; box-shadow: 0 10px 30px rgba(18,33,59,0.08);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
html[dir="rtl"] .result-card { font-family: 'IBM Plex Sans Arabic', sans-serif; }
.result-card h1 { font-size: 24px; margin: 0 0 10px; }
.result-card p.sub { color: var(--charcoal); font-size: 14.5px; margin: 0 0 24px; }
.result-icon-ok { width: 56px; height: 56px; border-radius: 50%; background: var(--green); color: #EDE7D9;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; font-size: 28px; }
.result-icon-fail { width: 56px; height: 56px; border-radius: 50%; background: var(--stamp); color: #fff;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; font-size: 28px; }
.order-box { background: var(--sand); border: 1px dashed var(--box-border); border-radius: 6px;
  padding: 16px 18px; text-align: left; font-family: 'IBM Plex Mono', monospace; font-size: 13px;
  color: var(--text-primary); margin-bottom: 26px; display: none; }
html[dir="rtl"] .order-box { text-align: right; font-family: 'IBM Plex Sans Arabic', sans-serif; }
.order-box.show { display: block; }
.order-box .row { display: flex; justify-content: space-between; padding: 4px 0; }
.order-box .row span:first-child { opacity: 0.65; }
.card-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: 4px;
  font-weight: 600; font-size: 14.5px; text-decoration: none; margin: 4px; cursor: pointer; border: none;
}
.card-btn-solid { background: var(--stamp); color: #fff; }
.card-btn-solid:hover { filter: brightness(1.08); }
.card-btn-primary { background: var(--text-primary); color: var(--sand); }
.card-btn-primary:hover { filter: brightness(1.15); }
.card-btn-outline { background: transparent; border: 1.5px solid var(--text-primary); color: var(--text-primary); }
.card-btn-outline:hover { filter: brightness(1.15); }
