/* ===== Design tokens =====
   Palette inspirée d'un terrain/tableau de score : vert profond + citron vif
   pour l'énergie du sport, sans tomber dans le cliché "app fitness bleu/orange".
   Les noms suivent les tokens de shadcn/ui (background, card, primary, muted…)
   et les composants reprennent son langage visuel : coins arrondis, anneau de
   focus, ombres légères, texte en casse normale. */
:root {
  color-scheme: light;

  /* Thème clair minimaliste (maquette accueil) : fond blanc cassé, cartes blanches,
     citron réservé aux fonds d'action (illisible en texte sur blanc). */
  --background: #F5F5F1;
  --foreground: #16181A;
  --card: #FFFFFF;
  --card-foreground: #16181A;
  --popover: #FFFFFF;
  --popover-foreground: #16181A;
  --primary: #C6F135;
  --primary-foreground: #16181A;
  /* Texte "mis en avant" (liens, scores, pastilles) : noir, comme la maquette. Le citron
     reste la seule couleur de marque, réservé aux fonds d'action. */
  --primary-text: var(--foreground);
  --secondary: #EEEEE9;
  --secondary-foreground: #16181A;
  --muted: #F1F1EC;
  --muted-foreground: #6B6E6A;
  --accent-surface: rgba(22, 24, 26, 0.05); /* "accent" de shadcn : fond au survol */
  --destructive: #DC3F2E;
  --border: #E4E4DE;
  --input: #DEDED7;
  --ring: #9BC21A;
  --radius: 12px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 16, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 16, 0.06), 0 1px 2px -1px rgba(16, 24, 16, 0.06);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 16, 0.18), 0 4px 8px -4px rgba(16, 24, 16, 0.08);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--ring) 40%, transparent);

  /* Alias historiques (utilisés en style inline dans les pages et le JS) */
  --bg: var(--background);
  --bg-panel: var(--card);
  --bg-card: var(--muted);
  --line: var(--border);
  --text: var(--foreground);
  --text-dim: var(--muted-foreground);
  --text-muted: var(--muted-foreground);
  --accent: var(--primary-text);
  --accent-dim: #8FA83A;
  --danger: var(--destructive);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Titres sobres (maquette minimaliste) : sans-serif gras, casse normale. */
h1, .display {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground);
}
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0; }
main > h1 { margin-bottom: 1.25rem; }
h2, h3 {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--foreground);
}
h2 { font-size: 1.125rem; line-height: 1.3; margin: 0 0 1rem; }
h3 { font-size: 1rem; margin: 0 0 0.5rem; }

a { color: var(--primary-text); text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

::selection { background: color-mix(in srgb, var(--primary) 35%, transparent); }

/* ---- Barre de navigation avec menu déroulant ---- */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

nav .logo { display: flex; align-items: center; }
nav .logo-wordmark { height: 26px; display: block; }
/* Le wordmark PNG est en blanc (pensé pour fond sombre) : inversé pour le thème clair,
   la rotation de teinte ramène le pictogramme à ses couleurs d'origine. */
nav .logo-wordmark { filter: invert(1) hue-rotate(180deg); }

.menu-wrap { position: relative; }
.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
  background: color-mix(in srgb, var(--input) 30%, transparent);
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  color: var(--foreground);
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  font-family: inherit;
}
.menu-btn:hover { background: var(--accent-surface); color: var(--foreground); }
.menu-btn .chevron { transition: transform 0.15s; font-size: 0.7rem; opacity: 0.7; }
.menu-wrap.open .menu-btn .chevron { transform: rotate(180deg); }

/* Menu déroulant = DropdownMenu shadcn */
nav .links {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: none;
  flex-direction: column;
  min-width: 220px;
  background: var(--popover);
  color: var(--popover-foreground);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.25rem;
  box-shadow: var(--shadow-lg);
  z-index: 10;
  transform-origin: top right;
}
.menu-wrap.open .links { display: flex; animation: popIn 0.12s ease-out; }

