/* ==========================================================================
   ATS Community — système de design
   Mobile d'abord. Aucun élément ne doit jamais dépasser de l'écran.
   ========================================================================== */

:root {
  --brand:        #0F766E;
  --brand-600:    #0D9488;
  --brand-700:    #115E59;
  --brand-050:    #ECFDF5;
  --brand-100:    #CCFBF1;

  --accent:       #F59E0B;
  --accent-050:   #FFFBEB;

  --ink:          #0B1220;
  --ink-2:        #26334A;
  --muted:        #5B6676;
  --faint:        #8A94A6;
  --line:         #E4E9F0;
  --line-2:       #EFF3F8;
  --surface:      #FFFFFF;
  --surface-2:    #F9FBFD;
  --bg:           #F4F7FA;

  --success:      #15803D;
  --success-bg:   #ECFDF3;
  --danger:       #DC2626;
  --danger-bg:    #FEF2F2;
  --warn:         #B45309;
  --warn-bg:      #FFFBEB;
  --info:         #1D4ED8;
  --info-bg:      #EFF6FF;

  --r-xs: 8px;
  --r-sm: 12px;
  --r:    16px;
  --r-lg: 22px;
  --r-full: 999px;

  --sh-1: 0 1px 2px rgba(11,18,32,.06), 0 1px 3px rgba(11,18,32,.04);
  --sh-2: 0 4px 12px rgba(11,18,32,.07), 0 2px 4px rgba(11,18,32,.04);
  --sh-3: 0 12px 32px rgba(11,18,32,.12), 0 4px 8px rgba(11,18,32,.05);
  --sh-brand: 0 6px 20px rgba(15,118,110,.28);

  --nav-h: 62px;
  --top-h: 58px;
  --wrap: 1180px;

  --ease: cubic-bezier(.22,.9,.28,1);
  --fast: .18s var(--ease);
  --slow: .34s var(--ease);
}

/* ------------------------------------------------------------------ Reset */

*, *::before, *::after { box-sizing: border-box; }
* { min-width: 0; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
p { margin: 0 0 .75em; }
ul, ol { margin: 0; padding-left: 1.1rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

::selection { background: var(--brand-100); color: var(--brand-700); }

:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --------------------------------------------------------------- Layout */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 16px;
}

.page { padding-block: 18px 28px; }
.page--tight { padding-block: 12px 24px; }

/* Réserve la place de la barre d'onglets mobile + encoche iOS */
.has-tabbar { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); }

