/* ==========================================================================
   Goplus — jetons de marque et composants partagés
   Titres : Satoshi · Corps : Plus Jakarta Sans
   ========================================================================== */

:root {
  /* Orange de l'identité Goplus, repris du logo (dégradé chaud). */
  --brand-50: #fff4ec;
  --brand-100: #ffe4d3;
  --brand-200: #ffc4a5;
  --brand-300: #ff9d6c;
  --brand-400: #ff7a33;
  --brand-500: #ff5a00;
  --brand-600: #f24405;
  --brand-700: #c9330a;
  --brand-900: #7a1f06;

  --ink: #17110d;
  --ink-soft: #4b4139;
  --ink-muted: #857a71;
  --surface: #ffffff;
  --surface-warm: #fff8f4;
  --line: #f0e6df;

  --success: #12a150;
  --success-soft: #e8f8ee;
  --danger: #e5484d;
  --danger-soft: #fdeced;

  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow-card: 0 24px 60px -32px rgba(122, 31, 6, 0.45);
  --shadow-float: 0 18px 40px -20px rgba(122, 31, 6, 0.5);

  --font-display: "Satoshi", "Plus Jakarta Sans", ui-sans-serif, system-ui,
    -apple-system, "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface-warm);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
.font-display {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* --------------------------------------------------------------------------
   Fonds
   -------------------------------------------------------------------------- */

.brand-gradient {
  background: linear-gradient(145deg, #ff5a00 0%, #f24405 45%, #ff8a2b 100%);
}

/* Halo décoratif : rappelle le dégradé du logo sans alourdir le contenu. */
.brand-aura::before {
  content: "";
  position: fixed;
  inset: -40% -20% auto -20%;
  height: 70vh;
  background: radial-gradient(
    60% 60% at 50% 0%,
    rgba(255, 90, 0, 0.16) 0%,
    rgba(255, 138, 43, 0.06) 45%,
    transparent 72%
  );
  pointer-events: none;
  z-index: 0;
}

.brand-aura > * {
  position: relative;
  z-index: 1;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  box-shadow: var(--shadow-float);
}

.btn-primary:hover {
  box-shadow: 0 22px 44px -18px rgba(242, 68, 5, 0.65);
}

.btn-ghost {
  color: var(--ink-soft);
  background: #fff;
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--brand-200);
  color: var(--brand-700);
}

/* --------------------------------------------------------------------------
   Boutons de téléchargement (SVG officiels, hauteur normalisée)
   -------------------------------------------------------------------------- */

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-badges a {
  display: inline-flex;
  border-radius: 12px;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.store-badges a:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.store-badges img {
  height: 52px;
  width: auto;
  display: block;
}

@media (max-width: 420px) {
  .store-badges img {
    height: 46px;
  }
}

/* --------------------------------------------------------------------------
   Pictogramme d'état de paiement
   -------------------------------------------------------------------------- */

.status-badge {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-inline: auto;
  position: relative;
}

.status-badge.is-success {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.is-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-badge.is-pending {
  background: var(--brand-50);
  color: var(--brand-600);
}

/* Anneau pulsé : signale que la confirmation est encore en cours. */
.status-badge::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: badge-pulse 2.4s ease-out infinite;
}

@keyframes badge-pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.35;
  }
  70% {
    transform: scale(1.12);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.status-badge svg {
  width: 56px;
  height: 56px;
}

/* Tracé animé du pictogramme (coche / croix). */
.status-badge svg path,
.status-badge svg circle {
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  animation: draw-stroke 0.9s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.status-badge svg path:nth-child(2) {
  animation-delay: 0.18s;
}

@keyframes draw-stroke {
  to {
    stroke-dashoffset: 0;
  }
}

/* --------------------------------------------------------------------------
   Référence de transaction
   -------------------------------------------------------------------------- */

.reference-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-warm);
  border: 1px dashed var(--brand-200);
  text-align: left;
}

.reference-box code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Entrée en scène
   -------------------------------------------------------------------------- */

.rise {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.rise-1 {
  animation-delay: 0.06s;
}
.rise-2 {
  animation-delay: 0.14s;
}
.rise-3 {
  animation-delay: 0.22s;
}
.rise-4 {
  animation-delay: 0.3s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Respecte le réglage système : aucune animation imposée. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .rise {
    opacity: 1;
    transform: none;
  }

  .status-badge svg path,
  .status-badge svg circle {
    stroke-dashoffset: 0;
  }
}

/* ==========================================================================
   Documents contractuels (CGU) — pages /cgu/*
   Le HTML est produit par `src/services/legal.js` : toutes les classes sont
   préfixées `lg-` pour qu'aucune règle du site ne vienne le percuter.
   ========================================================================== */

.legal-doc {
  --lg-accent: var(--brand-600);
  --lg-accent-soft: var(--brand-50);
  --lg-accent-line: var(--brand-200);
}
.legal-doc[data-accent="violet"] {
  --lg-accent: #6d28d9;
  --lg-accent-soft: #f5f3ff;
  --lg-accent-line: #ddd6fe;
}
.legal-doc[data-accent="emerald"] {
  --lg-accent: #047857;
  --lg-accent-soft: #ecfdf5;
  --lg-accent-line: #a7f3d0;
}

/* ---- corps du document ---- */
.legal-body {
  font-size: 1.0125rem;
  line-height: 1.72;
  color: var(--ink-soft);
  max-width: 74ch;
}
.legal-body > *:first-child {
  margin-top: 0;
}

.lg-h2 {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3.2vw, 1.72rem);
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 3.25rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--lg-accent);
  scroll-margin-top: 5.5rem;
  text-wrap: balance;
}
.lg-h2:first-child {
  margin-top: 0;
}
.lg-h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.075rem;
  letter-spacing: -0.01em;
  color: var(--lg-accent);
  margin: 2rem 0 0.6rem;
  scroll-margin-top: 5.5rem;
}
.lg-h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
  margin: 1.4rem 0 0.4rem;
}