nav .links a {
  text-decoration: none;
  color: var(--foreground);
  font-size: 0.875rem;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-radius: calc(var(--radius) - 4px);
  transition: background 0.1s;
}
nav .links a:hover { background: var(--accent-surface); }
nav .links a.active { color: var(--primary-text); background: color-mix(in srgb, var(--primary) 10%, transparent); font-weight: 600; }
nav .links hr { border: none !important; border-top: 1px solid var(--border) !important; margin: 0.25rem -0.25rem !important; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ---- Card ---- */
.panel, .card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card-header { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.25rem; }
.card-title { font-size: 1.125rem; font-weight: 600; line-height: 1.3; margin: 0; }
.card-description { font-size: 0.875rem; color: var(--muted-foreground); margin: 0; }
.card-footer { display: flex; align-items: center; gap: 0.5rem; margin-top: 1.25rem; }

/* ---- Label ---- */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--foreground);
  margin: 1.1rem 0 0.5rem;
}
label:first-child { margin-top: 0; }

/* ---- Input / Select / Textarea ---- */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select,
textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  color: var(--foreground);
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.35rem;
  font-family: inherit;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--muted-foreground); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible,
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: var(--focus-ring);
}
input:disabled, select:disabled, textarea:disabled { opacity: 0.5; cursor: not-allowed; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--destructive);
}
input[type="file"] { padding: 0.35rem 0.5rem; cursor: pointer; }
input[type="file"]::file-selector-button {
  background: transparent; border: none; color: var(--foreground);
  font: inherit; font-weight: 500; margin-right: 0.75rem; cursor: pointer;
}
select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239FBDB0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 16px;
}
select option { background: var(--popover); color: var(--popover-foreground); }
textarea { resize: vertical; min-height: 72px; }

