/* ============================================================================
   SONCRUSH — DESIGN SYSTEM « LUXE »
   Source unique de vérité visuelle. Ne jamais dupliquer ces tokens ailleurs.
   Réf. Partie C du cahier des charges (C1 tokens, C2 composants).
   ============================================================================ */

/* ---------------------------------------------------------------------------
   0. FONTS — polices variables auto-hébergées (CSP 'self', sous-ensembles
   latin / latin-ext pour la perf ; woff2 variable = 1 fichier / graisses).
   Fraunces = titres couture ; Inter = corps. font-display:swap => pas de FOIT.
--------------------------------------------------------------------------- */
/* Inter — latin */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2'), local('Inter');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Inter — latin-ext */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Fraunces — latin (opsz suit la taille via font-optical-sizing:auto par défaut) */
@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../fonts/fraunces-latin.woff2') format('woff2'), local('Fraunces'), local('Playfair Display');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Fraunces — latin-ext */
@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../fonts/fraunces-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------------------
   1. TOKENS (C1)
--------------------------------------------------------------------------- */
:root {
  /* Couleurs de marque */
  --sc-rose: #FF3E7F;
  --sc-rose-deep: #E62E6B;
  --sc-rose-soft: #FF7DA9;
  --sc-gold: #D4AF37;
  --sc-gold-light: #F0D77B;
  --sc-gold-deep: #B8942A;

  /* Fonds & surfaces */
  --sc-black: #0D0D0F;
  --sc-black-2: #141418;
  --sc-black-3: #1C1C22;
  --sc-white: #FFFFFF;
  --sc-grey: #9A9AA3;
  /* Relevé de #6A6A73 → #83838D : atteint le contraste AA 4.5:1 sur fond noir
     (~4.9:1) pour les textes secondaires (horodatages, aides, notes, footer). */
  --sc-grey-2: #83838D;

  /* Sémantique */
  --sc-success: #34C77B;
  --sc-danger: #FF4D4D;
  --sc-info: #4DA3FF;

  /* Dégradés signatures */
  --grad-crush: linear-gradient(135deg, #FF3E7F 0%, #D4AF37 100%);
  --grad-gold: linear-gradient(135deg, #F0D77B, #B8942A);
  --grad-rose: linear-gradient(135deg, #FF7DA9, #E62E6B);
  --grad-card: linear-gradient(180deg, transparent 45%, rgba(13, 13, 15, 0.55) 70%, rgba(13, 13, 15, 0.94) 100%);
  --grad-violet: linear-gradient(135deg, #A66BFF, #6C3EFF);

  /* Bordures translucides */
  --border-soft: 1px solid rgba(255, 255, 255, 0.08);
  --border-hair: 1px solid rgba(255, 255, 255, 0.05);

  /* Rayons */
  --r-input: 12px;
  --r-card: 20px;
  --r-modal: 24px;
  --r-pill: 999px;

  /* Espacements (échelle 4-8-12-16-24-32-48-64) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px;

  /* Typo : échelle 12 / 14 / 16 / 18 / 22 / 28 / 36 / 48 */
  --fs-xs: 12px; --fs-sm: 14px; --fs-base: 16px; --fs-md: 18px;
  --fs-lg: 22px; --fs-xl: 28px; --fs-2xl: 36px; --fs-3xl: 48px;
  --font-title: 'Fraunces', 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Ombres */
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-glow-rose: 0 0 24px rgba(255, 62, 127, 0.35);
  --shadow-glow-gold: 0 0 24px rgba(212, 175, 55, 0.35);

  /* Animations */
  --dur-micro: 150ms;
  --dur-std: 250ms;
  --dur-emo: 400ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Navigation */
  --bottom-nav-h: 64px;
  --sidebar-w: 280px;
  --content-max: 620px;

  color-scheme: dark;
}

/* ---------------------------------------------------------------------------
   2. RESET & BASE
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--sc-white);
  background: var(--sc-black);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-title);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg, video { max-width: 100%; display: block; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

::selection { background: var(--sc-rose); color: #fff; }

/* Scrollbar sombre discrète */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--sc-black); }
::-webkit-scrollbar-thumb { background: var(--sc-black-3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #2a2a33; }

/* Focus visible élégant (anneau rose) — accessibilité */
:focus-visible {
  outline: 2px solid var(--sc-rose);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Lien d'évitement : masqué jusqu'au focus clavier (accessibilité). */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  padding: 10px 16px;
  background: var(--sc-rose);
  color: #fff;
  font-weight: 600;
  border-radius: var(--r-pill, 999px);
  transform: translateY(-150%);
  transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); outline: 2px solid #fff; outline-offset: 2px; }

/* Réservé aux lecteurs d'écran : présent dans l'arbre a11y, invisible à l'œil. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Indicateur « tirer pour rafraîchir » (piloté par main.js). */
.ptr-indicator {
  position: fixed; top: 0; left: calc(50% - 20px); z-index: 2000;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--sc-black-3); box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center;
  transform: translateY(-100%); pointer-events: none;
}
.ptr-spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25); border-top-color: var(--sc-rose);
}
.ptr-indicator.ptr-ready .ptr-spinner { border-top-color: var(--sc-gold); }
.ptr-indicator.ptr-loading .ptr-spinner { animation: ptrSpin .7s linear infinite; }
@keyframes ptrSpin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   3. UTILITAIRES TEXTE & MARQUE
--------------------------------------------------------------------------- */
.text-gradient-crush {
  background: var(--grad-crush);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.text-gradient-gold {
  background: var(--grad-gold);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.text-grad-animated {
  background: linear-gradient(135deg, #FF3E7F, #D4AF37, #FF7DA9, #FF3E7F);
  background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: gradShift 6s var(--ease) infinite;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.text-muted { color: var(--sc-grey); }
.text-gold { color: var(--sc-gold); }
.text-rose { color: var(--sc-rose); }
.tabular { font-variant-numeric: tabular-nums; }

.fs-xs { font-size: var(--fs-xs); }  .fs-sm { font-size: var(--fs-sm); }
.fs-md { font-size: var(--fs-md); }  .fs-lg { font-size: var(--fs-lg); }
.fs-xl { font-size: var(--fs-xl); }  .fs-2xl { font-size: var(--fs-2xl); }
.fs-3xl { font-size: var(--fs-3xl); }

/* ---------------------------------------------------------------------------
   4. BOUTONS (C2)
--------------------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 52px;
  padding: 0 var(--sp-6);
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: var(--fs-base);
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform var(--dur-micro) var(--ease),
              box-shadow var(--dur-std) var(--ease),
              filter var(--dur-std) var(--ease);
  overflow: hidden;
  user-select: none;
}
@media (min-width: 1024px) { .btn { height: 46px; } }

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Reflet glossy en haut */
.btn::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}

.btn-primary { background: var(--grad-crush); color: #fff; }
.btn-primary:hover { box-shadow: var(--shadow-glow-rose); transform: translateY(-1px); }

.btn-gold { background: var(--grad-gold); color: var(--sc-black); }
.btn-gold:hover { box-shadow: var(--shadow-glow-gold); transform: translateY(-1px); }

.btn-secondary {
  background: var(--sc-black-3);
  border: var(--border-soft);
  color: var(--sc-white);
}
.btn-secondary::before { display: none; }
.btn-secondary:hover { border-color: rgba(255, 255, 255, 0.18); }

.btn-ghost { background: transparent; color: var(--sc-white); }
.btn-ghost::before { display: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }

.btn-danger { background: var(--sc-danger); color: #fff; }

.btn-block { width: 100%; }
.btn-sm { height: 40px; padding: 0 var(--sp-4); font-size: var(--fs-sm); }
.btn-lg { height: 58px; padding: 0 var(--sp-8); font-size: var(--fs-md); }

/* ---------------------------------------------------------------------------
   5. INPUTS & FORMULAIRES (C2)
--------------------------------------------------------------------------- */
.field { position: relative; margin-bottom: var(--sp-4); }

.input, .textarea, .select {
  width: 100%;
  height: 52px;
  padding: 0 var(--sp-4);
  background: var(--sc-black-3);
  border: 1px solid transparent;
  border-radius: var(--r-input);
  color: var(--sc-white);
  transition: border-color var(--dur-std) var(--ease),
              box-shadow var(--dur-std) var(--ease);
}
.textarea { height: auto; min-height: 96px; padding: var(--sp-3) var(--sp-4); resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--sc-grey-2); }

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--sc-rose);
  box-shadow: 0 0 0 3px rgba(255, 62, 127, 0.15);
}

/* Label flottant */
.field-float { position: relative; }
.field-float .input { padding-top: var(--sp-4); }
.field-float label {
  position: absolute;
  left: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--sc-grey);
  pointer-events: none;
  transition: all var(--dur-std) var(--ease);
  background: transparent;
  padding: 0 4px;
}
.field-float .input:focus + label,
.field-float .input:not(:placeholder-shown) + label {
  top: 0;
  font-size: var(--fs-xs);
  color: var(--sc-rose);
  background: var(--sc-black-3);
}

.field-error { color: var(--sc-danger); font-size: var(--fs-xs); margin-top: var(--sp-1); display: block; }
.input.is-error { border-color: var(--sc-danger); animation: shake 0.3s var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.label { display: block; font-size: var(--fs-sm); color: var(--sc-grey); margin-bottom: var(--sp-2); }

/* Switch iOS-like rose */
.switch { position: relative; display: inline-block; width: 52px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: var(--sc-black-3);
  border: var(--border-soft);
  border-radius: 999px;
  transition: background var(--dur-std) var(--ease);
}
.switch .slider::before {
  content: ''; position: absolute;
  height: 22px; width: 22px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform var(--dur-std) var(--ease);
}
.switch input:checked + .slider { background: var(--grad-crush); border-color: transparent; }
.switch input:checked + .slider::before { transform: translateX(22px); }

/* Double-slider (préférences âge/distance) — style de base */
.range-track { position: relative; height: 4px; background: var(--sc-black-3); border-radius: 999px; }
.range-fill { position: absolute; height: 100%; background: var(--grad-crush); border-radius: 999px; }

/* ---------------------------------------------------------------------------
   6. CARDS & SURFACES
--------------------------------------------------------------------------- */
.surface { background: var(--sc-black-2); border: var(--border-soft); border-radius: var(--r-card); }
.surface-2 { background: var(--sc-black-3); border-radius: var(--r-input); }

.card {
  background: var(--sc-black-2);
  border: var(--border-soft);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: var(--sp-6);
}
.card-glass {
  background: rgba(28, 28, 34, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: var(--border-soft);
  border-radius: var(--r-card);
}

/* --- Card profil (découverte) --- */
.profile-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--sc-black-2);
  box-shadow: var(--shadow-card);
  isolation: isolate;
}
.profile-card__photo { width: 100%; height: 100%; object-fit: cover; }
.profile-card__scrim { position: absolute; inset: 0; background: var(--grad-card); pointer-events: none; }

.profile-card__body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: var(--sp-6);
  z-index: 2;
}
.profile-card__name {
  font-family: var(--font-body);
  font-size: var(--fs-xl);
  font-weight: 700;
  display: flex; align-items: center; gap: var(--sp-2);
}
.profile-card__meta { color: var(--sc-grey); font-size: var(--fs-sm); margin-top: 2px; }
.profile-card__tags { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); flex-wrap: wrap; }