.stack   { display: grid; gap: 14px; }
.stack-s { display: grid; gap: 8px; }
.stack-l { display: grid; gap: 22px; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row--between { justify-content: space-between; }
.row--tight { gap: 6px; }
.row--nowrap { flex-wrap: nowrap; }
.spacer { flex: 1 1 auto; }

.grid { display: grid; gap: 12px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

@media (min-width: 720px) {
  .wrap { padding-inline: 24px; }
  body { font-size: 15.5px; }
  .grid--2\@d { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3\@d { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .grid--4\@l { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
}

/* ------------------------------------------------------------- Typographie */

.h1 { font-size: clamp(22px, 5.2vw, 30px); }
.h2 { font-size: clamp(18px, 4.2vw, 22px); }
.h3 { font-size: 16px; font-weight: 700; }
.lead { font-size: clamp(15px, 3.6vw, 17px); color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.strong { font-weight: 700; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.money--gain { color: var(--success); }
.money--cost { color: var(--ink-2); }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
}

/* -------------------------------------------------------------- Surfaces */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--sh-1);
}
.card--flat { box-shadow: none; }
.card--pad-0 { padding: 0; overflow: hidden; }
.card--brand {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--sh-brand);
}
.card--brand .muted, .card--brand .eyebrow { color: rgba(255,255,255,.78); }

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
}

/* ---------------------------------------------------------------- Boutons */

.btn {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-full);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 650;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
  transition: transform var(--fast), box-shadow var(--fast), background var(--fast), opacity var(--fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { color: var(--btn-fg); box-shadow: var(--sh-2); }
.btn:active { transform: scale(.975); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn--primary { --btn-bg: var(--brand); box-shadow: var(--sh-brand); }
.btn--primary:hover { --btn-bg: var(--brand-700); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line); }
.btn--ghost:hover { --btn-bg: var(--surface-2); }
.btn--soft { --btn-bg: var(--brand-050); --btn-fg: var(--brand-700); }
.btn--dark { --btn-bg: var(--ink); }
.btn--danger { --btn-bg: var(--danger); }
.btn--wa { --btn-bg: #25D366; --btn-fg: #06301A; font-weight: 700; }
.btn--wa:hover { --btn-bg: #1FBE5B; }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 8px 14px; font-size: 13.5px; }
.btn--lg { min-height: 54px; padding: 15px 26px; font-size: 16.5px; }
.btn--icon { padding: 0; width: 42px; min-height: 42px; border-radius: var(--r-full); }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-group--fill > .btn { flex: 1 1 140px; }

/* --------------------------------------------------------------- Formulaire */

.field { display: grid; gap: 6px; }
.field > label, .label {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-2);
}
.label__hint { font-weight: 400; color: var(--faint); }

.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color var(--fast), box-shadow var(--fast);
  appearance: none;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 4px rgba(13,148,136,.13);
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%235B6676' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.input--money { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 17px; }

.input-group { display: flex; align-items: stretch; gap: 0; }
.input-group .input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group__suffix {
  display: grid;
  place-items: center;
  padding-inline: 14px;
  border: 1.5px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
}

.field__error { color: var(--danger); font-size: 13px; font-weight: 600; }
.field--invalid .input, .field--invalid .select { border-color: var(--danger); }

/* Code PIN */
.pin {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.pin__box {
  width: 58px;
  height: 66px;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
  transition: border-color var(--fast), transform var(--fast);
}
.pin__box:focus { border-color: var(--brand); transform: translateY(-2px); outline: none; }
.pin__box.is-filled { border-color: var(--brand-600); background: var(--brand-050); }

/* Choix en cartes (radio) */
.choice {
  display: grid;
  gap: 8px;
}
.choice__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast), transform var(--fast);
}
.choice__item:active { transform: scale(.99); }
.choice__item input { position: absolute; opacity: 0; pointer-events: none; }
.choice__item:has(input:checked) {
  border-color: var(--brand-600);
  background: var(--brand-050);
  box-shadow: 0 0 0 3px rgba(13,148,136,.10);
}
.choice__dot {
  width: 20px; height: 20px;
  border: 2px solid var(--line);
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid; place-items: center;
  transition: border-color var(--fast);
}
.choice__item:has(input:checked) .choice__dot { border-color: var(--brand); }
.choice__item:has(input:checked) .choice__dot::after {
  content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--brand);
  animation: pop .22s var(--ease);
}
.choice__body { flex: 1 1 auto; min-width: 0; }
.choice__title { font-weight: 650; font-size: 14.5px; }
.choice__meta { font-size: 12.5px; color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch__track {
  width: 46px; height: 27px; border-radius: var(--r-full);
  background: var(--line); position: relative; transition: background var(--fast);
  flex: 0 0 auto;
}
.switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%; background: #fff;
  box-shadow: var(--sh-1); transition: transform var(--fast);
}
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(19px); }

/* --------------------------------------------------------------- Badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--r-full);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--line-2);
  color: var(--ink-2);
}
.badge__icon { font-size: 12px; }
.badge--brand   { background: var(--brand-050); color: var(--brand-700); }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--danger  { background: var(--danger-bg); color: var(--danger); }
.badge--warn    { background: var(--warn-bg); color: var(--warn); }
.badge--info    { background: var(--info-bg); color: var(--info); }
.badge--accent  { background: var(--accent-050); color: #92400E; }
.badge--dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.badge--live::before { animation: pulse 1.8s infinite; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--fast);
  cursor: pointer;
}
.chip:hover { border-color: var(--brand-600); color: var(--brand-700); }
.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: var(--sh-brand);
}

/* Rangée de filtres qui défile sans jamais élargir la page */
.chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 16px 6px;
  margin-inline: -16px;
  scroll-snap-type: x proximity;
}
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll > * { scroll-snap-align: start; flex: 0 0 auto; }