/* Case à cocher dessinée (Checkbox shadcn) : la case native, gris clair sur blanc,
   était à peine visible. Contour contrasté, coche sombre sur fond citron. */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  /* !important : plusieurs pages posent style="width:auto" en inline (héritage de
     l'époque où tous les input étaient en width:100%), qui écraserait la case à 0. */
  width: 1.125rem !important;
  height: 1.125rem !important;
  margin: 0;
  vertical-align: middle;
  border: 1.5px solid #8C8F89;
  border-radius: 5px;
  background: var(--card) center / 0.8rem no-repeat;
  cursor: pointer;
  transition: background-color 0.1s, border-color 0.1s;
}
input[type="checkbox"]:hover { border-color: var(--foreground); }
input[type="checkbox"]:checked {
  background-color: var(--primary);
  border-color: var(--primary-text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316181A' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
input[type="checkbox"]:focus-visible { outline: none; box-shadow: var(--focus-ring); }
input[type="checkbox"]:disabled { opacity: 0.5; cursor: not-allowed; }
input[type="radio"] {
  accent-color: var(--primary-text);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.row { display: flex; gap: 1rem; }
.row > * { flex: 1; }

/* ---- Button ----
   Variantes : (défaut) primaire, .secondary (= "outline" shadcn), .outline,
   .ghost, .destructive, .link — tailles : .sm, .lg, .icon */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  background: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.45rem 1rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  margin-top: 1.25rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
button:hover, .btn:hover { background: color-mix(in srgb, var(--primary) 88%, white); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
button:active, .btn:active { transform: translateY(0.5px); }

button.secondary, .btn.secondary,
button.outline, .btn.outline {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--input);
}
button.secondary:hover, .btn.secondary:hover,
button.outline:hover, .btn.outline:hover { background: var(--accent-surface); color: var(--foreground); }

button.ghost, .btn.ghost { background: transparent; color: var(--foreground); box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { background: var(--accent-surface); }

button.destructive, .btn.destructive { background: var(--destructive); color: #fff; }
/* Bouton plein sombre (action principale secondaire, ex. "Proposer une partie") */
button.dark, .btn.dark { background: var(--foreground); color: var(--background); }
button.dark:hover, .btn.dark:hover { background: color-mix(in srgb, var(--foreground) 85%, white); }
button.destructive:hover, .btn.destructive:hover { background: color-mix(in srgb, var(--destructive) 88%, black); }

button.link, .btn.link {
  background: transparent; color: var(--primary-text); box-shadow: none; padding-left: 0; padding-right: 0;
}
button.link:hover, .btn.link:hover { background: transparent; text-decoration: underline; }

button.sm, .btn.sm { padding: 0.3rem 0.75rem; font-size: 0.8125rem; gap: 0.35rem; }
button.lg, .btn.lg { padding: 0.6rem 1.5rem; font-size: 0.9375rem; }
button.icon, .btn.icon { padding: 0; width: 2.25rem; height: 2.25rem; }

button:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ---- Alert ---- */
.msg, .alert {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-top: 1rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
}
.msg.ok, .alert.ok { background: color-mix(in srgb, var(--primary) 8%, var(--card)); color: var(--primary-text); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.msg.err, .alert.err, .alert.destructive { background: color-mix(in srgb, var(--destructive) 8%, var(--card)); color: var(--destructive); border-color: color-mix(in srgb, var(--destructive) 40%, transparent); }
.alert-title { font-weight: 600; margin-bottom: 0.2rem; }
.alert-description { color: var(--muted-foreground); }

/* ---- Badge ---- */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.75rem; font-weight: 600; line-height: 1rem;
  padding: 0.125rem 0.5rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid transparent;
  background: var(--primary); color: var(--primary-foreground);
  white-space: nowrap;
}
.badge.secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge.outline { background: transparent; color: var(--foreground); border-color: var(--border); }
.badge.destructive { background: var(--destructive); color: #fff; }

/* ---- Divers (Separator, Skeleton, Kbd) ---- */
.separator { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.skeleton { background: var(--muted); border-radius: calc(var(--radius) - 2px); animation: skeletonPulse 1.6s ease-in-out infinite; }
@keyframes skeletonPulse { 50% { opacity: 0.5; } }
.kbd {
  display: inline-flex; align-items: center; font-family: ui-monospace, monospace; font-size: 0.75rem;
  padding: 0 0.35rem; min-height: 1.25rem; border-radius: 4px;
  background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border);
}
.text-muted { color: var(--muted-foreground); }

/* ---- Carte résultat de recherche : format "fiche joueur" ---- */
.match-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s;
}
.match-card:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.match-card .name { font-size: 1rem; font-weight: 600; }
.match-card .meta { color: var(--muted-foreground); font-size: 0.8125rem; margin-top: 2px; }
.match-card .distance {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  color: var(--primary-text);
  white-space: nowrap;
}
.match-card .distance small { font-family: 'Inter', sans-serif; font-size: 0.65rem; color: var(--muted-foreground); display: block; }
.match-card button { margin-top: 0; padding: 0.35rem 0.85rem; font-size: 0.8125rem; }

/* Carte d'événement (event-card.js) : infos à gauche, actions à droite, qui passent
   dessous plutôt que de déborder quand le texte est long. */
.event-card-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0.75rem; width: 100%; }
.event-card-info { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.event-card-row > .card-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
/* Description tronquée à 3 lignes : le texte complet est dans la modale "Voir" */
.event-card-desc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

/* Score de compatibilité (JUKO-49) */
.compat-score { text-align: center; white-space: nowrap; }
.compat-score-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  color: var(--primary-text);
  line-height: 1;
}
.compat-score-value small { font-size: 0.9rem; }
.match-reasons { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.reason-pill {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--primary-text);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: calc(var(--radius) - 4px);
  padding: 0.1rem 0.5rem;
  white-space: nowrap;
}

/* Confirmation post-activité (JUKO-39) */
.played-together-banner {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem;
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
}
.played-together-banner .card-actions { margin: 0; }
.played-together-banner button { margin-top: 0; padding: 0.3rem 0.75rem; font-size: 0.8125rem; }

.identity-bar {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  padding: 0.5rem 2rem;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}
.identity-bar b { color: var(--foreground); font-weight: 600; }
.identity-bar a { font-size: 0.8125rem; margin-left: 0.5rem; }

.hint { font-size: 0.8125rem; color: var(--muted-foreground); margin-top: 0.4rem; }

/* ---- Autocomplétion d'adresse (= Command/Combobox shadcn) ---- */
.addr-wrap { position: relative; }
.addr-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.25rem;
  max-height: 240px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: var(--shadow-lg);
}
.addr-option {
  padding: 0.45rem 0.6rem;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: calc(var(--radius) - 4px);
}
.addr-option:hover { background: var(--accent-surface); }
.addr-empty { cursor: default; color: var(--muted-foreground); }
.addr-empty:hover { background: transparent; }

/* ---- Actions sur une carte (modifier / supprimer) ---- */
.card-actions { display: flex; gap: 0.4rem; }
.card-actions button {
  margin-top: 0;
  padding: 0.3rem 0.7rem;
  font-size: 0.8125rem;
  background: color-mix(in srgb, var(--input) 30%, transparent);
  border: 1px solid var(--input);
  color: var(--foreground);
}
.card-actions .btn { margin-top: 0; padding: 0.3rem 0.7rem; font-size: 0.8125rem; }
.card-actions button:hover { background: var(--accent-surface); color: var(--foreground); }
.card-actions button.danger { color: var(--destructive); }
.card-actions button.danger:hover { background: color-mix(in srgb, var(--destructive) 12%, transparent); border-color: color-mix(in srgb, var(--destructive) 45%, transparent); }

/* ---- Modale d'édition (= Dialog shadcn, remplace les prompt() du navigateur) ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 16, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.15s ease-out; }
.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal-box { animation: popIn 0.18s ease-out; }
.modal-box h2 { margin-bottom: 1.1rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.modal-actions button { margin-top: 0; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ---- Avatar / photo de profil ---- */
.avatar-current {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border);
}
.avatar-section { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1.25rem; }
.avatar-preset-option:hover { border-color: var(--primary) !important; }
.avatar-preset-option.selected { border-color: var(--primary) !important; }
.avatar-upload-btn {
  display: inline-flex; align-items: center; margin: 0; padding: 0.45rem 1rem;
  font-size: 0.875rem; font-weight: 600;
  background: color-mix(in srgb, var(--input) 30%, transparent);
  border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px);
  color: var(--foreground); cursor: pointer; box-shadow: var(--shadow-xs);
}
.avatar-upload-btn:hover { background: var(--accent-surface); }

/* ---- Messagerie in-app (débloquée après acceptation) ---- */
.chat-box {
  display: none;
  margin-top: 0.9rem;
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
  width: 100%;
}
.chat-box.open { display: block; }
.chat-messages {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.chat-bubble {
  max-width: 75%;
  padding: 0.5rem 0.8rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.4;
}
.chat-bubble.mine { align-self: flex-end; background: var(--primary); color: var(--primary-foreground); border-bottom-right-radius: 4px; }
.chat-bubble.theirs { align-self: flex-start; background: var(--muted); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-bubble .chat-meta { font-size: 0.65rem; opacity: 0.7; margin-top: 2px; }
.chat-input-row { display: flex; gap: 0.5rem; }
.chat-input-row input { flex: 1; }
.chat-input-row button { margin-top: 0; }

/* ---- Bloc info mis en avant sur une demande reçue (sport, niveau, lieu, dispos) ---- */
.request-info-block {
  margin-top: 0.6rem;
  padding: 0.7rem 0.9rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.request-info-block b { color: var(--primary-text); font-weight: 600; }

/* ---- Proposition de créneau horaire dans le chat ---- */
.chat-bubble.slot-proposal {
  border: 1px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.slot-picker-row { display: flex; gap: 0.6rem; }
.slot-picker-row > * { flex: 1; }

/* ---- Responsive mobile ---- */
@media (max-width: 560px) {
  nav { padding: 0 1rem; height: 3.5rem; }
  .identity-bar { padding: 0.5rem 1rem; }
  main { padding: 1.5rem 1rem 3rem; }
  .panel, .card { padding: 1.25rem; }

  /* 16px minimum : évite le zoom automatique d'iOS au focus d'un champ */
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 1rem; }

  /* Les lignes à plusieurs colonnes (genre/naissance, jour/début/fin, date/places...)
     passent en une colonne empilée plutôt que de se tasser horizontalement. */
  .row { flex-direction: column; gap: 0.8rem; }

  /* Les cartes (résultats, demandes, événements) passent en colonne :
     avatar+infos en haut, actions (distance, boutons) en dessous. */
  .match-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .match-card .distance { align-self: flex-start; }
  .compat-score { align-self: flex-start; text-align: left; }
  .match-card .card-actions,
  .match-card > button {
    width: 100%;
    justify-content: flex-start;
  }
  .card-actions { flex-wrap: wrap; width: 100%; }
  .card-actions button, .card-actions .btn { flex: 1; min-width: 100px; }

  .avatar-section { flex-direction: column; align-items: flex-start; }
}

/* ---- Pages légales (CGU, confidentialité, mentions légales) ---- */
.legal-content { max-width: 720px; margin: 0 auto; line-height: 1.7; }
.legal-content h2 { font-size: 1.2rem; margin: 2rem 0 0.8rem; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li { color: var(--foreground); font-size: 0.92rem; }
.legal-content ul { padding-left: 1.3rem; }
.legal-content li { margin-bottom: 0.4rem; }
.legal-content .legal-note {
  background: var(--muted); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; font-size: 0.85rem; color: var(--muted-foreground); margin: 1rem 0;
}
.legal-content .updated { color: var(--muted-foreground); font-size: 0.82rem; margin-bottom: 2rem; }
.legal-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.85rem; }
.legal-content th, .legal-content td { border-bottom: 1px solid var(--border); padding: 0.55rem 0.7rem; text-align: left; }
.legal-content th { color: var(--muted-foreground); font-weight: 600; }

/* ---- Pages d'aide (guides pas à pas) ---- */
.guide-step { margin: 2.2rem 0; }
.guide-step h2 { display: flex; align-items: center; gap: 0.7rem; }
.guide-step .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: var(--primary-foreground); font-weight: 700; font-size: 0.95rem;
}
.guide-step img {
  max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border);
  margin: 0.8rem 0; display: block; box-shadow: var(--shadow-sm);
}
.guide-step img.narrow { max-width: 380px; }
.guide-note {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: calc(var(--radius) - 4px); padding: 0.8rem 1rem; margin: 0.8rem 0; font-size: 0.9rem;
}
.guide-note.warn { border-left-color: #E0A030; }

/* ---- Pied de page, présent sur toutes les pages (mentions légales toujours accessibles) ---- */
.site-footer {
  text-align: center; padding: 2rem 1rem; margin-top: 3rem;
  border-top: 1px solid var(--border); font-size: 0.8125rem; color: var(--muted-foreground);
}
.site-footer a { color: var(--muted-foreground); margin: 0 0.6rem; text-decoration: none; }
.site-footer a:hover { color: var(--foreground); text-decoration: underline; }

/* ---- Badge "membres" agrégé (pas une liste) ---- */
.stat-badge {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--muted); border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px);
  padding: 0.7rem 1.2rem; min-width: 90px; flex-shrink: 0;
}
.stat-badge .stat-number { font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; color: var(--primary-text); line-height: 1; }
.stat-badge .stat-label { font-size: 0.7rem; color: var(--muted-foreground); margin-top: 0.2rem; }

.stat-badge-compact {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.8125rem; color: var(--muted-foreground);
}
.stat-badge-compact b { color: var(--primary-text); }

/* ---- Bande de dates compacte (page club) — remplace un calendrier mensuel complet ---- */
.date-pill-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.date-pill {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: var(--radius); background: var(--muted);
  border: 1px solid var(--border); cursor: pointer; flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}
.date-pill:hover { border-color: var(--primary-text); background: var(--accent-surface); }
.date-pill-day { font-family: 'Bebas Neue', sans-serif; font-size: 1.3rem; color: var(--primary-text); line-height: 1; }
.date-pill-month { font-size: 0.65rem; text-transform: uppercase; color: var(--muted-foreground); margin-top: 0.15rem; letter-spacing: 0.03em; }

/* ---- QR code : fond clair imposé par la lib, cadre pour rester lisible sur thème sombre ---- */
#qrCodeContainer { background: #F2F6F0; padding: 10px; border-radius: 8px; display: inline-block; line-height: 0; }

/* ---- Bannière de couverture (fiche club) ---- */
.club-cover {
  height: 160px; margin: -1.5rem -1.5rem 0; border-radius: calc(var(--radius) + 3px) calc(var(--radius) + 3px) 0 0;
  background-size: cover; background-position: center; position: relative; overflow: hidden;
}
.club-cover-fallback {
  background: linear-gradient(135deg, var(--background) 0%, var(--muted) 60%, #3A6B4A 100%);
}
.club-cover-fallback::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(198,241,53,0.15), transparent 50%);
}
.club-header-content { position: relative; padding-top: 0.75rem; }
.club-logo-overlap {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--card); position: relative; top: -38px; margin-bottom: -22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35); background: var(--muted); flex-shrink: 0;
}
@media (max-width: 560px) {
  .club-cover { margin: -1.25rem -1.25rem 0; }
}