/* Anneau de compatibilité (haut droite) */
.compat-ring {
  position: absolute; top: var(--sp-4); right: var(--sp-4); z-index: 3;
  width: 56px; height: 56px;
}
.compat-ring svg { transform: rotate(-90deg); }
.compat-ring__value {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Stamps LIKE / PASS pendant le drag */
.swipe-stamp {
  position: absolute; top: 40px; z-index: 4;
  font-family: var(--font-title);
  font-size: 44px; font-weight: 700;
  padding: 4px 18px; border-radius: 12px;
  border: 4px solid currentColor; opacity: 0;
  transition: opacity var(--dur-micro) var(--ease);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.swipe-stamp--like { left: 24px; color: var(--sc-success); transform: rotate(-16deg); }
.swipe-stamp--pass { right: 24px; color: var(--sc-danger); transform: rotate(16deg); }
.swipe-stamp--super { left: 50%; top: 60px; transform: translateX(-50%); color: var(--sc-gold); }

/* --- Boutons d'action swipe --- */
.swipe-actions {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp-4);
}
.action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--sc-black-2);
  border: var(--border-soft);
  box-shadow: var(--shadow-soft);
  transition: transform var(--dur-micro) var(--ease), box-shadow var(--dur-std) var(--ease);
}
.action-btn:active { transform: scale(0.92); }
.action-btn--pass { width: 56px; height: 56px; color: var(--sc-grey); }
.action-btn--rewind { width: 48px; height: 48px; color: var(--sc-gold); }
.action-btn--like {
  width: 64px; height: 64px;
  background: var(--grad-rose); color: #fff; border: none;
  box-shadow: var(--shadow-glow-rose);
}
.action-btn--super {
  width: 56px; height: 56px;
  background: var(--grad-gold); color: var(--sc-black); border: none;
  box-shadow: var(--shadow-glow-gold);
}
.action-btn--boost { width: 48px; height: 48px; background: var(--grad-violet); color: #fff; border: none; }
.action-btn:hover { transform: translateY(-2px); }
.action-btn.is-locked { position: relative; }
.action-btn.is-locked::after {
  content: '🔒'; position: absolute; bottom: -2px; right: -2px; font-size: 12px;
}

/* Animation bounce au tap */
@keyframes bounceTap {
  0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); }
}
.action-btn.bounce { animation: bounceTap var(--dur-std) var(--ease); }

