/* SOS COMPAGNON - Association | Design crème + arc-en-ciel */

:root {
  /* ===== Palette arc-en-ciel ===== */
  --c-red:    #e8304a;
  --c-orange: #f97316;
  --c-yellow: #f59e0b;
  --c-green:  #16a34a;
  --c-blue:   #2563eb;
  --c-indigo: #6366f1;
  --c-violet: #9333ea;

  /* ===== Dégradés arc-en-ciel ===== */
  --rainbow: linear-gradient(90deg, var(--c-red), var(--c-orange), var(--c-yellow), var(--c-green), var(--c-blue), var(--c-indigo), var(--c-violet));
  --rainbow-diag: linear-gradient(135deg, var(--c-red), var(--c-orange), var(--c-yellow), var(--c-green), var(--c-blue), var(--c-violet));

  /* ===== Accent principal ===== */
  --accent:       #6366f1;
  --accent-light: #818cf8;
  --accent-dark:  #4f46e5;

  /* ===== Surfaces crème ===== */
  --bg:            #fdf8f0;   /* crème principale */
  --bg-warm:       #faf3e8;   /* crème légèrement plus foncée */
  --bg-card:       #ffffff;   /* cartes blanches */
  --bg-card-alt:   #fff9f0;   /* cartes crème douce */
  --border:        rgba(0,0,0,0.08);
  --border-hover:  rgba(0,0,0,0.18);

  /* ===== Texte (sombre sur fond clair) ===== */
  --text:       #1a1410;
  --text-muted: #6b5e52;
  --text-dim:   #a8968a;

  /* ===== Ombres douces ===== */
  --shadow:    0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.12);

  /* ===== Radius ===== */
  --radius:    12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== Arc-en-ciel utilitaires ===== */
.rainbow-text {
  background: var(--rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rainbow-bar {
  height: 4px;
  background: var(--rainbow);
  border-radius: 99px;
}

.rainbow-border {
  position: relative;
}
.rainbow-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--rainbow-diag);
  z-index: -1;
}

/* ===== Layout ===== */
.container    { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 760px;  margin: 0 auto; padding: 0 20px; }

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253,248,240,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  /* Barre arc-en-ciel en haut du header */
  box-shadow: 0 -4px 0 0 transparent, inset 0 -1px 0 var(--border);
}

/* Barre arc-en-ciel sous le header */
.site-header::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0; right: 0;
  height: 3px;
  background: var(--rainbow);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
}

.nav-logo .logo-badge {
  background: var(--rainbow-diag);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-links a {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--bg-warm);
}

.nav-cta {
  background: var(--rainbow-diag) !important;
  color: #fff !important;
  padding: 8px 20px !important;
  border-radius: 99px !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 12px rgba(99,102,241,0.25) !important;
  transition: opacity 0.2s, transform 0.15s !important;
}
.nav-cta:hover { opacity: 0.88 !important; transform: translateY(-1px) !important; }

/* Mobile burger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    gap: 4px;
    z-index: 99;
  }
}

/* ===== Hero ===== */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--text);
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Boutons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 99px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--rainbow-diag);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.25);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
}
.btn-secondary:hover { border-color: var(--accent); }

.btn-danger  { background: var(--c-red);   color: #fff; }
.btn-success { background: var(--c-green); color: #fff; }

.btn-sm { padding: 7px 16px; font-size: 0.82rem; }

/* ===== Stats bar ===== */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 28px 0;
  margin: 32px 0;
  flex-wrap: wrap;
  /* Bande arc-en-ciel en bas */
  border-bottom: 3px solid transparent;
  border-image: var(--rainbow) 1;
  border-top: 1px solid var(--border);
}

.stat-item { text-align: center; }
.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  display: block;
}
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; font-weight: 500; }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}
.card:hover {
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-lg);
}

/* Trait arc-en-ciel en haut de chaque card au hover */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--rainbow);
  opacity: 0;
  transition: opacity 0.2s;
}
.card { position: relative; }
.card:hover::before { opacity: 1; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ===== Animal card ===== */
.animal-card { cursor: pointer; }

.animal-card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-warm);
}
.animal-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.animal-card:hover .animal-card-img img { transform: scale(1.05); }

.animal-card-body { padding: 16px; background: var(--bg-card); }

.animal-card-name  { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.animal-card-meta  { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }

/* ===== Badges statut ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-lost     { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge-found    { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.badge-sighting { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.badge-pending  { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }

/* ===== Formulaires ===== */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  min-height: 48px;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-control::placeholder { color: var(--text-dim); }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }

/* ===== Sections ===== */
.section    { padding: 60px 0; }
.section-sm { padding: 32px 0; }

.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.section-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

/* Section alternée avec fond crème chaude */
.section-warm {
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ===== Séparateur arc-en-ciel ===== */
.rainbow-divider {
  height: 3px;
  background: var(--rainbow);
  border: none;
  margin: 0;
}

/* ===== Carte Leaflet ===== */
#map {
  width: 100%;
  height: 520px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg-warm);
  box-shadow: var(--shadow);
}

/* ===== Progress bar don ===== */
.progress-bar-wrap {
  background: #ede9fe;
  border-radius: 99px;
  height: 14px;
  overflow: hidden;
  margin: 12px 0;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--rainbow);
  transition: width 1.2s ease;
}

/* ===== Boutons montant don ===== */
.don-amounts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }

.don-amount-btn {
  padding: 10px 22px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}
.don-amount-btn:hover,
.don-amount-btn.selected {
  border-color: var(--accent);
  background: #ede9fe;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}

/* ===== Galerie nos-actions ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
}
.gallery-item:hover {
  border-color: transparent;
  transform: scale(1.02);
  outline: 3px solid;
  outline-color: var(--c-indigo);
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.08); }

/* ===== Footer ===== */
.site-footer {
  border-top: 3px solid transparent;
  border-image: var(--rainbow) 1;
  padding: 40px 0 24px;
  margin-top: 80px;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--bg-warm);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

/* ===== Alertes ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 16px;
  border-left: 4px solid;
}
.alert-success { background: #f0fdf4; border-color: var(--c-green); color: #15803d; }
.alert-error   { background: #fff1f2; border-color: var(--c-red);   color: #be123c; }
.alert-info    { background: #eff6ff; border-color: var(--c-blue);  color: #1d4ed8; }

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .stats-bar   { gap: 24px; }
  .hero        { padding: 48px 0 36px; }
  .section     { padding: 40px 0; }
}
