/* ============================================================
   GUÉZÉ CASH — Design system
   Palette : nuit forestière + or monnayé + vert de croissance
   Display : Fraunces (personnalité, empreinte "billet/tampon")
   Body    : Work Sans (lisibilité mobile-first)
   Chiffres: Space Mono (compteurs de gains, précision)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Work+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* -- Couleurs : thème sombre (par défaut) -- */
  --ink-950: #0B1F1A;
  --ink-900: #102B24;
  --ink-800: #163A30;
  --ink-700: #1E4B3D;
  --line: rgba(241, 239, 230, 0.12);

  --gold: #D8A83D;
  --gold-soft: #F0D28A;
  --amber: #C97A3D;
  --leaf: #4C9A6B;
  --coral: #E15B4D;

  --text-primary: #F5F3EC;
  --text-muted: #B9C4BD;
  --text-on-gold: #10241C;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font-display: 'Fraunces', serif;
  --font-body: 'Work Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;

  --bg: var(--ink-950);
  --surface: var(--ink-900);
  --surface-raised: var(--ink-800);
}

[data-theme="light"] {
  --bg: #EDEFE9;
  --surface: #FFFFFF;
  --surface-raised: #F5F6F1;
  --line: rgba(16, 43, 36, 0.12);
  --text-primary: #10241C;
  --text-muted: #4B5A52;
  --shadow-card: 0 12px 32px rgba(16, 43, 36, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  max-width: 100vw;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

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

/* -- Typographie -- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.3rem; }

p { color: var(--text-muted); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.mono-figure {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* -- Boutons -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--text-on-gold);
  box-shadow: 0 8px 24px rgba(216, 168, 61, 0.35);
}

.btn-primary:hover { box-shadow: 0 10px 30px rgba(216, 168, 61, 0.5); }

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--line);
}

.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn-block { width: 100%; }

/* -- Nav -- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1140px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .coin {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--amber));
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-on-gold);
}

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 0.95rem; }
.nav-links a:hover { color: var(--text-primary); }

.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
}

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

/* -- Ticker de gains (élément signature) -- */
.ticker {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.ticker-label { font-size: 0.8rem; color: var(--text-muted); }

.ticker-amount {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.ticker-pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 0 rgba(76, 154, 107, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 154, 107, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(76, 154, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 154, 107, 0); }
}

/* -- Formulaires -- */
.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.field input,
.field select {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.field-error {
  color: var(--coral);
  font-size: 0.8rem;
  margin-top: 6px;
  display: none;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.auth-card { width: 100%; max-width: 420px; }

.auth-foot {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-foot a { color: var(--gold); font-weight: 600; }

/* -- Sections -- */
section { padding: 88px 0; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-num {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

footer {
  border-top: 1px solid var(--line);
  padding: 48px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* -- Tableau de bord -- */
.dash-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar a {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.sidebar a.active, .sidebar a:hover { background: var(--surface-raised); color: var(--text-primary); }

.dash-main { padding: 32px; }

.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}

.stat-card { padding: 20px; }
.stat-card .label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.stat-card .value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; }

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--amber) 18%, var(--surface));
  border: 1px solid var(--amber);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.withdrawal-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.status-badge {
  justify-self: start;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pending { background: color-mix(in srgb, var(--amber) 22%, transparent); color: var(--amber); }
.status-validated { background: color-mix(in srgb, var(--leaf) 22%, transparent); color: var(--leaf); }
.status-rejected { background: color-mix(in srgb, var(--coral) 22%, transparent); color: var(--coral); }

.referral-copy-row { display: flex; gap: 10px; }
.referral-copy-row input { flex: 1; }

@media (max-width: 900px) {
  .dash-shell { display: block; }
  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    min-height: auto;
    align-items: center;
    padding: 12px 16px;
    gap: 4px;
  }
  .sidebar a { padding: 8px 12px; white-space: nowrap; flex-shrink: 0; }
  .sidebar .logo { margin-bottom: 0; margin-right: 8px; flex-shrink: 0; }
  .dash-main { padding: 20px 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .dash-grid { grid-template-columns: 1fr; }
  .tabs { flex-wrap: wrap; }
  .tab-btn { padding: 10px 12px; font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card .value { font-size: 1.25rem; }
}

/* -- Panneau admin -- */
.tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.tab-btn {
  background: none; border: none; padding: 12px 18px;
  color: var(--text-muted); font-weight: 600; font-size: 0.9rem;
  border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .data-table { min-width: 640px; }
.data-table th {
  text-align: left; padding: 10px 12px; color: var(--text-muted);
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--line); }
.data-table tr:last-child td { border-bottom: none; }

.btn-xs {
  padding: 6px 14px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; border: none;
}
.btn-approve { background: color-mix(in srgb, var(--leaf) 20%, transparent); color: var(--leaf); }
.btn-reject { background: color-mix(in srgb, var(--coral) 20%, transparent); color: var(--coral); }

/* -- Pages de contenu statique -- */
.content-page { padding: 48px 0 88px; }
.content-page .prose { max-width: 720px; }
.content-page .prose h2 { margin-top: 40px; margin-bottom: 14px; }
.content-page .prose p, .content-page .prose li { margin-bottom: 12px; }
.content-page .prose ul { padding-left: 20px; }

.accordion-item {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.accordion-q {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; font-weight: 600; font-size: 1rem;
}
.accordion-a { display: none; margin-top: 10px; color: var(--text-muted); }
.accordion-item.open .accordion-a { display: block; }
.accordion-item.open .accordion-q .chevron { transform: rotate(180deg); }
.chevron { transition: transform 0.2s ease; color: var(--gold); }

.blog-list { display: grid; gap: 20px; }
.blog-card { display: block; }
.blog-card .date { font-family: var(--font-mono); font-size: 0.78rem; color: var(--gold); }

@media (max-width: 760px) {
  .grid-3 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  section { padding: 56px 0; }
}