/* ---------------------------------------------------------------------------
   7. CHIPS, BADGES, TAGS
--------------------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  backdrop-filter: blur(4px);
  transition: background var(--dur-std) var(--ease), transform var(--dur-micro) var(--ease);
}
.chip:hover { background: rgba(255, 255, 255, 0.14); }
.chip--selected { background: var(--grad-crush); color: #fff; }
.chip--gold { background: transparent; border: 1px solid var(--sc-gold); color: var(--sc-gold-light); }
.chip--common { background: rgba(255, 62, 127, 0.18); border: 1px solid var(--sc-rose); color: var(--sc-rose-soft); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600;
}
.badge-gold { background: var(--grad-gold); color: var(--sc-black); }
.badge-platinum { background: linear-gradient(135deg, #E8E8F0, #A9A9C0); color: var(--sc-black); }
.badge-certified {
  width: 22px; height: 22px; padding: 0;
  background: var(--grad-gold); color: var(--sc-black);
  border-radius: 50%; justify-content: center; font-size: 12px;
}
.badge-online {
  display: inline-flex; align-items: center; gap: 6px; color: var(--sc-success); font-size: var(--fs-xs);
}
.dot-online {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--sc-success);
  box-shadow: 0 0 0 0 rgba(52, 199, 123, 0.6);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(52, 199, 123, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 199, 123, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 199, 123, 0); }
}

/* ---------------------------------------------------------------------------
   8. TOASTS
--------------------------------------------------------------------------- */
.toast-stack {
  position: fixed; top: calc(env(safe-area-inset-top) + 16px); right: 16px;
  z-index: 1000; display: flex; flex-direction: column; gap: var(--sp-2);
  max-width: 360px;
}
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--sc-black-3);
  border: var(--border-soft);
  border-left: 3px solid var(--sc-rose);
  border-radius: var(--r-input);
  box-shadow: var(--shadow-card);
  animation: toastIn var(--dur-std) var(--ease);
}
.toast--success { border-left-color: var(--sc-success); }
.toast--error { border-left-color: var(--sc-danger); }
.toast--info { border-left-color: var(--sc-info); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.hiding { opacity: 0; transform: translateX(20px); transition: all var(--dur-std) var(--ease); }

/* ---------------------------------------------------------------------------
   9. SKELETONS (shimmer sombre — jamais de spinner plein écran)
--------------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--sc-black-2) 25%, var(--sc-black-3) 50%, var(--sc-black-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-input);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 12px; margin-bottom: 8px; }
.skeleton-card { aspect-ratio: 3 / 4; border-radius: var(--r-card); }
.skeleton-avatar { width: 56px; height: 56px; border-radius: 50%; }

/* ---------------------------------------------------------------------------
   10. MODALS & BOTTOM-SHEETS
--------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(5, 5, 7, 0.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
  animation: fadeIn var(--dur-std) var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%; max-width: 480px;
  background: var(--sc-black-2);
  border: var(--border-soft);
  border-radius: var(--r-modal);
  box-shadow: var(--shadow-card);
  padding: var(--sp-8);
  animation: modalIn var(--dur-emo) var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.94) translateY(10px); } to { opacity: 1; transform: none; } }

/* Bottom-sheet mobile */
@media (max-width: 767px) {
  .modal-backdrop.sheet { align-items: flex-end; padding: 0; }
  .modal-backdrop.sheet .modal {
    max-width: 100%;
    border-radius: var(--r-modal) var(--r-modal) 0 0;
    animation: sheetUp var(--dur-emo) var(--ease);
    padding-bottom: calc(var(--sp-8) + env(safe-area-inset-bottom));
  }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
}
.sheet-handle { width: 44px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); margin: 0 auto var(--sp-4); }

