/* =====================================================================
   assets/css/main.css
   Feuille de style commune à toutes les pages publiques.

   Direction : « billet vert ». Un vert profond pour la confiance, un
   jaune « pièce de monnaie » pour tout ce qui rapporte, des surfaces
   neutres et nettes. Titres en Schibsted Grotesk (serrés, affirmés),
   texte courant en Onest, chiffres tabulaires pour les montants.
   Les sélecteurs sont ceux utilisés par les gabarits PHP et le JS :
   ne pas les renommer sans mettre à jour les deux.
   ===================================================================== */

:root {
  /* Surfaces */
  --bg: #F3F4EF;
  --surface: #E9EBE4;
  --surface-raised: #FFFFFF;
  --line: #DCDFD6;
  --line-strong: #BFC4B8;

  /* Texte */
  --ink: #111611;
  --ink-2: #2A312A;
  --muted: #586057;
  --muted-2: #868D83;

  /* Marque */
  --brand: #0B6B4C;
  --brand-dark: #08523A;
  --brand-deep: #0D1F17;
  --brand-soft: #DCEDE4;
  --sun: #FFC83D;
  --sun-dark: #E5AC14;
  --sun-soft: #FFF2CC;

  /* Alias conservés pour compatibilité (anciens noms de variables) */
  --accent: var(--brand);
  --accent-dark: var(--brand-dark);
  --accent-soft: var(--brand-soft);

  /* États */
  --ok: #1D7442;
  --ok-soft: #DDF1E4;
  --bad: #B3261E;
  --bad-soft: #FBE4E1;
  --warn: #8A5A00;
  --warn-soft: #FFF0C7;

  /* Formes */
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 0 rgba(17, 22, 17, .04), 0 1px 3px rgba(17, 22, 17, .06);
  --shadow: 0 1px 0 rgba(17, 22, 17, .04), 0 8px 24px -12px rgba(17, 22, 17, .18);

  /* Typographie */
  --font-display: "Schibsted Grotesk", "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --ease: 160ms cubic-bezier(.2, .7, .3, 1);
  --max: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-dark); }

/* Chiffres : police du texte en chasse fixe, pas de monospace « code » */
.mono { font-family: var(--font-body); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: -.01em; }

img { max-width: 100%; display: block; }
code { font-family: var(--font-mono); font-size: .88em; }

::selection { background: var(--sun); color: var(--ink); }

.skip-link {
  position: absolute;
  left: -999px;
  top: .5rem;
  background: var(--ink);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 100;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { left: .5rem; color: #fff; }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  letter-spacing: -.025em;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.05; font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); line-height: 1.15; }
h3 { font-size: 1.08rem; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0; }

/* Petit libellé au-dessus des titres : une pastille, pas des capitales espacées */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .85rem;
  padding: .28rem .7rem .28rem .55rem;
  font: 600 .8rem/1 var(--font-body);
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 999px;
}
.eyebrow::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 2px var(--brand);
}

/* ---------- Structure ---------- */

.main { flex: 1 0 auto; min-height: 60vh; }
.wrap { max-width: var(--max); margin: 0 auto; padding: clamp(1.75rem, 4vw, 3rem) var(--gutter) 4.5rem; }
.wrap-narrow { max-width: 32rem; padding-top: clamp(2rem, 6vw, 4rem); }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }

.block { margin-top: 3rem; }
.block > h2 { margin-bottom: 1.25rem; }

