@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --brand: #C8102E;
  --brand-dark: #9E0C23;
  --amber: #C98A2B;
  --success: #0E7A56;
  --red: #B2452F;
  --bg: #FAFAF9;
  --text: #221B1D;
  --muted: #716B6C;
  --subtle: #9A9496;
  --surface: #F4F2F2;
  --border: #ECE6E7;
  --input-border: #DDD5D7;
}

* { box-sizing: border-box; }

/* Icônes */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; color: currentColor; }
.icon-muted { color: var(--subtle); }
.icon-amber { color: var(--amber); }
.icon-red { color: var(--red); }
.icon-brand { color: var(--brand); }
.icon-success { color: var(--success); }
.footnote .icon { vertical-align: -3px; margin-right: 4px; }
.back-link .icon { vertical-align: -3px; margin-right: 4px; }
.notice-box .icon { vertical-align: -3px; margin-right: 4px; }
.pill .icon { vertical-align: -2px; margin-right: 3px; }
.status-pill .icon { vertical-align: -2px; margin-right: 4px; }
.alert .icon { vertical-align: -2px; margin-right: 4px; }
.sidebar-foot .icon { vertical-align: -3px; margin-right: 6px; }
.nav-item .icon { margin-right: 2px; }

body { margin: 0; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); }
h1, h2 { text-wrap: balance; }
h1, h2, h3, .brand, .brand-mark, .admin-title, .kpi-value, .ref-code {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
}
a { color: var(--brand); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand-dark); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 48px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 16px;
  background: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.brand-icon { width: 36px; height: 36px; border-radius: 11px; background: var(--brand); display: flex; align-items: center; justify-content: center; }
.nav-links { display: flex; align-items: center; gap: 24px; font-size: 14px; font-weight: 500; }
.nav-links > a { display: inline-flex; align-items: center; gap: 6px; }
a.brand, a.brand:hover { color: var(--text); }

/* Sélecteur de langue */
.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: #fff;
  font-size: 13px; font-weight: 700; color: var(--text); user-select: none;
  transition: border-color .15s ease, background .15s ease;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { border-color: var(--input-border); background: var(--bg); }
.lang-switch summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lang-switch .lang-chevron { color: var(--muted); transition: transform .15s ease; }
.lang-switch[open] .lang-chevron { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 200px;
  margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 16px 36px -16px rgba(34, 27, 29, .28);
}
.lang-menu a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.lang-menu a:hover { background: var(--bg); color: var(--text); }
.lang-menu a.active { background: var(--surface); color: var(--text); font-weight: 600; }
.flag {
  width: 20px; height: 15px; flex-shrink: 0; display: block; object-fit: cover;
  border-radius: 2px; box-shadow: 0 0 0 1px rgba(34, 27, 29, .12);
}
.lang-name { flex: 1; }
.lang-code { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.lang-menu a.active .lang-code { color: var(--text); }
.lang-check { color: var(--brand); margin-left: 2px; }
.lang-menu a:not(.active) .lang-code { margin-right: 17px; }
.nav-links a.button {
  padding: 10px 20px; background: var(--brand); color: #fff; border-radius: 999px; font-weight: 700;
  transition: background .15s ease, transform .15s ease;
}
.nav-links a.button:hover { background: var(--brand-dark); color: #fff; }

.banner-wrap { max-width: 1100px; margin: 24px auto 0; padding: 0 24px; }
.banner-img { width: 100%; height: 280px; object-fit: cover; object-position: 78% center; border-radius: 20px; display: block; }
@media (max-width: 720px) { .banner-img { height: 180px; } }

/* Hero */
.hero-wrap {
  position: relative;
  overflow: hidden;
}
.hero-wrap::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(var(--brand) 1.5px, transparent 1.5px),
    radial-gradient(var(--brand) 1.5px, transparent 1.5px);
  background-size: 54px 54px;
  background-position: 0 0, 27px 27px;
  opacity: .05;
  pointer-events: none;
}
.hero { position: relative; text-align: center; max-width: 640px; margin: 0 auto; padding: 64px 24px 0; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: #fff;
  border: 1px solid var(--border); color: var(--text); border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 20px;
}
.badge .icon { color: var(--brand); }
.hero h1 { margin: 0 0 16px; font-size: clamp(28px, 4.2vw + 14px, 44px); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.hero p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); }

.cards { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; max-width: 860px; margin: 48px auto 0; padding: 0 24px 64px; }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 32px;
  display: flex; flex-direction: column; gap: 14px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: 0 12px 28px -12px rgba(34, 27, 29, .18); transform: translateY(-2px); }