/* --- Modal de match (signature émotionnelle) --- */
.match-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.match-backdrop .modal { position: relative; z-index: 2; }
.match-modal { text-align: center; position: relative; overflow: hidden; }
.match-modal__title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--sp-6);
}
.match-modal__avatars {
  position: relative; height: 130px; margin: var(--sp-6) 0;
  display: flex; align-items: center; justify-content: center;
}
.match-modal__avatar {
  width: 110px; height: 110px; border-radius: 50%;
  border: 3px solid transparent;
  background: var(--grad-gold) border-box;
  object-fit: cover;
}
.match-modal__avatar--left { animation: slideFromLeft var(--dur-emo) var(--ease); margin-right: -20px; }
.match-modal__avatar--right { animation: slideFromRight var(--dur-emo) var(--ease); margin-left: -20px; }
@keyframes slideFromLeft { from { transform: translateX(-120px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideFromRight { from { transform: translateX(120px); opacity: 0; } to { transform: none; opacity: 1; } }
.match-modal__heart {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 40px; z-index: 5; animation: heartPulse 1s var(--ease) infinite;
}
@keyframes heartPulse { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.25); } }

/* ---------------------------------------------------------------------------
   11. NAVIGATION — bottom nav (mobile) & sidebar (desktop)
--------------------------------------------------------------------------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: stretch;
  background: rgba(20, 20, 24, 0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: var(--border-soft);
}
.bottom-nav__item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--sc-grey); font-size: 10px; position: relative;
  transition: color var(--dur-std) var(--ease);
}
/* Taille de base des icônes SVG (viewBox seul, sans dimensions propres).
   Sans ça, hors contexte dimensionné, le SVG se réduit à 0 sur certains
   navigateurs mobiles → boutons « ronds vides » (swipe, chat, etc.). */
.nav-icon { width: 24px; height: 24px; flex-shrink: 0; }
.bottom-nav__item .nav-icon { width: 24px; height: 24px; }
.bottom-nav__item.active { color: var(--sc-white); }
.bottom-nav__item.active .nav-icon { color: var(--sc-rose); }
.bottom-nav__item.active::after {
  content: ''; position: absolute; top: 6px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--grad-crush);
}
.nav-badge {
  position: absolute; top: 6px; right: 22%;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--grad-gold); color: var(--sc-black);
  font-size: 10px; font-weight: 700;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
}
@media (min-width: 1024px) { .bottom-nav { display: none; } }