/* ------------------------------------------------------------- En-tête app */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--top-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 16.5px;
  color: var(--ink);
  letter-spacing: -.02em;
}
.brand__mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  box-shadow: var(--sh-brand);
  flex: 0 0 auto;
}

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background var(--fast);
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn__dot {
  position: absolute; top: 6px; right: 6px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-050);
  color: var(--brand-700);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  flex: 0 0 auto;
}
.avatar--lg { width: 56px; height: 56px; font-size: 18px; }

/* Navigation bureau */
.topnav { display: none; }
@media (min-width: 860px) {
  .topnav { display: flex; gap: 4px; margin-left: 10px; }
  .topnav a {
    padding: 9px 14px;
    border-radius: var(--r-full);
    font-weight: 600;
    font-size: 14.5px;
    color: var(--muted);
    transition: all var(--fast);
  }
  .topnav a:hover { background: var(--surface-2); color: var(--ink); }
  .topnav a.is-active { background: var(--brand-050); color: var(--brand-700); }
}

/* Barre d'onglets mobile */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 860px) { .tabbar { display: none; } .has-tabbar { padding-bottom: 32px; } }

.tabbar__item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  height: var(--nav-h);
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 650;
  position: relative;
  transition: color var(--fast);
}
.tabbar__item.is-active { color: var(--brand); }
.tabbar__item.is-active .tabbar__icon { transform: translateY(-2px); }
.tabbar__icon { transition: transform var(--fast); position: relative; }
.tabbar__badge {
  position: absolute; top: -4px; right: -9px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}

/* ------------------------------------------------------------- Annonce */

.announce {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  background: var(--info-bg);
  color: var(--info);
  border-bottom: 1px solid var(--line);
}
.announce--promotion   { background: var(--success-bg); color: var(--success); }
.announce--urgence     { background: var(--danger-bg); color: var(--danger); }
.announce--maintenance { background: var(--warn-bg); color: var(--warn); }
.announce__icon { flex: 0 0 auto; }
.announce__viewport { flex: 1 1 auto; overflow: hidden; }
.announce__track {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 26s linear infinite;
  padding-left: 100%;
}
.announce:hover .announce__track { animation-play-state: paused; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* --------------------------------------------------------- Cartes statistiques */

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: var(--sh-1);
  position: relative;
  overflow: hidden;
  transition: transform var(--fast), box-shadow var(--fast);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.stat::after {
  content: '';
  position: absolute; inset: auto -20px -30px auto;
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--brand-050);
  opacity: .55;
}
.stat > * { position: relative; }
.stat__label { font-size: 12px; font-weight: 650; color: var(--muted); }
.stat__value {
  font-size: clamp(19px, 5vw, 25px);
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.stat__meta { font-size: 12px; color: var(--faint); margin-top: 2px; }
.stat__icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
  font-size: 16px; margin-bottom: 8px;
}
.stat--gain .stat__value { color: var(--success); }
.stat--gain .stat__icon  { background: var(--success-bg); color: var(--success); }
.stat--gain::after { background: var(--success-bg); }
.stat--warn .stat__icon  { background: var(--warn-bg); color: var(--warn); }
.stat--warn::after { background: var(--warn-bg); }
.stat--info .stat__icon  { background: var(--info-bg); color: var(--info); }
.stat--info::after { background: var(--info-bg); }

/* --------------------------------------------------------------- Produits */

.products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 640px)  { .products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1000px) { .products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }

