/* public/public.css — tms.ai — Fichier CSS unique partagé */

/* ──────────────────────────────────────────
   Variables
────────────────────────────────────────── */
:root {
  --bg:         #0a0a0f;
  --bg-card:    #111118;
  --bg-input:   #16161f;
  --border:     #2a2a3a;
  --accent:     #e8a045;
  --accent-dim: #7a4e1a;
  --spark:      #f5c842;
  --text:       #e2e0d8;
  --text-muted: #7a7890;
  --text-dim:   #4a4860;
  --danger:     #c0392b;
  --success:    #27ae60;
  --rare:       #9b59b6;
  --rare-dim:   #4a2060;

  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans:  'Segoe UI', system-ui, sans-serif;

  --radius:     6px;
  --radius-lg:  12px;
  --shadow:     0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 48px rgba(0,0,0,0.7);

  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   40px;
  --space-2xl:  64px;

  --max-content: 720px;
  --max-wide:    1100px;
}

/* ──────────────────────────────────────────
   Reset
────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ──────────────────────────────────────────
   Layout
────────────────────────────────────────── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.page--top {
  justify-content: flex-start;
  padding-top: var(--space-2xl);
}

.container {
  width: 100%;
  max-width: var(--max-content);
}

.container--wide {
  max-width: var(--max-wide);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow);
}

.card--sm {
  padding: var(--space-lg);
}

.row {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.row--between {
  justify-content: space-between;
}

.row--wrap {
  flex-wrap: wrap;
}

.col {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

/* ──────────────────────────────────────────
   Typography
────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: 2rem;   margin-bottom: var(--space-md); }
h2 { font-size: 1.5rem; margin-bottom: var(--space-sm); }
h3 { font-size: 1.2rem; margin-bottom: var(--space-xs); }
h4 { font-size: 1rem;   margin-bottom: var(--space-xs); }

.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-spark  { color: var(--spark); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-rare   { color: var(--rare); }

.text-sm  { font-size: 0.875rem; }
.text-xs  { font-size: 0.75rem; }
.text-lg  { font-size: 1.125rem; }
.text-xl  { font-size: 1.25rem; }

.text-center { text-align: center; }
.text-serif  { font-family: var(--font-serif); }

.narration {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.narration p { margin-bottom: var(--space-md); }

/* ──────────────────────────────────────────
   Logo / Branding
────────────────────────────────────────── */
.logo {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.logo-spark {
  color: var(--spark);
}

.tagline {
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-serif);
  margin-top: var(--space-xs);
}

/* ──────────────────────────────────────────
   Buttons
────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover  { opacity: 0.85; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--primary   { background: var(--accent);  color: #000; font-weight: 600; }
.btn--secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--danger    { background: var(--danger);  color: #fff; }
.btn--ghost     { background: transparent; color: var(--text-muted); }
.btn--spark     { background: var(--spark);   color: #000; font-weight: 700; }
.btn--rare      { background: var(--rare);    color: #fff; }
.btn--google    { background: #fff; color: #333; border: 1px solid #ddd; }

.btn--full { width: 100%; }
.btn--sm   { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn--lg   { padding: 1rem 2rem; font-size: 1.1rem; }

/* ──────────────────────────────────────────
   Forms
────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-textarea,
.form-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-sans);
  padding: 0.75rem 1rem;
  width: 100%;
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-textarea--tall { min-height: 160px; }

.form-select option { background: var(--bg-card); }

.form-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.form-error {
  font-size: 0.875rem;
  color: var(--danger);
  padding: var(--space-sm) var(--space-md);
  background: rgba(192,57,43,0.1);
  border-radius: var(--radius);
  border-left: 3px solid var(--danger);
}

.form-success {
  font-size: 0.875rem;
  color: var(--success);
  padding: var(--space-sm) var(--space-md);
  background: rgba(39,174,96,0.1);
  border-radius: var(--radius);
  border-left: 3px solid var(--success);
}

/* ──────────────────────────────────────────
   Divider
────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

.divider--text {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-dim);
  font-size: 0.875rem;
  margin: var(--space-lg) 0;
}

.divider--text::before,
.divider--text::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ──────────────────────────────────────────
   Étincelles
────────────────────────────────────────── */
.spark-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(245,200,66,0.12);
  border: 1px solid var(--accent-dim);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--spark);
}