/* Sidebar desktop */
.sidebar {
  display: none;
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--sc-black-2);
  border-right: var(--border-soft);
  padding: var(--sp-6);
  flex-direction: column; gap: var(--sp-2);
  z-index: 400;
}
@media (min-width: 1024px) { .sidebar { display: flex; } }
.sidebar__logo { display: block; margin-bottom: var(--sp-8); }
.sidebar__logo img { width: 100%; max-width: 220px; height: auto; display: block; }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; }
.side-link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-input);
  color: var(--sc-grey); transition: all var(--dur-std) var(--ease);
}
.side-link:hover { background: var(--sc-black-3); color: var(--sc-white); }
.side-link.active { color: var(--sc-white); background: rgba(255, 62, 127, 0.1); }
.side-link.active .nav-icon { color: var(--sc-rose); }
.side-link .nav-icon { width: 22px; height: 22px; }

/* Carte upsell premium dans la sidebar */
.upsell-card {
  margin-top: auto;
  padding: var(--sp-4);
  border-radius: var(--r-card);
  background: var(--grad-gold);
  color: var(--sc-black);
}
.upsell-card h4 { font-family: var(--font-body); font-weight: 700; margin-bottom: 4px; }

/* ---------------------------------------------------------------------------
   12. LAYOUT APP (conteneurs)
--------------------------------------------------------------------------- */
.app-shell { min-height: 100vh; }
.app-main {
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 12px);
}
@media (min-width: 1024px) {
  .app-main { margin-left: var(--sidebar-w); padding-bottom: 0; }
  .app-content { max-width: var(--content-max); margin: 0 auto; padding: var(--sp-8) var(--sp-6); }
}
.app-content { padding: var(--sp-4); }