.card-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.card-icon-solid { background: var(--brand); color: #fff; }
.card-icon-ring { background: #fff; color: var(--brand); border: 2px solid var(--brand); }
.card h3 { margin: 0; font-size: 18px; font-weight: 700; }
.card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 999px;
  padding: 13px 22px; font-size: 14px; font-weight: 700; cursor: pointer; text-align: center;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -8px rgba(200, 16, 46, .55); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }
.btn-danger-outline { background: #fff; color: var(--red); border: 1px solid var(--border); padding: 7px 14px; font-size: 12.5px; border-radius: 999px; }
.btn-small { padding: 8px 14px; font-size: 12.5px; }
summary.btn { cursor: pointer; }
summary.btn::-webkit-details-marker { display: none; }

/* Rubriques de la page d'accueil */
.section-tag { display: inline-block; padding: 7px 16px; background: var(--brand); color: #fff; border-radius: 999px; font-size: 13px; font-weight: 700; margin-bottom: 16px; }

/* En-tête des pages publiques, mobile */
@media (max-width: 720px) {
  .site-header { padding: 14px 20px; flex-wrap: nowrap; }
  .site-header .brand { font-size: 16px; min-width: 0; }
  .site-header .brand img { width: 30px; height: 30px; }
  .nav-links { gap: 14px; }
  .nav-links .nav-text { display: none; }
  .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-links a.button { display: none; }
  .lang-switch summary { padding: 7px 10px; }
  .hero { padding-top: 40px; }
}

body:has(> .site-footer) { display: flex; flex-direction: column; min-height: 100vh; }
body:has(> .site-footer) > :not(.back-to-top, script, template) { width: 100%; }
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border); background: #fff; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.site-footer a { color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.site-footer a:hover { color: var(--brand); }
.footer-links { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; }
@media (max-width: 960px) {
  .nav-links .nav-text { display: none; }
  .site-header { flex-wrap: nowrap; }
}

.footnote { margin: 0 auto; font-size: 13px; color: var(--subtle); max-width: 640px; text-align: center; padding: 0 24px 32px; position: relative; }

.back-link { background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; margin-bottom: 20px; padding: 0; display: inline-block; }

.field { margin-bottom: 16px; }
.field > label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--input-border); border-radius: 12px; font-size: 16px; font-family: inherit; background: #fff;
  transition: border-color .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 64px; }
.input-suffix span {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 13px; font-weight: 600; color: var(--muted); pointer-events: none;
}
.notice-box { padding: 12px 16px; background: var(--surface); border-radius: 12px; font-size: 12.5px; color: var(--text); line-height: 1.5; margin-bottom: 16px; }

.confirmation { text-align: center; padding: 72px 24px; max-width: 480px; margin: 0 auto; }
.confirm-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--success); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.confirmation h2 { margin: 0 0 8px; font-size: 24px; font-weight: 800; }
.ref-code { font-size: 22px; font-weight: 700; letter-spacing: 0.04em; margin-bottom: 16px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 24px; }
.status-pill, .pill.status-pending, .pill.status-validated, .pill.status-rejected, .pill.status-inactive {
  background: #fff; border: 1px solid var(--border); color: var(--text);
}
.status-pending .icon { color: var(--amber); }
.status-validated .icon { color: var(--success); }
.status-rejected .icon { color: var(--red); }
.status-inactive { color: var(--muted); }
.status-inactive .icon { color: var(--subtle); }