/* Ancre de partage : discrète, révélée au survol du titre. */
.lg-anchor {
  position: absolute;
  left: -1.15rem;
  color: var(--lg-accent-line);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.lg-h2:hover .lg-anchor,
.lg-anchor:focus-visible {
  opacity: 1;
}
@media (max-width: 1023px) {
  .lg-anchor {
    display: none;
  }
}

.lg-p {
  margin: 0 0 0.9rem;
}
.legal-body strong {
  font-weight: 600;
  color: var(--ink);
}
.legal-body em {
  font-style: italic;
}
.legal-body a {
  color: var(--lg-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.lg-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.86em;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}

/* Mention à renseigner avant mise en ligne : impossible à manquer. */
.lg-todo {
  background: #fff3c4;
  color: #7a5c00;
  border-radius: 4px;
  padding: 0.05em 0.3em;
  font-weight: 600;
  font-size: 0.94em;
}

.lg-ul,
.lg-ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}
.lg-ul {
  list-style: none;
  padding-left: 1.15rem;
}
.lg-ul > li {
  position: relative;
  padding-left: 0.9rem;
}
.lg-ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 2px;
  background: var(--lg-accent);
}
.lg-ol > li::marker {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--lg-accent);
}
.legal-body li {
  margin-bottom: 0.42rem;
}

/* Clause mise en exergue. */
.lg-note {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--lg-accent-soft);
  border-left: 3px solid var(--lg-accent);
  border-radius: 0 12px 12px 0;
}
.lg-note > *:last-child {
  margin-bottom: 0;
}

.lg-rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}
/* Le filet du titre suffit : celui qui le précède ferait doublon. */
.lg-rule:has(+ .lg-h2) {
  display: none;
}

.lg-tablewrap {
  margin: 1.4rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.lg-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.lg-table th {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--surface-warm);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.lg-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.lg-table tbody tr:last-child td {
  border-bottom: 0;
}
.lg-table td:first-child {
  color: var(--ink);
}

/* ---- table des matières ---- */
.legal-toc {
  font-size: 0.875rem;
  line-height: 1.4;
}
.legal-toc a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-left: 2px solid var(--line);
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.legal-toc a:hover {
  color: var(--ink);
  border-left-color: var(--lg-accent);
  background: var(--surface);
}
.legal-toc a.is-current {
  color: var(--lg-accent);
  border-left-color: var(--lg-accent);
  font-weight: 600;
}

/* ---- impression ---- */
@media print {
  .legal-no-print {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .legal-body {
    max-width: none;
    font-size: 10.5pt;
  }
  .lg-h2,
  .lg-h3,
  .lg-h4 {
    break-after: avoid;
  }
  .lg-note,
  .lg-tablewrap,
  .lg-table tr {
    break-inside: avoid;
  }
  .lg-todo {
    background: none;
    border: 1px solid #999;
  }
}
