/* ============================================================
   303 vers le Nord — Feuille de style principale
   ============================================================ */

:root {
  --nord:   #1a3a4a;
  --route:  #c8a96e;
  --vie:    #4a7c4e;
  --fond:   #f5f0e8;
  --texte:  #2a2a2a;
  --card:   #ffffff;
  --muted:  #9bb5c4;
  --rouge:  #7a2020;
  --radius: 8px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.6;
}

a { color: var(--route); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Conteneur ─────────────────────────────────────────────── */
.container {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  background: var(--nord);
  color: var(--card);
  padding: 28px 16px 20px;
  text-align: center;
  position: relative;
  overflow: visible;
}

.header-refuge-logo {
  position: absolute;
  top: 50%;
  left: 32px;
  transform: translateY(-50%);
}

.logo-refuge {
  display: block;
  height: auto;
  max-height: 84px;
  width: auto;
  max-width: 223px;
  filter: brightness(0) invert(1);
}

.logos-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
}

.logo-medallion {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--route);
  background: var(--card);
}

.logo-fallback {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--route);
  background: var(--nord);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
  padding: 6px;
}

.logos-sep {
  font-size: 22px;
  color: var(--muted);
  font-weight: 300;
}

.site-header h1 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--card);
  margin-bottom: 4px;
}

.site-header .subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.badge-dossard {
  display: inline-block;
  background: var(--route);
  color: var(--nord);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ── Bannière Instagram ─────────────────────────────────────── */
.instagram-banner {
  background: #112b39;
  color: var(--muted);
  text-align: center;
  padding: 10px 16px;
  font-size: 0.875rem;
}

.instagram-banner a {
  color: var(--route);
  font-weight: 600;
}

/* ── Sections ───────────────────────────────────────────────── */
.section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin: 18px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--nord);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--route);
}

/* ── Stats ──────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--fond);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--nord);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.72rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ── Barre de progression ───────────────────────────────────── */
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 6px;
}

.progress-track {
  background: var(--nord);
  border-radius: var(--radius);
  height: 20px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  background: var(--route);
  height: 100%;
  border-radius: var(--radius);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  position: relative;
  overflow: hidden;
}

/* Shimmer permanent */
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 100%
  );
  animation: shimmer 2.4s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { left: -60%; }
  100% { left: 160%; }
}

/* Flash doré déclenché par JS quand les km changent */
@keyframes km-update {
  0%   { box-shadow: 0 0 0 0 rgba(200, 169, 110, 0); }
  30%  { box-shadow: 0 0 0 6px rgba(200, 169, 110, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(200, 169, 110, 0.2); }
  100% { box-shadow: 0 0 0 0 rgba(200, 169, 110, 0); }
}

.progress-fill.km-updated {
  animation: km-update 1s ease-out forwards;
}

.progress-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--nord);
  white-space: nowrap;
  padding: 0 6px;
  position: relative; /* passe au-dessus du shimmer */
  z-index: 1;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #666;
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 4px;
}

.progress-info strong {
  color: var(--nord);
}

/* ── Tracé de route ─────────────────────────────────────────── */
.route-section {
  background: #0d1f2d;
  border: 2px solid var(--route);
  border-radius: var(--radius);
  padding: 20px;
  margin: 18px 0;
  color: var(--card);
}

.route-inner {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.route-map {
  flex-shrink: 0;
  width: 155px;
  border-radius: 6px;
  object-fit: cover;
}

.route-map-placeholder {
  flex-shrink: 0;
  width: 155px;
  height: 220px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  border: 1px dashed rgba(200,169,110,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding: 8px;
}

.waypoints-list {
  flex: 1;
  list-style: none;
  position: relative;
}

.waypoints-list::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 24px;
  bottom: 24px;
  width: 1px;
  border-left: 2px dashed rgba(200,169,110,0.35);
}

.waypoint-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  position: relative;
}

.waypoint-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--route);
  flex-shrink: 0;
  z-index: 1;
  border: 2px solid #0d1f2d;
}

.waypoint-info {
  flex: 1;
}

.waypoint-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--card);
}

