/* THR Transit — design pro (RTL, Tunisian Arabic).
   Base : palette Muse (navy / rouge / vert), améliorée : hero photo,
   étapes, cartes de zones en verre, formulaires et résumé soignés. */
:root {
  --bg: #f4f6f6;
  --surface: #ffffff;
  --surface-2: #eef2f1;
  --ink: #1b2530;
  --ink-soft: #47545f;
  --line: #d9e0de;
  --accent: #c8102e;
  --accent-dark: #a50d26;
  --navy: #14324f;
  --navy-dark: #0c2a44;
  --green: #0e7a55;
  --green-bg: #e4f4ec;
  --amber-bg: #fdf3e0;
  --amber-ink: #7a5410;
  --field-bg: #ffffff;
  --shadow: 0 10px 30px rgba(20, 50, 79, 0.10);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161c;
    --surface: #18222b;
    --surface-2: #1f2b36;
    --ink: #edf2f5;
    --ink-soft: #a7b4bd;
    --line: #2c3a46;
    --accent: #e8364f;
    --accent-dark: #c8102e;
    --navy: #0f2740;
    --green: #3cb98d;
    --green-bg: #123528;
    --amber-bg: #3a2f14;
    --amber-ink: #f0cf8a;
    --field-bg: #131c24;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 18px; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; }
.hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.hero .shade { position: absolute; inset: 0; background: linear-gradient(200deg, rgba(10,26,43,.55) 0%, rgba(10,26,43,.88) 82%); }
.hero .inner { position: relative; padding: 28px 0 30px; }
.hero-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.brand-badge { display: inline-block; background: #fff; border-radius: 10px; padding: 6px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.brand-badge img { height: 42px; width: auto; }
.trip-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 700;
  padding: 6px 14px; border-radius: 999px; font-size: 14.5px;
}
.hero h1 { font-size: clamp(28px, 5.4vw, 38px); line-height: 1.25; font-weight: 800; margin: 0 0 10px; }
.hero p.lede { font-size: 17px; margin: 0 0 18px; color: #e8eef3; max-width: 600px; }
.hero-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-note { display: inline-block; font-size: 14.5px; color: #ffd9de; font-weight: 600; }
.trust-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.trust-item {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  padding: 6px 13px; border-radius: 999px; font-size: 14px; font-weight: 600;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: none; cursor: pointer; text-decoration: none;
  font-family: inherit; font-weight: 700; font-size: 17px;
  padding: 12px 24px; border-radius: 12px; line-height: 1.3;
  transition: background .15s ease, transform .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-red { background: var(--accent); color: #fff; }
.btn-red:hover { background: var(--accent-dark); }
.btn-ghost-light {
  background: transparent; color: #fff;
  border: 1.5px solid rgba(255,255,255,.65);
}
.btn-ghost-light:hover { background: rgba(255,255,255,.12); }

/* ---------- Comment ça marche ---------- */
.how { padding: 30px 0 6px; }
.how h2 { font-size: clamp(22px, 4vw, 27px); font-weight: 800; margin: 0 0 4px; color: var(--navy); }
.how > .wrap > p, .how-sub { color: var(--ink-soft); margin: 0 0 16px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.step-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800; margin-bottom: 10px;
}
.step:nth-child(2) .step-num { background: var(--accent); }
.step:nth-child(3) .step-num { background: var(--green); }
.step h3 { margin: 0 0 4px; font-size: 17px; }
.step p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

/* ---------- Bandeau infos (route + prix) ---------- */
.info-strip { background: var(--navy); color: #fff; margin-top: 26px; }
.info-strip .wrap { padding-top: 16px; padding-bottom: 16px; display: grid; gap: 12px; }
.route-line { margin: 0; font-size: 15px; color: #dbe7f2; }
.route-line strong { color: #fff; }
.route-line .sep { color: #8fb0cc; margin: 0 2px; }
.zone-grid { display: grid; grid-template-columns: 1.05fr 1.45fr 1fr; gap: 10px; }
.zone-card { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.20); border-radius: 12px; padding: 12px 14px; }
.zone-card .zone-cities { font-size: 12.5px; letter-spacing: .03em; color: #bcd2e6; font-weight: 700; margin: 0 0 4px; line-height: 1.4; }
.zone-card .zone-price { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.5; }
.zone-card .zone-price b { font-size: 17px; font-weight: 800; }
.ship-line { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 14.5px; color: #dbe7f2; }
.ship-line strong { color: #fff; }
.ship-line .pay-pill { background: var(--accent); color: #fff; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 13.5px; white-space: nowrap; }

/* ---------- Sections / cartes ---------- */
section { margin-top: 24px; }
main .wrap { padding-top: 22px; }
.form-head { margin: 0 0 14px; }
.form-head h2 { font-size: clamp(22px, 4vw, 27px); font-weight: 800; margin: 0 0 4px; }
.form-head p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 26px; box-shadow: var(--shadow);
}
.form-card { margin-bottom: 10px; }
.fieldset-title { font-weight: 700; font-size: 16.5px; margin: 22px 0 10px; padding-top: 18px; border-top: 1px dashed var(--line); }
.fieldset-title:first-of-type { margin-top: 2px; padding-top: 0; border-top: none; }

/* ---------- Formulaire ---------- */
label { display: block; font-weight: 600; margin: 14px 0 5px; font-size: 15.5px; }
label .req { color: var(--accent); }
input, select, textarea {
  width: 100%; padding: 11px 13px; font-size: 16.5px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--field-bg); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; border-color: var(--navy); }
textarea { min-height: 70px; resize: vertical; }
.hint { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; } }

.stepper { display: flex; align-items: stretch; max-width: 220px; }
.stepper button {
  width: 48px; font-size: 22px; font-weight: 700; cursor: pointer;
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--ink);
  font-family: inherit; line-height: 1;
}
.stepper button:first-child { border-radius: 0 10px 10px 0; }
.stepper button:last-child { border-radius: 10px 0 0 10px; }
.stepper input { text-align: center; border-radius: 0; border-right: none; border-left: none; font-weight: 700; }

.weights { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.weights label { margin: 0 0 4px; font-size: 14px; }

/* ---------- Résumé prix ---------- */
.summary { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 18px 20px; margin-top: 22px; }
.summary h3 { margin: 0 0 10px; font-size: 16px; color: #bcd2e6; }
.summary .line { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; font-size: 16px; }
.summary .line b { white-space: nowrap; }
.summary .line.total { border-top: 1px solid rgba(255,255,255,.25); margin-top: 8px; padding-top: 12px; font-size: 19px; font-weight: 800; }
.summary .line.total b { font-size: 25px; }
.summary .line.deposit { color: #a7e8cd; font-weight: 700; }
.summary .line.balance { color: #bcd2e6; }
.summary .fineprint { margin: 10px 0 0; font-size: 13px; color: #bcd2e6; }
.submit-btn { width: 100%; margin-top: 16px; font-size: 18.5px; padding: 15px; }
.submit-btn:disabled { opacity: 0.6; cursor: wait; }
.error {
  display: none; margin-top: 14px; background: #fdecea; border: 1px solid #f5c6c0;
  color: var(--accent); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600;
}

/* ---------- Confirmation ---------- */
#confirmation { display: none; }
.confirm-card {
  background: var(--surface); border: 2px solid var(--green); border-radius: 18px;
  box-shadow: var(--shadow); padding: 26px; margin: 22px 0 36px;
}
.confirm-head { display: flex; gap: 14px; align-items: flex-start; }
.confirm-head .check {
  width: 44px; height: 44px; border-radius: 50%; background: var(--green-bg); color: var(--green);
  display: flex; align-items: center; justify-content: center; flex: none; font-size: 24px; font-weight: 800;
}
.confirm-head h2 { margin: 0 0 4px; font-size: 23px; font-weight: 800; }
.confirm-head p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }
.ref-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  background: var(--surface-2); border-radius: 12px; padding: 12px 16px; margin: 18px 0 4px;
}
.ref-box .ref-label { font-weight: 600; color: var(--ink-soft); font-size: 15px; }
.ref-box .ref { font-size: 25px; font-weight: 800; letter-spacing: 1px; direction: ltr; unicode-bidi: embed; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.kv:last-child { border-bottom: none; }
.kv b { font-size: 17px; white-space: nowrap; }

.interac {
  margin-top: 16px; background: var(--amber-bg);
  border: 1px solid #f0d48a; border-radius: 12px; padding: 14px 16px;
}
.interac h3 { margin: 0 0 8px; font-size: 17px; }
.copy-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.copy-row .label { min-width: 74px; font-weight: 700; font-size: 14px; }
.copy-row .value { flex: 1; font-weight: 700; direction: ltr; text-align: left; overflow-wrap: anywhere; }
.copy-btn {
  padding: 7px 12px; font-size: 13px; font-weight: 700; font-family: inherit;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 8px; cursor: pointer; color: var(--ink); white-space: nowrap;
}
.copy-btn:hover { border-color: var(--navy); }
.copy-btn.copied { background: var(--green); border-color: var(--green); color: #fff; }

.wa-main {
  display: block; text-align: center; margin-top: 16px; padding: 14px;
  background: #1faa55; color: #fff; font-size: 17px; font-weight: 800;
  border-radius: 12px; text-decoration: none;
}
.wa-main:hover { background: #178a44; }
.inquiries { text-align: center; margin-top: 12px; font-size: 15px; }
.inquiries a { font-weight: 700; }

/* ---------- Footer ---------- */
footer { padding: 8px 0 36px; color: var(--ink-soft); font-size: 14.5px; }
footer .wrap { border-top: 1px solid var(--line); padding-top: 16px; }
.foot-grid { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-grid a { color: var(--navy); font-weight: 600; }
.foot-admin { margin: 14px 0 0; text-align: center; }
.foot-admin a { color: var(--ink-soft); font-size: 13px; text-decoration: none; }
.foot-admin a:hover { color: var(--navy); text-decoration: underline; }

/* ---------- Admin ---------- */
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-top .admin-links { display: flex; gap: 8px; }
.money-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
@media (max-width: 600px) { .money-strip { grid-template-columns: 1fr; } }
.money { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.money .t { font-size: 13px; color: var(--ink-soft); }
.money .v { font-size: 24px; font-weight: 900; color: var(--navy); }
.money.received .v { color: var(--green); }
.money.outstanding .v { color: var(--accent); }
.toolbar { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.toolbar input { flex: 1; min-width: 180px; }
.filters { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 14px; font-family: inherit; font-size: 14px; font-weight: 700;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 999px; cursor: pointer; color: var(--ink);
}
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.booking { margin-top: 14px; }
.booking .head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.badge.unpaid { background: #fdecea; color: var(--accent); }
.badge.partial { background: var(--amber-bg); color: var(--amber-ink); }
.badge.paid { background: var(--green-bg); color: var(--green); }
.badge.picked { background: var(--green-bg); color: var(--green); }
.badge.notpicked { background: var(--surface-2); color: var(--ink-soft); }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.action-btn {
  padding: 9px 13px; font-family: inherit; font-size: 14px; font-weight: 700;
  border-radius: 9px; cursor: pointer; border: 1.5px solid var(--navy);
  background: var(--surface); color: var(--navy); text-decoration: none;
  display: inline-flex; align-items: center;
}
.action-btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.action-btn.wa { background: #1faa55; border-color: #1faa55; color: #fff; }
.action-btn.danger { border-color: var(--accent); color: var(--accent); }
.action-btn.danger.confirm { background: var(--accent); color: #fff; }
.empty { text-align: center; color: var(--ink-soft); padding: 28px 0; }
.login-card { max-width: 420px; margin: 60px auto 0; }

@media (max-width: 760px) {
  .zone-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .card, .confirm-card { padding: 20px; }
  .hero-note { display: block; margin: 10px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