/* ---- Stack d'avatars superposés (membres d'un club) ---- */
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack img {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--card); margin-left: -10px; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.avatar-stack img:first-child { margin-left: 0; }
.avatar-stack .avatar-stack-more {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--card); margin-left: -10px;
  background: var(--muted); color: var(--muted-foreground); font-size: 0.72rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar-stack-compact img {
  width: 22px; height: 22px; margin-left: -7px; border-width: 1.5px;
}
.avatar-stack-compact .avatar-stack-more { width: 22px; height: 22px; margin-left: -7px; font-size: 0.6rem; border-width: 1.5px; }

/* ---- Animation d'apparition progressive de la page, de haut en bas ---- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* 1. Titre de page en premier */
  main > h1:first-of-type { animation: fadeInUp 0.4s ease both; }

  /* 2. Panneaux (formulaires, blocs d'info) juste après, légèrement décalés entre eux */
  .panel { animation: fadeInUp 0.5s ease both; }
  .panel:nth-of-type(1) { animation-delay: 0.08s; }
  .panel:nth-of-type(2) { animation-delay: 0.14s; }
  .panel:nth-of-type(3) { animation-delay: 0.2s; }
  .panel:nth-of-type(n+4) { animation-delay: 0.26s; }

  /* 3. Cartes en dernier, décalage démarrant après le titre/les panneaux */
  .match-card { animation: fadeInUp 0.6s ease both; }
  .match-card:nth-child(1) { animation-delay: 0.2s; }
  .match-card:nth-child(2) { animation-delay: 0.28s; }
  .match-card:nth-child(3) { animation-delay: 0.36s; }
  .match-card:nth-child(4) { animation-delay: 0.44s; }
  .match-card:nth-child(5) { animation-delay: 0.52s; }
  .match-card:nth-child(6) { animation-delay: 0.6s; }
  .match-card:nth-child(n+7) { animation-delay: 0.65s; }
}