/* Espace admin */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; min-width: 240px; background: #23141A; height: 100vh; position: sticky; top: 0; overflow-y: auto; padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 24px; }
.sidebar .brand, .sidebar .brand:hover { color: #fff; }
.menu-close { display: none; }
.sidebar .brand-icon { background: var(--bg); }
.sidebar a.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px;
  color: #E7B9C2; font-size: 14px; font-weight: 600; transition: background .15s ease, color .15s ease;
}
.sidebar a.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar a.nav-item.active { background: var(--brand); color: #fff; }
.sidebar .badge-count { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.cell-stack { display: flex; flex-direction: column; gap: 2px; }
.cell-title { font-weight: 600; }
.cell-meta { color: var(--subtle); font-size: 12.5px; font-weight: 400; }
.sidebar .sidebar-foot { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; }
.sidebar .sidebar-foot a { color: #C99BA3; display: flex; align-items: center; padding: 4px 0; }
.sidebar .sidebar-foot a:hover { color: #fff; }

.admin-main { flex: 1; min-width: 0; padding: 32px 40px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.admin-title { font-size: clamp(20px, 1.2vw + 15px, 25px); font-weight: 800; }
.admin-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-mobilebar, .sidebar-backdrop { display: none; }
.form-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-2col-full { grid-column: 1 / -1; }
.field-check { display: flex; align-items: center; gap: 8px; margin-top: 28px; }
.field-check label { margin: 0; }
.field-check input { width: auto; }
.row-actions { display: flex; gap: 8px; flex-wrap: nowrap; }
.row-actions form { display: contents; }
.row-actions-stack { flex-direction: column; align-items: stretch; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 28px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.kpi { display: flex; flex-direction: column; justify-content: space-between; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.kpi-label { font-size: 12.5px; color: var(--subtle); font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 26px; font-weight: 800; }

.panel { background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.panel-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-head .title { font-size: 15px; font-weight: 700; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead tr { text-align: left; color: var(--subtle); font-size: 12px; font-weight: 600; }
th, td { padding: 12px 16px; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr { border-top: 1px solid var(--border); }

.pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; display: inline-block; white-space: nowrap; }
tbody td:first-child { white-space: nowrap; }
.table-cards td[data-label="Code"], .table-cards td[data-label="Date"], .table-cards td[data-label="Statut"], .table-cards td[data-label="Montant"], .table-cards td.cell-actions { white-space: nowrap; }
.tabs { display: flex; gap: 8px; margin: 20px 0; }
.tab { padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--input-border); background: #fff; color: var(--text); transition: all .15s ease; }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.alert { padding: 12px 16px; border-radius: 12px; font-size: 13.5px; margin-bottom: 16px; background: #fff; border: 1px solid var(--border); border-left-width: 3px; color: var(--text); }
.alert-error { border-left-color: var(--red); }
.alert-error .icon { color: var(--red); }
.alert-success { border-left-color: var(--success); }
.alert-success .icon { color: var(--success); }
.alert-info { border-left-color: var(--subtle); }
.alert ul { margin: 8px 0 0; padding-left: 18px; }
.alert li { margin: 4px 0; line-height: 1.45; }

.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; background: var(--bg); }
.auth-card { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 36px; max-width: 420px; width: 100%; box-shadow: 0 20px 44px -24px rgba(34, 27, 29, .25); }
.brand-mark { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; margin-bottom: 24px; }
.muted { color: var(--muted); font-size: 13.5px; }
.form-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.form-grid h3 { margin: 10px 0 0; font-size: 14px; font-family: 'Inter', sans-serif; }
.form-grid label { font-size: 13px; font-weight: 600; }
.field-hint { display: block; margin-top: 6px; font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.4; }
.form-grid input, .form-grid select { width: 100%; padding: 11px 14px; border: 1.5px solid var(--input-border); border-radius: 12px; font-size: 16px; margin-top: 4px; }
.form-grid select, .field select { background-color: #fff; color: var(--text); }
.form-grid input:focus, .form-grid select:focus { outline: none; border-color: var(--brand); }


/* ============================================================
   Formulaires publics
   ============================================================ */
.form-page { max-width: 1040px; margin: 0 auto; padding: 36px 24px 64px; }
.form-page > .back-link { margin-bottom: 16px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.form-card {
  background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: clamp(22px, 2.4vw + 8px, 40px);
  box-shadow: 0 1px 2px rgba(34, 27, 29, .04), 0 18px 40px -28px rgba(34, 27, 29, .25);
}
.form-title { margin: 0 0 6px; font-size: clamp(24px, 1.4vw + 18px, 30px); font-weight: 800; line-height: 1.2; }
.form-sub { margin: 0 0 28px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.form-summary { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.form-summary:focus { outline: none; }

.rp-form { display: flex; flex-direction: column; gap: 24px; }
.rp-form .field { margin: 0; padding: 0; border: 0; min-width: 0; }
.rp-form .field-label { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.field-optional { padding: 2px 8px; border-radius: 999px; background: var(--surface); font-size: 11.5px; font-weight: 500; color: var(--muted); }

.rp-form input[type="text"], .rp-form input[type="email"], .rp-form input[type="tel"], .rp-form textarea {
  display: block; width: 100%; height: 52px; padding: 0 16px; border: 1.5px solid var(--input-border); border-radius: 12px;
  background: #fff; color: var(--text); font: inherit; font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rp-form textarea { height: auto; min-height: 96px; padding: 14px 16px; resize: vertical; line-height: 1.5; }
.rp-form input::placeholder, .rp-form textarea::placeholder { color: #A9A2A4; opacity: 1; }
.rp-form input:hover, .rp-form textarea:hover { border-color: #C6BCBE; }
.rp-form input:focus, .rp-form textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px rgba(34, 27, 29, .08); }
.rp-form input[aria-invalid="true"] { border-color: var(--red); }
.rp-form input[aria-invalid="true"]:focus { border-color: var(--red); }
.rp-form input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(178, 69, 47, .14); }
.input-code { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.input-code::placeholder { font-weight: 400; letter-spacing: normal; text-transform: none; }
.rp-form .field-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

.field-error {
  display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0;
  font-size: 13.5px; font-weight: 500; line-height: 1.4; color: var(--red);
  animation: rp-in .18s ease;
}
.field-error[hidden] { display: none; }
.field-error .icon { margin-top: 1px; }
@keyframes rp-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.email-suggest {
  display: block; margin-top: 8px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; color: var(--muted); text-align: left; animation: rp-in .18s ease;
}
.email-suggest strong { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

/* Choix du produit : cartes sélectionnables */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.choice {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 16px;
  border: 1.5px solid var(--input-border); border-radius: 14px; background: #fff; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.choice:hover { border-color: #C6BCBE; }
.choice input, .option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.choice-icon {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px;
  border-radius: 50%; background: var(--surface); color: var(--text); transition: background .15s ease, color .15s ease;
}
.choice-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-right: 22px; }
.choice-name { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.choice-price { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.choice-check {
  position: absolute; top: 10px; right: 10px; display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff;
  opacity: 0; transform: scale(.5); transition: opacity .15s ease, transform .15s ease;
}
.choice:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.choice:has(input:checked) .choice-icon { background: var(--brand); color: #fff; }
.choice:has(input:checked) .choice-check { opacity: 1; transform: none; }
.choice:has(input:focus-visible), .option:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
fieldset.is-invalid .choice:not(:has(input:checked)), fieldset.is-invalid .option { border-color: var(--red); }
.empty-note { margin: 0; padding: 16px; border-radius: 12px; background: var(--surface); font-size: 14px; color: var(--muted); }

/* Motif du remboursement : options */
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 16px;
  border: 1.5px solid var(--input-border); border-radius: 12px; background: #fff; cursor: pointer; font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.option:hover { border-color: #C6BCBE; }
.option-radio { flex-shrink: 0; width: 20px; height: 20px; border: 1.5px solid #B9B0B2; border-radius: 50%; transition: border .15s ease; }
.option:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.option:has(input:checked) .option-radio { border: 6px solid var(--brand); }
.option-details { display: none; margin-top: 16px; }
fieldset:has(input[value="other"]:checked) .option-details { display: block; animation: rp-in .18s ease; }

.rp-form .notice-box { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 14px 16px; font-size: 13.5px; }
.rp-form .notice-box .icon { margin: 1px 0 0; }

/* Fiche carte à rembourser : présentation premium, soignée */
.rp-form .card-panel {
  padding: 22px 22px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(168deg, #fff 0%, var(--surface) 160%);
  box-shadow: 0 1px 2px rgba(34, 27, 29, .04), 0 14px 28px -20px rgba(34, 27, 29, .22);
}
.rp-form .card-panel.is-invalid { border-color: var(--red); }
.card-panel > .field:not(:last-of-type) { margin-bottom: 16px; }
.card-panel-legend { display: flex; align-items: center; gap: 10px; margin-bottom: 18px !important; font-size: 15px !important; }
.card-panel-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none;
  border-radius: 9px; background: linear-gradient(145deg, var(--brand), var(--brand-dark)); color: #fff;
  box-shadow: 0 4px 10px -4px rgba(200, 16, 46, .55);
}
.card-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.input-icon-wrap input { padding-left: 42px !important; }
.input-card-number { font-variant-numeric: tabular-nums; letter-spacing: .04em; font-weight: 600; }
@media (max-width: 560px) {
  .card-field-row { grid-template-columns: 1fr; }
}

/* Bouton d'envoi */
.btn-submit { width: 100%; min-height: 54px; margin-top: 4px; font-size: 15.5px; }
.btn-spinner { display: none; }
.btn-submit.is-loading .btn-spinner { display: inline-flex; animation: rp-spin .8s linear infinite; }
.btn-submit.is-loading, .btn-submit.is-loading:disabled { cursor: progress; opacity: .92; }
.btn-submit:disabled:not(.is-loading) { opacity: .45; cursor: not-allowed; box-shadow: none; }
@keyframes rp-spin { to { transform: rotate(360deg); } }


/* Types de recharge : logo ou initiales */
.type-badge {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px;
  border-radius: 50%; background: var(--surface); color: var(--text);
  font-family: 'Poppins', 'Inter', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .02em; overflow: hidden;
}
.type-badge.has-logo { border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 1px var(--border); }
.type-badge.has-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
/* Logos de marque : emplacement rectangulaire (format carte) pour que les logos horizontaux restent lisibles */
.type-badge.has-logo { width: 48px; height: 32px; border-radius: 7px; }
.type-badge-lg.has-logo { width: 84px; height: 54px; border-radius: 11px; }
.type-badge-lg.has-logo img { padding: 6px 8px; }
.type-badge-lg { width: 52px; height: 52px; font-size: 16px; }
.choice-icon.type-badge { width: 44px; height: 44px; font-size: 14px; }
.choice-icon.type-badge.has-logo { width: 76px; height: 48px; border-radius: 10px; }
.choice-icon.type-badge.has-logo img { padding: 5px 7px; }
@media (max-width: 420px) { .choice-icon.type-badge.has-logo { width: 66px; height: 42px; } }
.choice:has(input:checked) .choice-icon.has-logo { background: #fff; box-shadow: inset 0 0 0 1px var(--border); }
.choice-meta { font-size: 12.5px; color: var(--muted); }
.type-cell { display: inline-flex; align-items: center; gap: 10px; }

.step-index {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--text); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* Montants */
.amount-group + .amount-group { margin-top: 16px; }
.amount-group-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.js-ready .amount-group-title { display: none; }
.js-ready .amount-group + .amount-group { margin-top: 0; }
.amount-group[hidden] { display: none; }
.amount-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.amount-chip {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; padding: 10px 12px; border: 1.5px solid var(--input-border); border-radius: 12px; background: #fff;
  text-align: center; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease;
}
.amount-chip:hover { border-color: #C6BCBE; }
.amount-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.amount-value { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.amount-label { font-size: 12.5px; line-height: 1.3; color: var(--muted); }
.amount-chip:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.amount-chip:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
fieldset.is-invalid .amount-chip { border-color: var(--red); }
.amount-placeholder { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--surface); font-size: 14px; color: var(--muted); }
.amount-placeholder[hidden] { display: none; }

.code-hint strong { display: block; color: var(--text); font-weight: 600; }
.code-hint strong[hidden] { display: none; }

/* Formulaires de l'espace de gestion */
.panel-form { margin-bottom: 20px; }
.admin-form { padding: 20px 24px 24px; }
.form-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.form-section-title { margin-bottom: 14px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.admin-form .field { margin-bottom: 0; }
.label-note { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--muted); }
.logo-field { display: flex; align-items: center; gap: 12px; }
.logo-field input[type="file"] { flex: 1; min-width: 0; padding: 10px; font-size: 14px; }
.check-inline { display: inline-flex !important; align-items: center; gap: 8px; margin-top: 8px; font-weight: 500 !important; }
.check-inline input { width: auto !important; }
.range-inputs { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.range-inputs input { width: 96px !important; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.code-sample {
  padding: 2px 7px; border-radius: 6px; background: var(--surface); white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
}
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.empty-panel { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px; }
.empty-panel p { margin: 0; color: var(--muted); }
.cell-amount { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }


.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.section-head { max-width: 680px; margin: 0 auto clamp(28px, 4vw, 44px); text-align: center; }
.section-head h2 { margin: 0 0 12px; font-size: clamp(24px, 2.2vw + 15px, 34px); font-weight: 800; line-height: 1.2; }
.section-sub { font-size: 16px; line-height: 1.6; color: var(--muted); }
.section-sub p { margin: 0; }
h4 { font-family: 'Poppins', 'Inter', system-ui, sans-serif; }

/* Comment ça marche */
.how-section { padding: clamp(48px, 6vw, 84px) 24px; background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.how-tabs {
  display: flex; gap: 6px; width: max-content; max-width: 100%; margin: 0 auto 32px; padding: 6px;
  border-radius: 999px; background: var(--surface);
}
.how-tabs[hidden] { display: none; }
.how-tabs [role="tab"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 600; color: var(--muted); transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.how-tabs [role="tab"]:hover { color: var(--text); }
.how-tabs [role="tab"][aria-selected="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(34, 27, 29, .14); }
.how-tabs [role="tab"][aria-selected="true"] .icon { color: var(--brand); }
.how-tabs [role="tab"]:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.how-panel { max-width: 1100px; margin: 0 auto; }
.how-panel[hidden] { display: none; }
.how-panel + .how-panel { margin-top: 48px; }
.has-tabs .how-panel + .how-panel { margin-top: 0; }
.how-panel-title { margin: 0 0 20px; text-align: center; font-size: 19px; font-weight: 700; }
.has-tabs .how-panel-title { display: none; }
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.how-step { padding: 24px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg); }
.how-step-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.how-step-icon {
  display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 16px;
  background: var(--brand); color: #fff; box-shadow: 0 12px 22px -14px rgba(200, 16, 46, .7);
}
.how-step-num { font-family: 'Poppins', sans-serif; font-size: 42px; font-weight: 800; line-height: 1; color: #E4DCDE; font-variant-numeric: tabular-nums; }
.how-step h4 { margin: 0 0 8px; font-size: 16.5px; font-weight: 700; line-height: 1.35; }
.how-step-body { font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.how-step-body p { margin: 0 0 8px; }
.how-step-body p:last-child { margin: 0; }
.how-cta { margin-top: 32px; text-align: center; }

/* FAQ */
.faq-section { max-width: 880px; margin: 0 auto; padding: clamp(48px, 6vw, 84px) 24px; }
.faq-toolbar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.faq-toolbar[hidden] { display: none; }
.faq-search { position: relative; display: block; }
.faq-search .icon { position: absolute; top: 50%; left: 18px; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.faq-search input {
  width: 100%; height: 54px; padding: 0 18px 0 48px; border: 1.5px solid var(--input-border); border-radius: 999px;
  background: #fff; color: var(--text); font: inherit; font-size: 16px; transition: border-color .15s ease, box-shadow .15s ease;
}
.faq-search input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px rgba(34, 27, 29, .08); }
.faq-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.faq-filter {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 16px; border: 1px solid var(--border);
  border-radius: 999px; background: #fff; color: var(--text); cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.faq-filter:hover { border-color: var(--input-border); }
.faq-filter.is-active { background: var(--text); border-color: var(--text); color: #fff; }
.faq-filter:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: 16px; background: #fff; transition: border-color .15s ease, box-shadow .2s ease; }
.faq-item[hidden] { display: none; }
.faq-item[open] { border-color: #DCD3D5; box-shadow: 0 14px 32px -24px rgba(34, 27, 29, .35); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 18px 20px;
  list-style: none; cursor: pointer; font-size: 16px; font-weight: 600; line-height: 1.4;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; border-radius: 16px; }
.faq-toggle {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); color: var(--text); transition: transform .2s ease, background .15s ease, color .15s ease;
}
.faq-item[open] .faq-toggle { transform: rotate(180deg); background: var(--text); color: #fff; }
.faq-item.is-closing .faq-toggle { transform: none; background: var(--surface); color: var(--text); }
.faq-item.is-animating .faq-answer { overflow: hidden; }
.faq-answer { padding: 0 20px 20px; font-size: 15px; line-height: 1.65; color: #4E4648; }
.faq-answer p { margin: 0 0 10px; }
.faq-answer p:last-child { margin: 0; }
.faq-answer a { text-decoration: underline; text-underline-offset: 2px; }
.faq-empty { margin: 0; padding: 24px; border-radius: 16px; background: var(--surface); text-align: center; color: var(--muted); }
.faq-empty[hidden] { display: none; }
.faq-contact {
  display: flex; align-items: center; gap: 18px; margin-top: 28px; padding: 22px 24px; border-radius: 20px;
  background: #23141A; color: #fff;
}
.faq-contact-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; background: var(--brand); }
.faq-contact-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.faq-contact-text strong { font-family: 'Poppins', sans-serif; font-size: 17px; }
.faq-contact-text span { font-size: 14.5px; line-height: 1.5; color: #E7C9CF; }
.faq-contact .btn-primary { flex-shrink: 0; box-shadow: none; }


/* Contenu du site (espace de gestion) */
.section-nav .tab { display: inline-flex; align-items: center; gap: 7px; }
.lang-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.lang-bar-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.lang-bar-list { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: 999px; background: #fff; color: var(--text); font-size: 13.5px; font-weight: 600;
}
.lang-pill:hover { color: var(--text); border-color: var(--input-border); }
.lang-pill.active { background: var(--text); border-color: var(--text); color: #fff; }
.panel-head .panel-note { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.panel-head .count { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--surface); font-size: 12px; color: var(--muted); }
.text-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.text-fields .field:has(textarea) { grid-column: 1 / -1; }
.admin-form textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--input-border); border-radius: 12px; font: inherit; font-size: 16px; line-height: 1.5; resize: vertical; }
.admin-form textarea:focus { outline: none; border-color: var(--text); }
.admin-form .field-hint { margin: 14px 0 16px; font-size: 13px; color: var(--muted); }
.tag-modified { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--text); color: #fff; font-size: 11px; font-weight: 600; }
.reference-text {
  display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; padding: 12px 14px;
  border-left: 3px solid var(--input-border); border-radius: 0 10px 10px 0; background: var(--surface); font-size: 14px; line-height: 1.5;
}
.reference-label { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.icon-select { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-option { position: relative; display: inline-flex !important; margin: 0 !important; cursor: pointer; }
.icon-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.icon-option span {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1.5px solid var(--input-border);
  border-radius: 10px; background: #fff; color: var(--text); transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.icon-option:hover span { border-color: #C6BCBE; }
.icon-option input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.icon-option input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.toggle-list { display: flex; flex-direction: column; gap: 10px; }
.toggle-row {
  display: flex !important; align-items: flex-start; gap: 12px; margin: 0 !important; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
}
.toggle-row input { width: 18px !important; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.toggle-text { display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
.toggle-text span { font-size: 13.5px; color: var(--muted); }
.content-list { margin-bottom: 20px; }
.content-list tbody td:first-child { white-space: normal; min-width: 220px; }
.content-list td[data-label="Langues"] { min-width: 120px; }
.item-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; }
.lang-dots { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.lang-dot { padding: 1px 5px; border-radius: 5px; background: var(--surface); color: var(--subtle); font-size: 10.5px; font-weight: 700; letter-spacing: .02em; }
.lang-dot.is-done { background: var(--text); color: #fff; }
.btn-icon { width: 34px; padding-left: 0; padding-right: 0; }
.btn:disabled { opacity: .35; cursor: not-allowed; }

/* Réassurance */
.form-aside {
  position: sticky; top: 24px; padding: 24px; border: 1px solid var(--border); border-radius: 20px; background: #fff;
}
.form-aside h2 { margin: 0 0 18px; font-size: 16px; font-weight: 700; line-height: 1.35; }
.form-aside ul { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.form-aside li { display: flex; align-items: center; gap: 12px; font-size: 14px; line-height: 1.45; }
.aside-icon {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px;
  border-radius: 50%; background: var(--brand); color: #fff;
}
.aside-help { display: flex; flex-direction: column; gap: 6px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--muted); }
.aside-help a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; overflow-wrap: anywhere; }

/* Confirmation */
.ref-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ref-row .ref-code { margin: 0; }
.ref-keep { max-width: 360px; margin: 0 auto 22px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.btn-copy.is-done { background: var(--success); border-color: var(--success); color: #fff; }

@media (max-width: 900px) {
  .form-layout { grid-template-columns: 1fr; gap: 20px; }
  .form-aside { position: static; }
}
@media (max-width: 768px) {
  .form-page { padding: 20px 16px 48px; }
  .form-sub { margin-bottom: 22px; }
  .rp-form { gap: 22px; }
}


/* ============================================================
   Mouvement : défilement doux, en-tête, apparitions, transitions
   ============================================================ */
html { scroll-behavior: smooth; }
#comment, #faq { scroll-margin-top: 84px; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  transition: background-color .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, .9); border-bottom-color: transparent;
  box-shadow: 0 10px 30px -22px rgba(34, 27, 29, .45);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
}

/* Entrée douce du haut de page */
@keyframes rp-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero > *, .cards .card, .form-card, .form-aside, .confirmation { animation: rp-rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.hero > :nth-child(2) { animation-delay: .06s; }
.hero > :nth-child(3) { animation-delay: .12s; }
.cards .card:nth-child(1) { animation-delay: .16s; }
.cards .card:nth-child(2) { animation-delay: .24s; }
.form-aside { animation-delay: .1s; }

/* Apparition au défilement (activée par assets/motion.js) */
.js-motion :is(.section-head, .how-tabs, .how-step, .how-cta, .faq-toolbar, .faq-item, .faq-contact, .footnote) {
  transition: opacity .65s cubic-bezier(.2, .7, .2, 1), transform .65s cubic-bezier(.2, .7, .2, 1), border-color .15s ease, box-shadow .2s ease;
}
.js-motion :is(.section-head, .how-tabs, .how-step, .how-cta, .faq-toolbar, .faq-item, .faq-contact, .footnote):not(.is-revealed) {
  opacity: 0; transform: translateY(22px);
}

/* Changement d'onglet « Comment ça marche » */
@keyframes rp-panel { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.has-tabs .how-panel:not([hidden]) .how-steps { animation: rp-panel .4s cubic-bezier(.2, .7, .2, 1); }

/* Retour en haut */
.back-to-top {
  position: fixed; z-index: 45; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 50%; background: var(--text); color: #fff; cursor: pointer;
  box-shadow: 0 14px 30px -12px rgba(34, 27, 29, .55);
  opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.2, .7, .2, 1), background-color .15s ease;
}
.back-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover { background: var(--brand); }
.back-to-top:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* Transition douce entre les pages (navigateurs compatibles) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
.site-header { view-transition-name: site-header; }
@media (min-width: 961px) { .sidebar { view-transition-name: admin-nav; } }
@media (max-width: 960px) { .admin-mobilebar { view-transition-name: admin-bar; } }

/* ============================================================
   Responsive
   ============================================================ */

/* Écrans tactiles : cibles d'au moins 44 px */
@media (pointer: coarse) {
  .btn, .btn-small, .btn-danger-outline, .tab, .lang-switch summary, .lang-menu a,
  .sidebar a.nav-item, .nav-links a.button { min-height: 44px; }
  .nav-links > a.nav-text { min-height: 44px; }
  .back-link, .site-footer a, .sidebar .sidebar-foot a,
  .panel-head a, .auth-card .muted a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* Tablette et mobile : menu admin en tiroir */
@media (max-width: 960px) {
  .admin-shell { display: block; }
  .admin-mobilebar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30;
    padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
    background: #23141A;
  }
  .admin-mobilebar .brand, .admin-mobilebar .brand:hover { color: #fff; font-size: 17px; }
  .menu-toggle, .menu-close {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px;
    background: transparent; color: #fff; cursor: pointer;
  }
  .menu-toggle { margin-left: -10px; }
  .menu-close { margin-right: -10px; }
  .menu-toggle:hover, .menu-close:hover { background: rgba(255, 255, 255, .08); }
  .menu-toggle:focus-visible, .menu-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  .menu-dot { position: absolute; top: 9px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px #23141A; }

  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; height: auto;
    width: min(300px, 86vw); min-width: 0;
    padding-top: max(24px, env(safe-area-inset-top)); padding-bottom: max(24px, env(safe-area-inset-bottom));
    transform: translateX(-100%); visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s;
  }
  .nav-open .sidebar { transform: none; visibility: visible; transition: transform .25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(20, 10, 13, .5); }
  .sidebar-backdrop[hidden] { display: none; }
  body.nav-open { overflow: hidden; }

  .admin-main { padding: 24px 20px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
}

/* Mobile */
@media (max-width: 768px) {
  .admin-main { padding: 20px 16px 32px; }
  .admin-topbar { margin-bottom: 18px; flex-wrap: nowrap; align-items: flex-start; }
  .admin-topbar:has(> .btn) { flex-wrap: wrap; }
  .admin-topbar > .btn { width: 100%; }
  .table-cards td[data-label] .cell-stack { align-items: flex-end; }
  .admin-user > div:last-child { display: none; }
  .kpi { padding: 16px; }
  .kpi-value { font-size: 22px; }
  .panel-head { padding: 14px 16px; gap: 4px 12px; flex-wrap: wrap; }
  .tabs { margin: 16px 0; }
  .tabs .tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; text-align: center; padding: 10px 12px; }

  .form-2col { grid-template-columns: 1fr; }
  .text-fields { grid-template-columns: 1fr; }
  .lang-bar { padding: 10px; }
  .lang-bar-list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .lang-pill { flex: 0 0 auto; }
  .admin-form { padding: 16px; }
  .form-actions .btn { flex: 1; }
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .filter-bar .tab { flex: 0 0 auto; }
  .field-check { margin-top: 0; }

  .confirmation { padding: 48px 20px; }
  .cards { margin-top: 32px; gap: 16px; padding-bottom: 48px; }
  .how-section, .faq-section { padding-left: 16px; padding-right: 16px; }
  #comment, #faq { scroll-margin-top: 72px; }
  .back-to-top { width: 46px; height: 46px; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
  .how-tabs { width: 100%; }
  .how-tabs [role="tab"] { flex: 1; padding: 0 12px; font-size: 14px; }
  .how-step { padding: 20px; }
  .faq-filters { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .faq-filter { flex: 0 0 auto; }
  .faq-item summary { padding: 16px; font-size: 15.5px; }
  .faq-answer { padding: 0 16px 18px; }
  .faq-contact { flex-direction: column; align-items: flex-start; }
  .faq-contact .btn { width: 100%; }
  .card { padding: 24px; }
}


/* Tableaux : une carte par ligne quand la place manque (largeur du panneau, pas de l'écran) */
.panel { container: panel / inline-size; }
@container panel (max-width: 840px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody { display: block; }
  .table-cards tr { display: block; padding: 14px 16px; }
  .table-cards tbody tr + tr { border-top: 1px solid var(--border); }
  .table-cards td { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 5px 0; text-align: right; white-space: normal; }
  .table-cards td[data-label]::before {
    content: attr(data-label); flex-shrink: 0; color: var(--subtle); font-size: 12.5px; font-weight: 600; text-align: left;
  }
  .table-cards td.cell-title { display: block; padding: 0 0 6px; text-align: left; font-size: 15px; font-weight: 700; }
  .table-cards td.cell-break { overflow-wrap: anywhere; }
  .table-cards td[colspan] { display: block; text-align: left; }
  .table-cards td.cell-actions { display: block; padding-top: 10px; }
  .table-cards td.cell-actions:not(:has(*)) { display: none; }
  .table-cards td.cell-empty { display: none; }
  .table-cards .row-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .table-cards .row-actions .btn { width: 100%; }

}

/* Petits téléphones */
@media (max-width: 400px) {
  .auth-body { padding: 16px; }
  .auth-card { padding: 24px 20px; border-radius: 16px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-label { font-size: 12px; }
  .card { padding: 20px; }
  .card .btn { align-self: stretch !important; }
  .hero { padding: 32px 16px 0; }
  .site-header { padding: 12px 16px; }
  .banner-wrap { padding: 0 16px; margin-top: 16px; }
  .cards { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  @view-transition { navigation: none; }
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: 0s !important; animation-delay: 0s !important; }
  .card:hover { transform: none; }
}

/* Interrupteur « Masquer le code », sous le champ code */
.mask-switch { position: relative; margin-top: 14px; }
.mask-switch .switch-input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; pointer-events: none; }
.mask-switch-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .18s ease, background-color .18s ease; }
.mask-switch-row:hover { border-color: #C6BCBE; }
.mask-switch-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none; border-radius: 11px; background: var(--surface); color: var(--text); }
.mask-switch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mask-switch-title { font-size: 14.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.mask-switch-desc { font-size: 13px; color: var(--muted); line-height: 1.4; }
.switch-track { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: #D9D3D4; transition: background-color .2s ease; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22), 0 1px 1px rgba(0,0,0,.08); transition: transform .2s cubic-bezier(.2,.7,.2,1); }
.switch-input:checked + .mask-switch-row .switch-track { background: var(--text); }
.switch-input:checked + .mask-switch-row .switch-thumb { transform: translateX(18px); }
.switch-input:focus-visible + .mask-switch-row { outline: 2px solid var(--text); outline-offset: 2px; }
@media (max-width: 420px) { .mask-switch-row { padding: 12px 14px; gap: 12px; } .mask-switch-icon { width: 34px; height: 34px; } }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-thumb, .mask-switch-row { transition: none; } }

/* Administration : code masqué à la demande du client */
.code-reveal summary { list-style: none; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; cursor: pointer; }
.code-reveal summary::-webkit-details-marker { display: none; }
.code-reveal .code-full, .code-reveal[open] .code-masked, .code-reveal .when-open, .code-reveal[open] .when-closed { display: none; }
.code-reveal[open] .code-full, .code-reveal[open] .when-open { display: inline-flex; }
.code-reveal .when-closed { display: inline-flex; }
.code-reveal-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--muted); flex: none; }
.code-reveal summary:hover .code-reveal-btn { color: var(--text); border-color: #C6BCBE; }
.code-reveal summary:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 8px; }
@media (pointer: coarse) { .code-reveal-btn { width: 40px; height: 40px; } }
.sidebar-version { display: block; padding: 10px 12px 0; font-size: 12px; color: rgba(255,255,255,.45); font-variant-numeric: tabular-nums; }