.block-wide { margin-top: 0; padding: clamp(3rem, 7vw, 5.5rem) var(--gutter); }
.block-wide > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.block-wide > h2 { margin-bottom: 2rem; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.block-wide:nth-of-type(even) { background: var(--surface-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.block-wide .wrap { padding-left: 0; padding-right: 0; }

.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.block-wide > .block-head { margin-bottom: 2rem; }
.block-head h2 { margin: 0; }
.block-cta { margin-top: 1.75rem; }
.block-cta > a:not(.btn) { font-weight: 600; }

.link-more { font-size: .9rem; font-weight: 600; color: var(--brand); text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.link-more::after { content: "→"; transition: transform var(--ease); }
.link-more:hover { color: var(--brand-dark); }
.link-more:hover::after { transform: translateX(3px); }

.hint { font-size: .87rem; color: var(--muted); margin-top: .4rem; }
.hint a { font-weight: 600; }
.optional { font-weight: 400; color: var(--muted-2); font-size: .85rem; }

/* ---------- Barre du haut ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: .8rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  font: 800 1.15rem/1 var(--font-display);
  letter-spacing: -.03em;
  color: var(--ink);
  flex: none;
}
.brand:hover { color: var(--ink); }
/* Le logo : une pièce jaune cerclée de vert */
.brand-mark {
  position: relative;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: inset 0 0 0 3px var(--brand), inset 0 -3px 0 3px rgba(0, 0, 0, .08);
  flex: none;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: .38rem;
  height: .62rem;
  border-radius: 2px;
  background: var(--brand);
}

.nav { display: flex; gap: .25rem; flex: 1; font-size: .93rem; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  padding: .5rem .8rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: color var(--ease), background var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a.is-active { color: var(--brand-dark); background: var(--brand-soft); font-weight: 600; }

.topbar-user { display: flex; align-items: center; gap: .6rem; margin-left: auto; flex: none; }
.topbar-balance {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .9rem;
  font-weight: 700;
  padding: .45rem .8rem .45rem .5rem;
  color: var(--ink);
  background: var(--sun-soft);
  border: 1px solid #F3DB93;
  border-radius: 999px;
  white-space: nowrap;
}
.topbar-balance::before {
  content: "";
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: inset 0 0 0 2px var(--sun-dark);
  flex: none;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.2rem;
  font: 600 .94rem/1.1 var(--font-body);
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease), background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease), opacity var(--ease);
}
.btn:hover { color: var(--ink); border-color: var(--ink-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn[disabled], .btn:disabled { opacity: .5; pointer-events: none; box-shadow: none; }

.btn-primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand-dark);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18), 0 6px 16px -8px rgba(11, 107, 76, .7);
}
.btn-primary:hover { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-quiet { background: var(--surface-raised); }
.btn-quiet:hover { background: #fff; }
.btn-small { padding: .45rem .8rem; font-size: .84rem; border-radius: var(--radius-sm); }
.btn-large { padding: .95rem 1.5rem; font-size: 1.02rem; border-radius: 12px; }
.btn-block { width: 100%; }

/* ---------- Messages ---------- */

.notice {
  position: relative;
  padding: .95rem 1.15rem .95rem 2.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink-2);
  font-size: .94rem;
  line-height: 1.55;
  margin-bottom: 1.5rem;
}
.notice::before {
  content: "i";
  position: absolute;
  left: 1rem;
  top: .95rem;
  width: 1.3rem;
  height: 1.3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font: 700 .78rem/1 var(--font-display);
  color: #fff;
  background: var(--muted);
}
.notice a { color: inherit; font-weight: 600; }
.notice-info { background: var(--surface-raised); }
.notice-ok { border-color: #A9D8B9; background: var(--ok-soft); color: #0F4526; }
.notice-ok::before { content: "✓"; background: var(--ok); }
.notice-bad { border-color: #F0B4AD; background: var(--bad-soft); color: #7A1610; }
.notice-bad::before { content: "!"; background: var(--bad); }
.notice-warn { border-color: #EFD17E; background: var(--warn-soft); color: #5E3E00; }
.notice-warn::before { content: "!"; background: var(--warn); }
.notice-page { max-width: calc(var(--max) - 2 * var(--gutter)); margin: 1.5rem auto 0; }
@media (max-width: 76rem) { .notice-page { margin-left: var(--gutter); margin-right: var(--gutter); } }

/* ---------- Formulaires ---------- */

.form { display: flex; flex-direction: column; gap: 1.2rem; }
.panel {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}

.field { display: flex; flex-direction: column; gap: .45rem; }
.field-row { display: flex; gap: 1rem; }
.field-row .grow { flex: 1 1 0; min-width: 0; }
.field-trap { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
legend { font-weight: 700; font-size: .95rem; color: var(--ink); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="url"], input[type="tel"], select, textarea {
  width: 100%;
  padding: .75rem .9rem;
  background: #fff;
  color: var(--ink);
  font: 400 1rem/1.4 var(--font-body);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 2px rgba(17, 22, 17, .04);
  transition: border-color var(--ease), box-shadow var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
input:hover, textarea:hover, select:hover { border-color: var(--muted-2); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(11, 107, 76, .14);
}
textarea { resize: vertical; min-height: 8rem; }
input.mono { font-family: var(--font-mono); font-size: .92rem; letter-spacing: 0; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(179, 38, 30, .1); }
input[readonly] { background: var(--bg); }

.field-error { margin: 0; font-size: .85rem; font-weight: 500; color: var(--bad); }
.field-error:empty { display: none; }

.strength { display: flex; flex-direction: column; align-items: stretch; gap: .35rem; font-size: .8rem; color: var(--muted); margin-top: .1rem; }
.strength-bar { width: 100%; height: 6px; background: var(--surface); border-radius: 999px; overflow: hidden; }
.strength-bar span { display: block; height: 100%; width: 0; background: var(--bad); border-radius: inherit; transition: width var(--ease), background var(--ease); }
.strength[data-level="1"] .strength-bar span { width: 20%; background: var(--bad); }
.strength[data-level="2"] .strength-bar span { width: 45%; background: var(--sun-dark); }
.strength[data-level="3"] .strength-bar span { width: 72%; background: var(--ok); }
.strength[data-level="4"] .strength-bar span { width: 100%; background: var(--ok); }
.strength-label { line-height: 1.3; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Choix stylisés (méthode de retrait, montant) */
.choice-group { display: flex; flex-direction: column; gap: .6rem; }
.choice-group legend { padding: 0 0 .55rem; }
.choice { position: relative; display: block; cursor: pointer; font-weight: 400; }
.choice > input { position: absolute; opacity: 0; pointer-events: none; }

/* Champ « Montant précis » placé dans une carte de choix (page Retrait) */
.amount-input { display: flex !important; align-items: center; gap: .6rem; margin-top: .45rem; }
.amount-input input { width: 100%; max-width: 12rem; font-variant-numeric: tabular-nums; }
.amount-input input:disabled { background: var(--surface); color: var(--muted-2); cursor: not-allowed; }
.choice-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .9rem 1rem .9rem 2.9rem;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color var(--ease), background var(--ease), box-shadow var(--ease);
}
/* Pastille radio dessinée */
.choice-body::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 1.05rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: #fff;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.choice-body strong { font-weight: 600; color: var(--ink); }
.choice-body > span:not(:first-child) { font-size: .87rem; color: var(--muted); font-weight: 400; }
.choice:hover .choice-body { border-color: var(--muted); }
.choice input:checked + .choice-body { border-color: var(--brand); background: #F6FBF8; box-shadow: 0 0 0 1px var(--brand); }
.choice input:checked + .choice-body::before { border-color: var(--brand); box-shadow: inset 0 0 0 3px #fff; background: var(--brand); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--sun); outline-offset: 2px; }

/* ---------- FAQ ---------- */

.accordion { display: flex; flex-direction: column; gap: .6rem; }
.accordion-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  padding: 0 1.25rem;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.accordion-item[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.accordion-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 2.2rem 1.1rem 0;
  font-weight: 600;
  font-size: 1.01rem;
  position: relative;
}
.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item summary::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: -.8rem;
  border-radius: 50%;
  background: var(--surface) no-repeat center / 10px 10px;
  background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink));
  background-size: 10px 2px, 2px 10px;
  transition: transform var(--ease), background-color var(--ease);
}
.accordion-item[open] summary::after { transform: rotate(45deg); background-color: var(--sun); }
.accordion-item p { padding: 0 0 1.2rem; color: var(--muted); font-size: .96rem; line-height: 1.65; max-width: 62ch; }

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

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}
.data-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.data-table th, .data-table td { padding: .85rem 1.1rem; text-align: left; white-space: nowrap; }
.data-table th {
  font: 600 .78rem/1 var(--font-body);
  color: var(--muted);
  background: #FAFBF8;
  border-bottom: 1px solid var(--line);
}
.data-table tbody tr + tr td { border-top: 1px solid var(--line); }
.data-table tbody tr:hover td { background: #FAFBF8; }
.data-table td.mono { font-weight: 600; }
.align-right, .data-table th.align-right, .data-table td.align-right { text-align: right; }
.is-positive { color: var(--ok); }
.is-negative { color: var(--bad); }

.tag {
  display: inline-block;
  padding: .22rem .6rem;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
}
.tag-offer { color: var(--brand-dark); background: var(--brand-soft); }
.tag-bonus { color: #6B4A00; background: var(--sun-soft); }
.tag-referral { color: #26448F; background: #E3EAFB; }
.tag-withdrawal { color: var(--bad); background: var(--bad-soft); }
.tag-adjust { color: var(--muted); background: var(--surface); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}
.status-pill::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.status-pending { background: var(--warn-soft); color: var(--warn); }
.status-processing { background: #E3EAFB; color: #26448F; }
.status-paid { background: var(--ok-soft); color: var(--ok); }
.status-rejected { background: var(--bad-soft); color: var(--bad); }

/* ---------- Cartes d'offres (accueil et page Offres) ---------- */

.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.offer-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: 1.1rem;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.offer-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.offer-icon { width: 3rem; height: 3rem; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface); border: 1px solid var(--line); }
.offer-icon-placeholder {
  display: block;
  background:
    radial-gradient(circle at 50% 50%, var(--sun) 0 38%, transparent 39%),
    var(--brand-soft);
}
.offer-body { flex: 1; min-width: 0; }
.offer-name { font: 600 .98rem/1.3 var(--font-body); letter-spacing: -.005em; margin: 0 0 .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer-description { margin: 0 0 .5rem; font-size: .84rem; line-height: 1.45; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.offer-tag { display: inline-block; font-size: .74rem; font-weight: 600; color: var(--muted); background: var(--surface); padding: .18rem .55rem; border-radius: 6px; }
.offer-side { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; flex: none; }
.offer-points {
  font-weight: 700;
  font-size: .92rem;
  color: var(--ink);
  background: var(--sun);
  padding: .28rem .6rem;
  border-radius: 8px;
  white-space: nowrap;
}
.offer-usd { font-size: .78rem; color: var(--muted); }

/* Aperçu sur l'accueil : cartes un peu plus aérées */
.offer-grid-preview { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.offer-card-preview { align-items: center; }

/* ---------- Toasts ---------- */

.toast-stack { position: fixed; right: 1.25rem; bottom: 1.25rem; display: flex; flex-direction: column; gap: .6rem; z-index: 60; max-width: min(22rem, calc(100vw - 2.5rem)); }
.toast {
  background: var(--brand-deep);
  color: #fff;
  padding: .9rem 1.1rem;
  border-radius: 12px;
  font-size: .9rem;
  line-height: 1.45;
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, .45);
  border-left: 4px solid var(--sun);
  animation: toast-in 220ms cubic-bezier(.2, .7, .3, 1);
}
.toast strong { color: var(--sun); font-weight: 700; }
.toast.is-leaving { animation: toast-out 200ms ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* Chargement */
.skeleton {
  height: 1rem;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface) 25%, #F6F7F3 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Connexion / inscription ---------- */

.page-login .wrap-narrow, .page-register .wrap-narrow { max-width: 30rem; }
.page-login .form, .page-register .form {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: var(--shadow);
}
.auth-head { margin-bottom: 1.5rem; }
.auth-head h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); }
.auth-switch { margin-top: 1.5rem; text-align: center; font-size: .94rem; color: var(--muted); }
.auth-switch a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ---------- Accueil : hero ---------- */

.page-index .main { overflow-x: clip; }
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.75rem, 7vw, 5.5rem) var(--gutter) clamp(3rem, 7vw, 5.5rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.hero-copy h1 { font-size: clamp(2.3rem, 5vw, 3.7rem); line-height: 1.02; letter-spacing: -.04em; max-width: 16ch; text-wrap: balance; }
.hero-lede { margin-top: 1.25rem; max-width: 34rem; font-size: 1.12rem; line-height: 1.6; color: var(--muted); }
.hero-actions { display: flex; gap: .75rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1.5rem;
  font-size: .88rem;
  color: var(--muted);
}

.hero-figure { position: relative; display: flex; justify-content: center; padding: 1.5rem 0; }
/* Grosse pièce décorative derrière la carte */
.hero-figure::before {
  content: "";
  position: absolute;
  width: min(19rem, 70%);
  aspect-ratio: 1;
  right: -2%;
  top: -4%;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: inset 0 0 0 14px var(--sun-dark), inset 0 0 0 16px rgba(255, 255, 255, .5);
}
.hero-figure::after {
  content: "";
  position: absolute;
  width: 5.5rem;
  aspect-ratio: 1;
  left: 4%;
  bottom: 2%;
  border-radius: 50%;
  border: 2px dashed var(--line-strong);
}

/* La « carte portefeuille » */
.ledger-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 22rem;
  background: var(--brand-deep);
  color: #E8EFEA;
  border-radius: 20px;
  padding: 1.6rem 1.5rem 1.3rem;
  transform: rotate(-2.5deg);
  box-shadow: 0 30px 60px -24px rgba(13, 31, 23, .6), 0 2px 0 rgba(255, 255, 255, .06) inset;
}
.ledger-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; padding: .35rem 0; }
.ledger-row:first-child { font-size: .85rem; color: #A9BDB2; align-items: baseline; }
.ledger-row:first-child .mono { font-size: 1.9rem; font-weight: 700; color: #fff; letter-spacing: -.03em; }
.ledger-row-muted { color: var(--sun); font-size: .85rem; font-weight: 600; padding-top: 0; }
.ledger-bar { height: 8px; background: rgba(255, 255, 255, .1); border-radius: 999px; margin: 1rem 0 1rem; overflow: hidden; }
.ledger-bar span { display: block; height: 100%; background: var(--sun); border-radius: inherit; }
.ledger-row-small {
  font-size: .86rem;
  color: #C9D6CF;
  padding: .6rem 0;
  border-top: 1px dashed rgba(255, 255, 255, .14);
}
.ledger-row-small .mono { color: #7FE0AE; font-weight: 700; }

/* ---------- Accueil : comment ça marche ---------- */

.timeline { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; counter-reset: none; }
.timeline li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.5rem 1.4rem 1.6rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 2.6rem;
  right: -1rem;
  width: 1rem;
  height: 2px;
  background: var(--line-strong);
}
.timeline-num {
  font: 800 1rem/1 var(--font-display);
  color: var(--ink);
  background: var(--sun);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 3px var(--sun-dark);
}
.timeline h3 { margin-bottom: .35rem; font-size: 1.15rem; }
.timeline p { color: var(--muted); font-size: .95rem; line-height: 1.55; }

/* ---------- Accueil : paiements récents ---------- */

.payout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .8rem; margin-top: 0; margin-bottom: 1rem; }
.payout-card {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.payout-card::after {
  content: "Payé";
  position: absolute;
  top: .9rem;
  right: .9rem;
  font-size: .7rem;
  font-weight: 700;
  color: var(--ok);
  background: var(--ok-soft);
  padding: .15rem .45rem;
  border-radius: 999px;
}
.payout-method { font-size: .82rem; font-weight: 600; color: var(--muted); }
.payout-amount { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }
.payout-date { font-size: .8rem; color: var(--muted-2); }

/* ---------- Pied de page ---------- */

.site-footer { flex-shrink: 0; background: var(--brand-deep); color: #A9BDB2; padding: 2rem var(--gutter); margin-top: 0; }
.site-footer-inner { max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; font-size: .88rem; }
.site-footer-links { display: flex; gap: 1.4rem; }
.site-footer-links a { text-decoration: none; color: #E8EFEA; font-weight: 500; }
.site-footer-links a:hover { color: var(--sun); }

/* ---------- Page support ---------- */

.page-support .wrap-narrow { max-width: 40rem; }

/* ---------- Petits écrans ---------- */

@media (max-width: 960px) {
  .topbar-inner { flex-wrap: wrap; gap: .75rem 1rem; padding-top: .7rem; padding-bottom: 0; }
  .nav {
    order: 3;
    flex-basis: calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter));
    padding: .35rem var(--gutter) .6rem;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--line);
  }
  .nav::-webkit-scrollbar { display: none; }
  .topbar-user { padding-bottom: .1rem; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-figure { order: 2; padding: 1.5rem .5rem .5rem; }
  .hero-figure::before { width: 12rem; right: 4%; }
  .timeline { grid-template-columns: 1fr; }
  .timeline li:not(:last-child)::after { top: auto; bottom: -1rem; right: auto; left: 2.6rem; width: 2px; height: 1rem; }
  .field-row { flex-direction: column; }
}

@media (max-width: 520px) {
  body { font-size: 15px; }
  .topbar-user .btn-small { padding: .42rem .65rem; font-size: .8rem; }
  .brand { font-size: 1.02rem; }
  .hero-actions .btn { width: 100%; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