/* ---- Bannière illustrée en hauteur fixe, page de connexion uniquement ---- */
/* (un fond en background-size:cover sur toute la hauteur de la page zoomait trop et ne
   laissait voir que le centre de l'image — une bannière bornée règle le problème) */
body.auth-bg { background: var(--background); }
body.auth-bg nav { display: none; }
.auth-hero {
  height: 340px;
  background-image:
    linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.35) 70%, var(--background) 100%),
    url('/images/auth-bg.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  margin-bottom: -1.5rem; /* chevauche légèrement le premier panneau pour un raccord net */
}
/* Sur petit écran, l'image portrait cadre bien mieux (moins de recadrage latéral) */
@media (max-width: 560px) {
  .auth-hero {
    height: 460px;
    background-image:
      linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.35) 75%, var(--background) 100%),
      url('/images/auth-bg-portrait.jpg');
    background-position: center top;
  }
}
body.auth-bg main { padding-top: 2rem; }

/* ---- Badges d'ambiance : sélecteur (formulaires) et affichage (fiche club) ---- */
.vibe-tags-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.vibe-tag-option {
  display: flex; align-items: center; gap: 0.45rem; margin: 0;
  font-size: 0.8125rem; font-weight: 500;
  background: color-mix(in srgb, var(--input) 30%, transparent);
  border: 1px solid var(--input); border-radius: 999px;
  padding: 0.35rem 0.8rem; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.vibe-tag-option:hover { background: var(--accent-surface); }
.vibe-tag-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary-text);
}
.vibe-tag-option input { width: auto; }
.vibe-badge {
  display: inline-block; font-size: 0.75rem; font-weight: 500; background: var(--muted); color: var(--primary-text);
  border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px); padding: 0.15rem 0.55rem; margin: 0 0.4rem 0.4rem 0;
}