.product {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-1);
  transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast);
  color: inherit;
  position: relative;
}
.product:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-3);
  border-color: var(--brand-100);
  color: inherit;
}
.product__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  overflow: hidden;
}
.product__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.product:hover .product__media img { transform: scale(1.06); }
.product__media--empty {
  display: grid; place-items: center;
  color: var(--faint); font-size: 28px;
}
.product__flags {
  position: absolute; top: 8px; left: 8px;
  display: flex; flex-direction: column; gap: 5px;
  max-width: calc(100% - 16px);
}
.product__fav {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.92);
  box-shadow: var(--sh-1);
  display: grid; place-items: center;
  cursor: pointer;
  font-size: 15px;
  transition: transform var(--fast);
}
.product__fav:active { transform: scale(.88); }
.product__body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 5px; flex: 1 1 auto; }
.product__name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.7em;
}
.product__price { font-size: 16.5px; font-weight: 800; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.product__loc {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Fiche produit */
.gallery { display: grid; gap: 10px; }
.gallery__main {
  aspect-ratio: 1 / 1;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  position: relative;
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.gallery__thumbs::-webkit-scrollbar { display: none; }
.gallery__thumb {
  width: 62px; height: 62px;
  flex: 0 0 auto;
  border-radius: var(--r-xs);
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--surface-2);
  cursor: pointer;
  padding: 0;
  transition: border-color var(--fast);
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb.is-active { border-color: var(--brand); }
.gallery__counter {
  position: absolute; bottom: 10px; right: 10px;
  padding: 3px 10px; border-radius: var(--r-full);
  background: rgba(11,18,32,.65); color: #fff;
  font-size: 12px; font-weight: 600;
}

.price-box {
  background: var(--brand-050);
  border: 1px solid var(--brand-100);
  border-radius: var(--r);
  padding: 14px;
}
.price-box__value { font-size: 26px; font-weight: 800; color: var(--brand-700); letter-spacing: -.02em; }

.margin-live {
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--success-bg);
  color: var(--success);
  font-weight: 700;
  transition: background var(--slow);
}
.margin-live.is-negative { background: var(--danger-bg); color: var(--danger); }
.margin-live__value { font-size: 21px; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- Listes */

.list { display: grid; gap: 10px; }

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  transition: transform var(--fast), box-shadow var(--fast);
  color: inherit;
}
a.item:hover { transform: translateY(-2px); box-shadow: var(--sh-2); color: inherit; }
.item__media {
  width: 52px; height: 52px;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--surface-2);
  flex: 0 0 auto;
  display: grid; place-items: center;
  color: var(--faint);
}
.item__media img { width: 100%; height: 100%; object-fit: cover; }
.item__body { flex: 1 1 auto; min-width: 0; }
.item__title { font-weight: 650; font-size: 14.5px; }
.item__meta { font-size: 12.5px; color: var(--muted); }
.item__side { text-align: right; flex: 0 0 auto; }

/* Ligne de panier */
.cart-line {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
}
.cart-line__media { aspect-ratio: 1; border-radius: var(--r-xs); overflow: hidden; background: var(--surface-2); }
.cart-line__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }

.qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--surface);
}
.qty button {
  width: 38px; height: 40px;
  border: 0; background: transparent;
  font-size: 18px; font-weight: 700; color: var(--ink-2);
  cursor: pointer;
  transition: background var(--fast);
}
.qty button:hover { background: var(--surface-2); }
.qty input {
  width: 46px; height: 40px;
  border: 0; text-align: center;
  font-weight: 700; font-variant-numeric: tabular-nums;
  background: transparent;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Récapitulatif */
.summary { display: grid; gap: 9px; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.summary__row--total {
  border-top: 1px dashed var(--line);
  padding-top: 11px;
  font-size: 17px;
  font-weight: 800;
}
.summary__row--gain { color: var(--success); font-weight: 700; }

/* --------------------------------------------------------------- Timeline */

.timeline { display: grid; gap: 0; }
.tl-step {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  position: relative;
  padding-bottom: 18px;
}
.tl-step:last-child { padding-bottom: 0; }
.tl-step::before {
  content: '';
  position: absolute;
  left: 14px; top: 30px; bottom: 0;
  width: 2px;
  background: var(--line);
}
.tl-step:last-child::before { display: none; }
.tl-step__dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--line-2);
  color: var(--faint);
  font-size: 13px;
  border: 2px solid var(--surface);
  z-index: 1;
}
.tl-step.is-done .tl-step__dot { background: var(--brand-050); color: var(--brand-700); }
.tl-step.is-current .tl-step__dot {
  background: var(--brand); color: #fff;
  box-shadow: 0 0 0 4px rgba(13,148,136,.16);
  animation: pulse-ring 2s infinite;
}
.tl-step.is-done::before { background: var(--brand-100); }
.tl-step__title { font-weight: 650; font-size: 14.5px; }
.tl-step.is-current .tl-step__title { color: var(--brand-700); }
.tl-step__meta { font-size: 12.5px; color: var(--muted); }