.app-header {
  position: sticky; top: 0; z-index: 300;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 var(--sp-4);
  background: rgba(13, 13, 15, 0.8);
  backdrop-filter: blur(12px);
}
.app-header.transparent { background: transparent; }
.app-header { justify-content: center; }
.app-header__logo { height: 40px; width: auto; display: block; }
@media (min-width: 1024px) { .app-header { display: none; } }

/* Container générique */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-4); }

/* ---------------------------------------------------------------------------
   13. PULL-TO-REFRESH & TRANSITIONS DE PAGE
--------------------------------------------------------------------------- */
.page-enter { animation: pageIn var(--dur-std) var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------------
   14. HELPERS DE MISE EN PAGE
--------------------------------------------------------------------------- */
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); } .gap-6 { gap: var(--sp-6); }
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); } .mb-6 { margin-bottom: var(--sp-6); } .mb-8 { margin-bottom: var(--sp-8); }
.text-center { text-align: center; }
.w-full { width: 100%; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.hidden { display: none; }

/* ---------------------------------------------------------------------------
   14b. BANNIÈRE D'INSTALLATION PWA
--------------------------------------------------------------------------- */
.install-banner {
  position: fixed; left: 12px; right: 12px; z-index: 800;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 12px);
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--sc-black-3); border: var(--border-soft);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
  transform: translateY(140%); transition: transform var(--dur-emo) var(--ease);
}
.install-banner.show { transform: translateY(0); }
@media (min-width: 1024px) { .install-banner { bottom: 16px; } }
.install-banner__text { flex: 1; display: flex; flex-direction: column; }
.install-banner__text strong { font-size: var(--fs-sm); }
.install-banner__text span { font-size: var(--fs-xs); color: var(--sc-grey); }
.install-banner__actions { display: flex; gap: var(--sp-2); }

/* ---------------------------------------------------------------------------
   15. ACCESSIBILITÉ — mouvement réduit
--------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Profil enrichi (Phase 13) : jauge de force, champs dynamiques,
   accroches (prompts). Chargé globalement (design-system).
   ============================================================ */