/* ---- Prochain événement en vedette ---- */
.featured-event {
  display: flex; align-items: center; gap: 1.2rem; background: var(--card);
  border: 1px solid color-mix(in srgb, var(--primary) 55%, transparent); border-radius: calc(var(--radius) + 4px);
  padding: 1.25rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm);
}
.featured-event .featured-countdown {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.6rem; color: var(--primary-text);
  background: var(--background); border-radius: var(--radius); padding: 0.6rem 1rem; text-align: center; flex-shrink: 0; min-width: 90px;
}
.featured-event .featured-countdown small { display: block; font-family: 'Inter', sans-serif; font-size: 0.6rem; color: var(--muted-foreground); text-transform: uppercase; margin-top: 0.2rem; }

/* ---- Fil d'activité récente ---- */
.activity-feed { display: flex; flex-direction: column; gap: 0.7rem; }
.activity-item { display: flex; align-items: center; gap: 0.6rem; font-size: 0.875rem; color: var(--muted-foreground); }
.activity-item .activity-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.activity-item .activity-time { color: var(--muted-foreground); font-size: 0.75rem; margin-left: auto; flex-shrink: 0; }

/* ---- Galerie photo ---- */
.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.6rem; }
.photo-gallery-item { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; }
.photo-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-gallery-item .photo-delete-btn {
  position: absolute; top: 4px; right: 4px; margin: 0; padding: 0; background: rgba(0,0,0,0.6); color: #fff; border: none;
  border-radius: 50%; width: 22px; height: 22px; font-size: 0.8rem; cursor: pointer; line-height: 1; box-shadow: none;
}
.photo-gallery-add {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: var(--radius);
  border: 2px dashed var(--border); color: var(--muted-foreground); cursor: pointer; font-size: 1.8rem;
}
.photo-gallery-add:hover { border-color: var(--primary-text); color: var(--primary-text); }

/* Sélecteur de zone (JUKO-51) */
.zone-status-ok { color: var(--primary-text); }
.zone-status-err { color: #e0554c; }

/* ---- Détails propres au sport (escalade : bloc/voie, cotations...), préférences ---- */
.sport-details-form .sport-detail-field { margin-top: 0.4rem; }
.sport-detail-checks { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.2rem 0 0.4rem; }
.sport-detail-check { display: flex; align-items: center; gap: 0.4rem; text-transform: none; font-size: 0.9rem; font-weight: 400; cursor: pointer; margin: 0; }
.sport-detail-check input { width: auto; margin: 0; }
