/* ===================================================================
   Carnet de Route v3 — thème rose pastel romantique
   Override rouge disponible via body.theme-spicy
=================================================================== */

:root {
  --bg:          #FBEEF2;
  --bg-deep:     #F5DCE4;
  --cream:       #FFFBF9;
  --cream-dim:   #F3E4E9;
  --accent:      #C9647A;
  --accent-light:#E8A0B4;
  --gold:        #C9962C;
  --gold-light:  #E4C57A;
  --teal:        #7A5C7E;
  --ink:         #3A2C33;
  --danger:      #B5493F;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Work Sans', -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --radius: 14px;
  --shadow: 0 12px 30px -12px rgba(58, 44, 51, 0.25);
}

/* Thème spicy : rouge, activé via <body class="theme-spicy"> */
body.theme-spicy {
  --bg:          #3A1414;
  --bg-deep:     #240B0B;
  --cream:       #FFF3EE;
  --cream-dim:   #F3D9CF;
  --accent:      #D9463A;
  --accent-light:#F08A6C;
  --teal:        #8C2F26;
  --ink:         #2E1210;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(232,160,180,0.25), transparent 45%),
    radial-gradient(circle at 88% 92%, rgba(201,100,122,0.18), transparent 45%);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
  transition: background 0.4s ease;
}
body.theme-spicy {
  background-image:
    radial-gradient(circle at 12% 8%, rgba(217,70,58,0.25), transparent 45%),
    radial-gradient(circle at 88% 92%, rgba(240,138,108,0.18), transparent 45%);
  color: var(--cream);
}

a { color: inherit; }

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* ---------- header / topbar ---------- */
.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  border-bottom: 1px dotted rgba(58,44,51,0.2);
  padding-bottom: 14px;
}
body.theme-spicy .topbar { border-bottom-color: rgba(255,243,238,0.2); }
.brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}
body.theme-spicy .brand { color: var(--accent-light); }
.brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-top: 2px;
}
.nav-links {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.nav-links a { text-decoration: none; color: var(--ink); border-bottom: 1px solid transparent; opacity: 0.75; }
body.theme-spicy .nav-links a { color: var(--cream); }
.nav-links a:hover { color: var(--accent); border-bottom-color: var(--accent); opacity: 1; }

/* ---------- stat strip ---------- */
.stats {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.stat-chip {
  flex: 1;
  min-width: 90px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(201,100,122,0.25);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
}
body.theme-spicy .stat-chip { background: rgba(255,255,255,0.06); border-color: rgba(255,243,238,0.2); }
.stat-chip .num {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--accent);
  display: block;
}
body.theme-spicy .stat-chip .num { color: var(--accent-light); }
.stat-chip .lbl {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
}
body.theme-spicy .stat-chip .lbl { color: var(--cream-dim); }
.stat-chip.partner { opacity: 0.75; }

/* ---------- card ---------- */
.card {
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  position: relative;
}
.card h1, .card h2, .card h3 {
  font-family: var(--font-display);
  margin-top: 0;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--accent);
  margin-bottom: 6px;
  display: block;
}
.theme-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  background: var(--bg-deep);
  color: var(--teal);
  padding: 3px 9px;
  border-radius: 999px;
  margin-left: 6px;
}

/* ---------- forms ---------- */
label { display: block; font-size: 0.85rem; margin-bottom: 6px; color: var(--ink); font-weight: 600; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], textarea, select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 13px;
  border: 1.5px solid rgba(58,44,51,0.2);
  border-radius: 10px;
  margin-bottom: 16px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #b8556c; }
.btn-gold { background: var(--gold); color: #2b1c00; }
.btn-gold:hover { background: var(--gold-light); }
.btn-ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-spicy { background: #D9463A; color: #fff; }
.btn-spicy:hover { background: #c93b30; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-block { display: block; width: 100%; }

/* ---------- shop grid ---------- */
.shop-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.item-card {
  background: rgba(255,255,255,0.85);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
body.theme-spicy .item-card { background: rgba(255,255,255,0.92); }
.item-card.pinned {
  border: 2px solid var(--gold);
  background: linear-gradient(135deg, rgba(228,197,122,0.18), rgba(255,255,255,0.9));
  flex-direction: column;
  align-items: stretch;
}
.item-emoji { font-size: 1.8rem; }
.item-body { flex: 1; }
.item-body h4 { margin: 0 0 3px; font-family: var(--font-display); color: var(--ink); }
.item-body p { margin: 0; font-size: 0.85rem; color: #666; }
.item-cost { font-family: var(--font-mono); font-size: 0.85rem; white-space: nowrap; color: var(--accent); font-weight: 600; }

.market-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.market-toggle a {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border: 1.5px solid rgba(255,255,255,0.4);
  color: var(--ink);
  background: rgba(255,255,255,0.4);
}
body.theme-spicy .market-toggle a { color: var(--cream); background: rgba(255,255,255,0.08); }
.market-toggle a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- timeline ---------- */
.timeline-entry {
  border-left: 2px dotted rgba(58,44,51,0.25);
  padding: 4px 0 20px 18px;
  position: relative;
}
body.theme-spicy .timeline-entry { border-left-color: rgba(255,243,238,0.3); }
.timeline-entry::before {
  content: "";
  position: absolute;
  left: -6px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-date { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); }
.timeline-q { font-weight: 600; margin: 4px 0; }
.timeline-a { color: var(--ink); opacity: 0.75; font-style: italic; }

/* ---------- streak ---------- */
.streak-row {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--teal);
  margin-bottom: 4px; flex-wrap: wrap;
}
.streak-dots { display: flex; gap: 4px; }
.streak-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(58,44,51,0.12); }
.streak-dot.on { background: var(--gold); }

/* ---------- notif banner ---------- */
.notif-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(201,100,122,0.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 0.85rem;
}
.notif-banner button { flex-shrink: 0; }

/* ---------- reverse question ---------- */
.reverse-card {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(201,100,122,0.3);
}
.reverse-card .eyebrow { color: var(--accent); }

/* ---------- gold progress ---------- */
.gold-track {
  position: relative; height: 10px;
  background: rgba(58,44,51,0.1);
  border-radius: 999px; overflow: hidden;
  margin: 12px 0 6px;
}
.gold-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent-light)); transition: width 0.6s ease; }

/* ---------- misc ---------- */
.empty-state { text-align: center; padding: 36px 10px; color: var(--teal); font-family: var(--font-mono); font-size: 0.85rem; }
.flash { background: rgba(228,197,122,0.25); border: 1px solid var(--gold); color: #7a5a10; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; font-size: 0.88rem; }
.flash-error { background: rgba(181,73,63,0.15); border-color: var(--danger); color: var(--danger); }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
table th, table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid rgba(58,44,51,0.1); }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab-btn { flex: 1; padding: 10px; text-align: center; border-radius: 10px; cursor: pointer; font-family: var(--font-mono); font-size: 0.78rem; border: 1.5px solid rgba(58,44,51,0.2); background: transparent; color: var(--ink); }
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.section-title { font-family: var(--font-display); color: var(--accent); font-size: 1.05rem; margin: 28px 0 12px; }
.badge-pending { color: var(--gold); font-family: var(--font-mono); font-size: 0.75rem; }
.badge-done { color: var(--teal); font-family: var(--font-mono); font-size: 0.75rem; }

@media (min-width: 560px) {
  .shop-grid { grid-template-columns: 1fr 1fr; }
}
