:root {
  --teal: #0ea5a4;
  --teal-dark: #0f766e;
  --blue: #0284c7;
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #94a3b8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --error: #dc2626;
  --warning: #b45309;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(14, 165, 164, .12), transparent 60%),
    radial-gradient(700px 350px at 10% -10%, rgba(2, 132, 199, .10), transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.topbar {
  padding: 28px clamp(16px, 5vw, 48px) 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.lang-switch {
  display: flex;
  gap: 4px;
  background: #e2e8f0;
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}
.lang-btn {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.lang-btn.active {
  background: #fff;
  color: var(--teal-dark);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .15);
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 4px 10px rgba(14, 165, 164, .35));
  flex-shrink: 0;
}
.brand h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand h1 span {
  background: linear-gradient(90deg, var(--teal), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- Stepper ---------- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 16px 6px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.step .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e2e8f0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  transition: all .25s;
}
.step.active { color: var(--teal-dark); }
.step.active .dot {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff;
  box-shadow: 0 3px 10px rgba(14, 165, 164, .4);
}
.step.done .dot {
  background: #ccfbf1;
  color: var(--teal-dark);
}
.step.done { color: var(--teal-dark); }
.stepper .bar {
  flex: 1;
  max-width: 70px;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}
@media (max-width: 560px) {
  .step .lbl { display: none; }
}

/* ---------- Layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 18px clamp(12px, 4vw, 32px) 40px;
}
.panel { animation: fadeIn .3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3.5vw, 32px);
}
.card-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: -.01em;
}
.muted { color: var(--ink-soft); font-size: 13.5px; margin: 0; }
.center { text-align: center; }

/* ---------- Accueil ---------- */
.hero {
  text-align: center;
  padding: 10px 12px 26px;
  max-width: 640px;
  margin: 0 auto;
}
.hero h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(90deg, var(--ink), var(--teal-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 760px) {
  .home-grid { grid-template-columns: 1fr; }
}
.card-title { margin: 0 0 6px; font-size: 17px; letter-spacing: -.01em; }
.import-card .muted { margin-bottom: 12px; }

/* Conversion rapide */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
  margin: 16px 0;
}
.qfield.q-amount, .qfield.q-date { grid-column: 1 / -1; }
.qfield label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.qfield input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.qfield input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 165, 164, .15);
}
.swap-btn {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  width: 40px;
  height: 41px;
  font-size: 18px;
  color: var(--teal-dark);
  cursor: pointer;
  transition: all .15s;
}
.swap-btn:hover {
  border-color: var(--teal);
  background: #f0fdfa;
  transform: rotate(180deg);
}
.btn.full { width: 100%; justify-content: center; }
.q-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0fdfa, #f0f9ff);
  border: 1px solid #99f6e4;
  text-align: center;
  animation: fadeIn .25s ease;
}
.q-main {
  margin: 0 0 4px;
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 800;
  color: var(--teal-dark);
  letter-spacing: -.01em;
}

/* Fonctionnalités */
.features-title {
  text-align: center;
  margin: 40px 0 16px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.feature:hover { transform: translateY(-2px); }
.f-ico { font-size: 26px; margin-bottom: 8px; }
.feature h4 { margin: 0 0 6px; font-size: 14.5px; }
.feature p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

/* ---------- Dropzone ---------- */
.dropzone {
  margin-top: 14px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  background: var(--card);
  padding: 60px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
  box-shadow: var(--shadow);
}
.dropzone.slim {
  margin-top: 0;
  padding: 34px 18px;
  box-shadow: none;
  background: #fafcfe;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--teal);
  outline: none;
}
.dropzone.dragover {
  border-color: var(--teal);
  background: #f0fdfa;
  transform: scale(1.01);
}
.upload-ico {
  width: 46px;
  height: 46px;
  color: var(--teal);
  margin-bottom: 10px;
}
.dz-title { margin: 0; font-size: 18px; font-weight: 700; }
.dz-sub { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; }
.dz-sub .link { color: var(--blue); font-weight: 600; text-decoration: underline; }
.dz-formats {
  margin: 18px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--muted);
}

/* ---------- Mapping ---------- */
.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 20px 0 6px;
}
.map-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.req { color: var(--error); }
select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 165, 164, .15);
}

/* ---------- Tables ---------- */
.preview-title { margin: 24px 0 10px; font-size: 15px; }
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 320px;
}
.table-wrap.tall { max-height: 420px; margin-top: 18px; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
  white-space: nowrap;
}
th, td { padding: 9px 14px; text-align: left; }
thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-soft);
  z-index: 1;
}
tbody tr:nth-child(even) { background: #f8fafc; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.mapped { color: var(--teal-dark); }
th.mapped::after { content: ' ✓'; }
tr.row-error td { color: var(--error); }

/* ---------- Convert step ---------- */
.convert-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 30px 0;
  flex-wrap: wrap;
}
.currency-pill {
  padding: 12px 22px;
  border-radius: 12px;
  background: #f0fdfa;
  border: 1.5px solid #99f6e4;
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .03em;
}
.arrow-ico { width: 30px; height: 30px; color: var(--muted); }
.currency-select {
  width: auto;
  min-width: 230px;
  font-weight: 600;
  padding: 12px 14px;
}

.progress {
  height: 8px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin: 18px 0 10px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  border-radius: 6px;
  transition: width .2s;
}

/* ---------- Downloads ---------- */
.download-row {
  display: flex;
  gap: 12px;
  margin: 20px 0 6px;
  flex-wrap: wrap;
}
.btn.dl {
  flex: 1;
  min-width: 130px;
  justify-content: center;
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  padding: 14px 18px;
  font-size: 15px;
}
.btn.dl:hover {
  border-color: var(--teal);
  background: #f0fdfa;
  transform: translateY(-1px);
}
.dl-ico { font-size: 20px; }

/* ---------- Buttons / misc ---------- */
.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.btn.primary {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff;
  box-shadow: 0 4px 14px rgba(14, 165, 164, .35);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(14, 165, 164, .45); }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}
.btn.ghost:hover { border-color: var(--muted); color: var(--ink); }

.error {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--error);
  font-size: 13.5px;
}
.warning {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: var(--warning);
  font-size: 13.5px;
}

.footer {
  text-align: center;
  padding: 18px;
  font-size: 12.5px;
  color: var(--muted);
}
.footer a { color: var(--blue); }