/* -------------------------------------------------------------- Progression */

.progress {
  height: 10px;
  border-radius: var(--r-full);
  background: var(--line-2);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--brand-600), var(--brand));
  width: 0;
  transition: width 1.1s var(--ease);
  position: relative;
  overflow: hidden;
}
.progress__bar::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
  animation: shimmer 2.2s infinite;
}
.progress--gain .progress__bar { background: linear-gradient(90deg, #22C55E, var(--success)); }
.progress--accent .progress__bar { background: linear-gradient(90deg, #FBBF24, var(--accent)); }
.progress--done .progress__bar { background: linear-gradient(90deg, #22C55E, #15803D); }

.goal { display: grid; gap: 8px; }
.goal__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.goal__pct { font-weight: 800; font-variant-numeric: tabular-nums; }
.goal__msg {
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--surface-2);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  padding: 9px 12px;
}

/* ---------------------------------------------------------------- Tableaux */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.table-wrap::-webkit-scrollbar { height: 7px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

table.table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  white-space: nowrap;
}
.table th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--faint);
  background: var(--surface-2);
  position: sticky; top: 0;
}
.table tbody tr { transition: background var(--fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.wrap { white-space: normal; min-width: 180px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- Pagination */

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.pager a, .pager span {
  min-width: 40px; height: 40px;
  padding: 0 12px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 650;
  font-size: 14px;
  color: var(--ink-2);
  transition: all var(--fast);
}
.pager a:hover { border-color: var(--brand-600); color: var(--brand-700); }
.pager .is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .is-disabled { opacity: .4; pointer-events: none; }

/* ---------------------------------------------------------------- États */

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}
.empty__icon {
  width: 66px; height: 66px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 28px;
}

.alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 550;
  border: 1px solid transparent;
}
.alert--success { background: var(--success-bg); color: var(--success); border-color: #BBF7D0; }
.alert--danger  { background: var(--danger-bg); color: var(--danger); border-color: #FECACA; }
.alert--warn    { background: var(--warn-bg); color: var(--warn); border-color: #FDE68A; }
.alert--info    { background: var(--info-bg); color: var(--info); border-color: #BFDBFE; }

.toasts {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 90;
  display: grid; gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
@media (min-width: 860px) { .toasts { bottom: 24px; } }
.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--sh-3);
  animation: toast-in .3s var(--ease);
}
.toast--success { background: var(--success); }
.toast--danger { background: var(--danger); }

.skeleton {
  background: linear-gradient(90deg, var(--line-2) 25%, #F7F9FC 37%, var(--line-2) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
  border-radius: var(--r-xs);
}

/* -------------------------------------------------------------- Animations */

@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(13,148,136,.36); }
  70%  { box-shadow: 0 0 0 10px rgba(13,148,136,0); }
  100% { box-shadow: 0 0 0 0 rgba(13,148,136,0); }
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes skeleton { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.reveal { animation: fade-up .42s var(--ease) both; }
.reveal-1 { animation-delay: .04s; }
.reveal-2 { animation-delay: .09s; }
.reveal-3 { animation-delay: .14s; }
.reveal-4 { animation-delay: .19s; }
.reveal-5 { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------- Utilitaires */

.hide { display: none !important; }
@media (max-width: 639px)  { .hide\@m { display: none !important; } }
@media (min-width: 860px)  { .hide\@d { display: none !important; } }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.w-full { width: 100%; }
.sticky-cta {
  position: sticky;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px);
  z-index: 30;
}
@media (min-width: 860px) { .sticky-cta { bottom: 18px; } }

/* ============================================================ Page publique */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 88% -10%, rgba(245,158,11,.16), transparent 62%),
    linear-gradient(160deg, #0B3C38 0%, #0F766E 48%, #0D9488 100%);
  color: #fff;
  padding: 44px 0 52px;
}
.hero::after {
  content: '';
  position: absolute; left: -12%; bottom: -58%;
  width: 78%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255,255,255,.09), transparent 65%);
  border-radius: 50%;
}
.hero > * { position: relative; z-index: 1; }
.hero__title {
  font-size: clamp(28px, 8vw, 50px);
  line-height: 1.08;
  letter-spacing: -.03em;
  font-weight: 800;
  margin-bottom: 14px;
}
.hero__title em { font-style: normal; color: #FCD34D; }
.hero__sub {
  font-size: clamp(15px, 4vw, 19px);
  color: rgba(255,255,255,.9);
  max-width: 56ch;
  margin-bottom: 26px;
}
.hero__cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero__cta .btn--primary { --btn-bg: #FFFFFF; --btn-fg: var(--brand-700); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.hero__cta .btn--primary:hover { --btn-bg: #F0FDFA; }
.hero__cta .btn--ghost { --btn-fg: #fff; --btn-bd: rgba(255,255,255,.45); }
.hero__cta .btn--ghost:hover { --btn-bg: rgba(255,255,255,.12); }

.hero__badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-full);
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 12.5px; font-weight: 650;
}

.strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin-top: -26px;
  position: relative;
  z-index: 2;
  box-shadow: var(--sh-2);
}
@media (min-width: 720px) { .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.strip__cell { background: var(--surface); padding: 16px 14px; text-align: center; }
.strip__value {
  font-size: clamp(20px, 5vw, 27px);
  font-weight: 800;
  color: var(--brand-700);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.strip__label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Schéma du fonctionnement */
.flow {
  display: grid;
  gap: 10px;
  counter-reset: flow;
}
@media (min-width: 900px) {
  .flow { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
}
.flow__node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  transition: transform var(--fast), box-shadow var(--fast);
}
.flow__node:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
@media (min-width: 900px) {
  .flow__node { flex-direction: column; text-align: center; gap: 8px; padding: 18px 12px; }
}
.flow__icon {
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
  font-size: 19px;
}
.flow__node:nth-child(6) .flow__icon { background: var(--accent-050); color: #92400E; }
.flow__title { font-weight: 700; font-size: 14px; }
.flow__text { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.flow__node::after {
  content: '↓';
  position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%);
  color: var(--brand-100); font-size: 15px; font-weight: 700;
  z-index: 1;
}
.flow__node:last-child::after { display: none; }
@media (min-width: 900px) {
  .flow__node::after { content: '→'; left: auto; right: -13px; bottom: auto; top: 50%; transform: translateY(-50%); }
}

.feature {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  transition: transform var(--fast), box-shadow var(--fast);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.feature__icon {
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--brand-050); color: var(--brand-700);
}
.feature__title { font-weight: 700; font-size: 15px; margin-bottom: 3px; }
.feature__text { font-size: 13.5px; color: var(--muted); line-height: 1.5; }

.quote {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--sh-1);
  display: grid;
  gap: 12px;
}
.quote__stars { color: var(--accent); letter-spacing: 2px; font-size: 13px; }
.quote__text { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.quote__who { display: flex; align-items: center; gap: 10px; }
.quote__name { font-weight: 700; font-size: 14px; }
.quote__role { font-size: 12.5px; color: var(--muted); }

.cta-band {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
  color: #fff;
  border-radius: var(--r-lg);
  padding: 30px 22px;
  text-align: center;
  box-shadow: var(--sh-brand);
}
.cta-band h2 { font-size: clamp(20px, 5vw, 28px); margin-bottom: 8px; }
.cta-band p { color: rgba(255,255,255,.88); max-width: 48ch; margin-inline: auto; }

.site-foot {
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  margin-top: 34px;
  color: var(--muted);
  font-size: 13.5px;
}

@media print {
  .topbar, .tabbar, .announce, .no-print, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}