/* --- Jauge de force du profil --- */
.strength__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.strength__title { font-weight: 650; }
.strength__sub { font-size: var(--fs-sm); color: var(--sc-grey); margin-top: 2px; }
.strength__pct { font-family: var(--font-display, Georgia, serif); font-size: 2rem; font-weight: 700; color: var(--sc-gold); line-height: 1; }
.strength__pct small { font-size: .9rem; color: var(--sc-grey); }
.strength__bar { height: 10px; border-radius: 999px; background: var(--sc-black-3, #1c1c22); overflow: hidden; margin: 14px 0 0; }
.strength__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sc-rose), var(--sc-gold)); transition: width .5s ease; }
.strength__tips { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.strength__tips li { font-size: var(--fs-sm); color: var(--sc-grey); padding-left: 20px; position: relative; }
.strength__tips li::before { content: "→"; position: absolute; left: 0; color: var(--sc-rose); }

/* --- Champs dynamiques --- */
.pf-group { margin-bottom: var(--sp-5, 20px); }
.pf-group__title { font-size: var(--fs-sm); color: var(--sc-gold); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 10px; }
.pf-field { margin-bottom: 14px; }
.pf-label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--sc-white, #ECECF0); margin-bottom: 6px; }
.pf-tier { font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sc-gold); background: rgba(212,175,55,.14); padding: 1px 7px; border-radius: 5px; }
.pf-help { display: block; font-size: var(--fs-xs, .78rem); color: var(--sc-grey-2); margin-bottom: 6px; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip { cursor: pointer; user-select: none; }
.pf-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pf-chip input:disabled + span, .pf-chip:has(input:disabled) { opacity: .4; cursor: not-allowed; }
.pf-switch { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--sc-grey); cursor: pointer; }

