/* ==========================================================================
   ColocMatch — Design system
   Palette : blanc / bleu / gris clair, coins arrondis, mode sombre.
   Typo : Sora (display) + Inter (texte courant).
   ========================================================================== */

:root {
  /* Couleurs — mode clair */
  --color-bg: #ffffff;
  --color-bg-soft: #f5f7fa;
  --color-surface: #ffffff;
  --color-border: #e4e8ee;
  --color-text: #14181f;
  --color-text-muted: #5b6472;
  --color-primary: #2f6fed;
  --color-primary-dark: #1f52c4;
  --color-primary-soft: #eaf1ff;
  --color-success: #1f9d55;
  --color-danger: #e0433d;
  --color-warning: #d98b1f;

  /* Signature : dégradé "rencontre" utilisé sur le hero et les avatars superposés */
  --gradient-match: linear-gradient(135deg, #2f6fed 0%, #6fa4ff 55%, #bcd6ff 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 3px rgba(20, 24, 31, 0.06), 0 1px 2px rgba(20, 24, 31, 0.04);
  --shadow-md: 0 8px 24px rgba(20, 24, 31, 0.08);
  --shadow-lg: 0 20px 48px rgba(20, 24, 31, 0.14);

  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --header-h: 72px;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --color-bg: #0f1420;
  --color-bg-soft: #161c2b;
  --color-surface: #1a2233;
  --color-border: #2a3348;
  --color-text: #edf1f8;
  --color-text-muted: #9aa5b8;
  --color-primary: #6fa4ff;
  --color-primary-dark: #8fb8ff;
  --color-primary-soft: #1c2c4d;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }

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

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  color: inherit;
}

button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---- Boutons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-primary-dark); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-bg-soft); color: var(--color-text); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---- Champs de formulaire ---- */
.field { margin-bottom: 18px; text-align: left; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-soft);
  outline: none;
}
.field textarea { resize: vertical; min-height: 100px; }
.field-error { color: var(--color-danger); font-size: 0.8rem; margin-top: 4px; display: none; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--color-danger); }
.field.has-error .field-error { display: block; }
.field-hint { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* ---- Cartes ---- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

/* ---- En-tête / navigation ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.logo-mark {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  background: var(--gradient-match);
  position: relative;
  flex-shrink: 0;
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  mix-blend-mode: normal;
  opacity: 0.18;
}

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  transition: background var(--transition), color var(--transition);
}
.main-nav a:hover, .main-nav a.active { background: var(--color-bg-soft); color: var(--color-text); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.theme-toggle:hover { background: var(--color-bg-soft); }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle {
    display: flex; width: 40px; height: 40px; align-items: center; justify-content: center;
    border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface);
  }
}

/* ---- Pied de page ---- */
.site-footer {
  background: var(--color-bg-soft);
  border-top: 1px solid var(--color-border);
  padding: 48px 0 24px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}
.footer-grid h4 { font-size: 0.85rem; margin-bottom: 14px; }
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-grid ul a { color: var(--color-text-muted); font-size: 0.9rem; transition: color var(--transition); }
.footer-grid ul a:hover { color: var(--color-primary); }
.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 0.82rem; color: var(--color-text-muted);
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Toast / notifications ---- */
.toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 340px;
}
.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  animation: toast-in 220ms ease;
}
.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Spinner ---- */
.spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 3px solid var(--color-primary-soft);
  border-top-color: var(--color-primary);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-new { background: var(--color-primary-soft); color: var(--color-primary-dark); }
.badge-verified { background: #e6f7ec; color: var(--color-success); }
[data-theme="dark"] .badge-verified { background: #123320; }

/* ---- Skeleton loading ---- */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-soft) 25%, var(--color-border) 50%, var(--color-bg-soft) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- Fade-in au scroll ---- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 480ms ease, transform 480ms ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---- Utilitaires d'état vide ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}
.empty-state .icon { font-size: 2.4rem; margin-bottom: 10px; }