.spark-icon { font-size: 1em; }

.spark-stable   { color: var(--spark); }
.spark-volatile { color: var(--accent); }

/* ──────────────────────────────────────────
   Cartes du Destin
────────────────────────────────────────── */
.destiny-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  position: relative;
  user-select: none;
}

.destiny-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(232,160,69,0.2);
}

.destiny-card--selected {
  border-color: var(--accent);
  background: rgba(232,160,69,0.08);
}

.destiny-card--played {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.destiny-card--played:hover {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

.destiny-card--rare {
  border-color: var(--rare-dim);
}

.destiny-card--rare:hover {
  border-color: var(--rare);
  box-shadow: 0 4px 20px rgba(155,89,182,0.3);
}

.card-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.card-name--rare { color: var(--rare); }

.card-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.card-rarity-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rare);
}

/* ──────────────────────────────────────────
   Cicatrices
────────────────────────────────────────── */
.scar-item {
  border-left: 3px solid var(--danger);
  padding: var(--space-sm) var(--space-md);
  background: rgba(192,57,43,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text);
}

.scar-origin {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: normal;
  font-family: var(--font-sans);
  margin-top: var(--space-xs);
}

/* ──────────────────────────────────────────
   Progress
────────────────────────────────────────── */
.progress-bar {
  background: var(--border);
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 20px;
  transition: width 0.4s ease;
}

.act-indicator {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.act-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.3s;
}

.act-dot--active   { background: var(--accent); }
.act-dot--complete { background: var(--success); }

/* ──────────────────────────────────────────
   Loading
────────────────────────────────────────── */
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.loading-text {
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-serif);
  text-align: center;
  margin-top: var(--space-lg);
}

/* ──────────────────────────────────────────
   Pack cards (sparks shop)
────────────────────────────────────────── */
.pack-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.pack-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.pack-card--featured {
  border-color: var(--accent);
  background: rgba(232,160,69,0.05);
}

.pack-sparks {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--spark);
  font-family: var(--font-serif);
}

.pack-name {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pack-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: var(--space-sm) 0;
}

/* ──────────────────────────────────────────
   Subscription card
────────────────────────────────────────── */
.sub-card {
  background: linear-gradient(135deg, rgba(232,160,69,0.08), rgba(155,89,182,0.08));
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.sub-badge {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: var(--space-md);
}

/* ──────────────────────────────────────────
   Cliffhanger
────────────────────────────────────────── */
.cliffhanger-overlay {
  background: linear-gradient(to bottom, transparent 0%, var(--bg) 70%);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  pointer-events: none;
}

.cliffhanger-cta {
  text-align: center;
  padding: var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-lg);
  margin-top: var(--space-lg);
}

/* ──────────────────────────────────────────
   Alerts / Notices
────────────────────────────────────────── */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.5;
}

.alert--info    { background: rgba(52,152,219,0.1); border-left: 3px solid #3498db; color: #7ec8e3; }
.alert--success { background: rgba(39,174,96,0.1);  border-left: 3px solid var(--success); color: #6fcf97; }
.alert--warning { background: rgba(245,200,66,0.1); border-left: 3px solid var(--spark);   color: var(--spark); }
.alert--danger  { background: rgba(192,57,43,0.1);  border-left: 3px solid var(--danger);  color: #e07070; }

/* ──────────────────────────────────────────
   Badge
────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 20px;
}

.badge--conteur { background: rgba(232,160,69,0.2); color: var(--accent); border: 1px solid var(--accent-dim); }
.badge--rare    { background: rgba(155,89,182,0.2); color: var(--rare);   border: 1px solid var(--rare-dim); }

/* ──────────────────────────────────────────
   Spacing utilities
────────────────────────────────────────── */
.mt-xs  { margin-top: var(--space-xs); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mb-xs  { margin-bottom: var(--space-xs); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.p-md   { padding: var(--space-md); }
.p-lg   { padding: var(--space-lg); }

/* ──────────────────────────────────────────
   Responsive
────────────────────────────────────────── */
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card { padding: var(--space-lg); }
  h1 { font-size: 1.5rem; }
}