/* --- Accroches (prompts) : version app-wide --- */
.prompt-counter { text-align: center; padding: 8px; margin-bottom: 14px; background: var(--sc-black-2); border-radius: 999px; font-size: var(--fs-sm); color: var(--sc-grey); }
.prompt-counter strong { color: var(--sc-rose); }
.prompt-list { display: flex; flex-direction: column; gap: 8px; }
.prompt-card { background: var(--sc-black-2); border: 1px solid rgba(255,255,255,.08); border-radius: var(--r-input); overflow: hidden; }
.prompt-card summary { cursor: pointer; padding: 13px 16px; font-size: var(--fs-sm); color: var(--sc-white, #ECECF0); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prompt-card summary::-webkit-details-marker { display: none; }
.prompt-card summary::after { content: "+"; color: var(--sc-rose); font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.prompt-card[open] summary::after { content: "\2212"; }
.prompt-card[open] summary { border-bottom: 1px solid rgba(255,255,255,.06); }
.prompt-answer { margin: 12px 16px 14px; width: calc(100% - 32px); resize: vertical; }
.prompt-answer:disabled { opacity: .4; }

/* --- Affichage des champs/accroches sur un profil --- */
.pf-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); padding: 6px 12px; border-radius: 999px; background: var(--sc-black-2); border: 1px solid rgba(255,255,255,.08); color: var(--sc-white, #ECECF0); }
.pf-badge b { color: var(--sc-grey); font-weight: 500; }
.prompt-show { background: var(--sc-black-2); border: 1px solid rgba(255,255,255,.08); border-radius: var(--r-input); padding: 14px 16px; margin-bottom: 10px; }
.prompt-show__q { font-size: var(--fs-xs, .78rem); color: var(--sc-gold); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.prompt-show__a { font-family: var(--font-display, Georgia, serif); font-size: 1.15rem; color: var(--sc-white, #ECECF0); }

/* --- Filtres avancés (préférences, Phase 13-C) --- */
.filters-adv { margin-bottom: var(--sp-6); }
.filters-adv__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.filters-adv.is-locked .filters-fieldset { opacity: .55; filter: grayscale(.3); position: relative; }
.filters-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--sc-rose); }
.filter-field__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.deal-toggle { font-size: var(--fs-xs, .78rem); color: var(--sc-grey); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.deal-toggle input { accent-color: var(--sc-danger); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { cursor: pointer; user-select: none; }
.filter-chip input { position: absolute; opacity: 0; pointer-events: none; }

/* --- Clips de profil (voix + vidéo, Phase 13-D) --- */
.clip-block { }
.clip-block__label { font-size: var(--fs-sm); color: var(--sc-grey); margin-bottom: 8px; }
.clip-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.clip-audio { width: 100%; height: 40px; margin-bottom: 8px; }
.clip-video { width: 100%; max-height: 420px; border-radius: 12px; background: #000; margin-bottom: 8px; }
.clip-del { display: inline; }
#recBtn.recording { background: var(--sc-danger); color: #fff; animation: recPulse 1.2s infinite; }
@keyframes recPulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

/* --- Pages légales (Phase 14) --- */
.legal { max-width: 760px; margin: 0 auto; padding: var(--sp-8) var(--sp-4) var(--sp-10); }
.legal h1 { font-family: var(--font-title, Georgia, serif); font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 6px; }
.legal__meta { color: var(--sc-grey); font-size: var(--fs-sm); margin-bottom: var(--sp-6); }
.legal h2 { font-size: 1.2rem; margin: var(--sp-6) 0 var(--sp-2); color: var(--sc-gold-light); }
.legal p, .legal li { color: var(--sc-grey); line-height: 1.7; }
.legal p { margin-bottom: var(--sp-3); }
.legal ul { margin: 0 0 var(--sp-3) 1.1rem; display: flex; flex-direction: column; gap: 4px; }
.legal a { color: var(--sc-rose); }
.legal__back { display: inline-block; margin-bottom: var(--sp-4); color: var(--sc-grey); text-decoration: none; }
/* Tableaux légaux (bases légales, sous-traitants) — défilement horizontal si étroit. */
.legal__table { width: 100%; border-collapse: collapse; margin: 0 0 var(--sp-4); display: block; overflow-x: auto; }
.legal__table th, .legal__table td { text-align: left; padding: 8px 12px; border-bottom: var(--border-soft); color: var(--sc-grey); font-size: var(--fs-sm); line-height: 1.5; vertical-align: top; }
.legal__table th { color: var(--sc-white); font-weight: 600; white-space: nowrap; }

/* --- Sélecteur de langue (i18n, Phase 17) --- */
.locale-switch { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.locale-switch__opt { font-size: var(--fs-sm); padding: 5px 12px; border-radius: 999px; text-decoration: none;
  color: var(--sc-grey); border: 1px solid rgba(255,255,255,.1); background: var(--sc-black-2); transition: all .15s ease; }
.locale-switch__opt:hover { color: var(--sc-white, #ECECF0); }
.locale-switch__opt.is-active { color: #fff; background: var(--grad-crush, linear-gradient(115deg,#FF3E7F,#D4AF37)); border-color: transparent; }

/* Bouton engrenage (accès réglages depuis « Mon profil » sur mobile) */
.pf-gear {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--sc-black-3); color: var(--sc-white); text-decoration: none;
  border: 1px solid rgba(255,255,255,.08); transition: color .15s ease, background .15s ease;
}
.pf-gear:hover { color: var(--sc-gold-light); }
.pf-gear:active { transform: scale(.92); }

/* Onglets « Mon profil » (Profil / Premium / Sécurité) */
.pf-tabs { display: flex; gap: 4px; background: var(--sc-black-2); border-radius: 999px; padding: 4px; margin-bottom: var(--sp-5); }
.pf-tab { flex: 1; padding: 9px 0; border-radius: 999px; border: 0; cursor: pointer; background: transparent; color: var(--sc-grey); font-weight: 600; font-size: var(--fs-sm); transition: color .15s ease, background .2s ease; }
.pf-tab.is-active { background: var(--grad-crush); color: #fff; }
.pf-panel[hidden] { display: none; }

/* Bandeau « connecté en tant que » (impersonation admin) */
.impersonate-bar {
  position: sticky; top: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 8px 14px; padding-top: calc(8px + env(safe-area-inset-top));
  background: var(--grad-gold); color: var(--sc-black);
  font-size: var(--fs-sm); font-weight: 600;
}
.impersonate-bar button {
  flex-shrink: 0; background: var(--sc-black); color: var(--sc-gold-light);
  border-radius: 999px; padding: 5px 12px; font-size: var(--fs-xs); font-weight: 700; cursor: pointer;
}

/* Sous-onglets (espace Explorer : Autour de toi / Pour toi) */
.subtabs { display: flex; gap: 4px; background: var(--sc-black-2); border-radius: 999px; padding: 4px; margin-bottom: var(--sp-4); }
.subtab { flex: 1; text-align: center; padding: 9px 0; border-radius: 999px; color: var(--sc-grey); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; transition: color .15s ease, background .2s ease; }
.subtab.is-active { background: var(--grad-crush); color: #fff; }
.explore-wrap { max-width: 560px; margin: 0 auto; }