.waypoint-km {
  font-size: 0.75rem;
  color: var(--muted);
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-depart    { background: rgba(200,169,110,0.2); color: var(--route); }
.badge-franchi   { background: rgba(74,124,78,0.25);  color: #7ec982; }
.badge-avenir    { background: rgba(26,58,74,0.5);    color: var(--muted); }
.badge-objectif  { background: rgba(122,32,32,0.3);   color: #e08080; }

.route-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
  letter-spacing: 0.5px;
}

/* ── Formulaire ─────────────────────────────────────────────── */
.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.quick-btn {
  background: var(--fond);
  border: 1.5px solid var(--route);
  color: var(--nord);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.quick-btn:hover,
.quick-btn.active {
  background: var(--route);
  color: var(--nord);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--nord);
  margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
  border: 1.5px solid #d0c8b8;
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 0.9rem;
  color: var(--texte);
  background: var(--card);
  transition: border-color 0.15s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--route);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--route);
}

.checkbox-row label {
  font-size: 0.85rem;
  margin-bottom: 0;
  font-weight: 400;
  cursor: pointer;
}

.estimation-block {
  background: var(--fond);
  border-left: 3px solid var(--route);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: #555;
}

.estimation-block strong {
  color: var(--nord);
  font-size: 1rem;
}

.btn-submit {
  display: block;
  width: 100%;
  background: var(--nord);
  color: var(--route);
  border: none;
  border-radius: var(--radius);
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s;
}

.btn-submit:hover { background: #0f2535; }

.form-message {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  display: none;
}

.form-message.success {
  background: rgba(74,124,78,0.12);
  border: 1px solid var(--vie);
  color: #2d5a30;
  display: block;
}

.form-message.error {
  background: rgba(122,32,32,0.1);
  border: 1px solid var(--rouge);
  color: var(--rouge);
  display: block;
}

/* ── Liste supporters ───────────────────────────────────────── */
.supporters-list {
  list-style: none;
}

.supporter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #f0ebe0;
  font-size: 0.9rem;
}

.supporter-item:last-child { border-bottom: none; }

.supporter-name { color: var(--nord); font-weight: 500; }

.supporter-amount {
  color: var(--vie);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.btn-more {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--route);
  cursor: pointer;
  background: none;
  border: 1.5px solid var(--route);
  border-radius: 20px;
  padding: 6px 18px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.btn-more:hover { background: rgba(200,169,110,0.1); }

/* ── Partage social ─────────────────────────────────────────── */
.share-section {
  text-align: center;
}

.share-intro {
  font-size: 0.88rem;
  color: #666;
  margin-bottom: 18px;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.share-btn:hover {
  transform: translateY(-2px);
  opacity: 0.92;
  text-decoration: none;
}

.share-whatsapp {
  background: #25D366;
  color: #fff;
}

.share-facebook {
  background: #1877F2;
  color: #fff;
}

.share-copy {
  background: var(--fond);
  color: var(--nord);
  border: 1.5px solid var(--route);
}

.share-copy.copied {
  background: var(--vie);
  color: #fff;
  border-color: var(--vie);
}

/* ── Bloc Refuge ────────────────────────────────────────────── */
.refuge-block {
  background: #1a3a4a;
  color: var(--card);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin: 18px 0;
}

.refuge-block h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--route);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.refuge-block p {
  font-size: 0.88rem;
  color: #c5d9e4;
  margin-bottom: 10px;
  line-height: 1.65;
}

.refuge-block a { color: var(--route); }

.iban-block {
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 12px;
  font-family: monospace;
  letter-spacing: 0.5px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--nord);
  color: var(--muted);
  text-align: center;
  padding: 20px 16px;
  font-size: 0.8rem;
  margin-top: 32px;
}

.site-footer a { color: var(--route); }
.site-footer .footer-links { margin-bottom: 8px; display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-value { font-size: 1.25rem; }
  .route-inner { flex-direction: column; }
  .route-map, .route-map-placeholder { width: 100%; height: 160px; }
  .waypoints-list::before { left: 8px; }
}

@media (min-width: 660px) {
  .container { padding: 0 0; }
}
