/* ============================================
   AW SERVICES — Design System
   Palette, typographie et composants partages
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* Couleurs */
  --fond: #12142B;
  --surface: #1C1F45;
  --surface-haute: #242867;
  --bordure: #33366B;
  --accent: #F2A93B;
  --accent-fonce: #C6841F;
  --alerte: #E8483A;
  --succes: #3FA34D;
  --texte: #F5F1E8;
  --texte-doux: #9B98C4;
  --texte-discret: #6E6B9A;

  /* Typographie */
  --police-titre: 'Space Grotesk', sans-serif;
  --police-texte: 'Inter', sans-serif;
  --police-chiffres: 'Space Mono', monospace;

  /* Espacements */
  --espace-xs: 6px;
  --espace-sm: 10px;
  --espace-md: 16px;
  --espace-lg: 24px;
  --espace-xl: 40px;

  /* Rayons et ombres */
  --rayon: 14px;
  --rayon-petit: 8px;
  --ombre-accent: 0 4px 20px rgba(242, 169, 59, 0.18);
  --ombre-carte: 0 2px 12px rgba(0, 0, 0, 0.35);
}

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

body {
  font-family: var(--police-texte);
  background-color: var(--fond);
  color: var(--texte);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--police-titre);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.chiffre, .prix, .montant {
  font-family: var(--police-chiffres);
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }

/* ---------- En-tete simple (pages secondaires) ---------- */
.aw-header {
  background-color: var(--surface);
  padding: var(--espace-lg) var(--espace-md);
  text-align: center;
  border-bottom: 1px solid var(--bordure);
  position: relative;
}
.aw-header h1 { font-size: 22px; color: var(--texte); }
.aw-header p { color: var(--accent); font-size: 13px; margin-top: var(--espace-xs); font-weight: 500; }

/* ---------- Separateur tisse (signature) ---------- */
.diviseur-tisse {
  height: 10px;
  background-image: repeating-linear-gradient(
    135deg,
    var(--accent) 0px, var(--accent) 3px,
    transparent 3px, transparent 9px
  );
  opacity: 0.35;
  margin: var(--espace-lg) 0;
}

/* ---------- Cartes ---------- */
.aw-carte {
  background-color: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: var(--espace-lg);
  box-shadow: var(--ombre-carte);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.aw-carte:active { transform: scale(0.98); }
.aw-carte h2, .aw-carte h3 { color: var(--texte); margin-bottom: var(--espace-sm); }
.aw-carte p { color: var(--texte-doux); font-size: 14px; }

.aw-carte-module {
  background-color: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: var(--espace-lg) var(--espace-md);
  text-align: center;
  text-decoration: none;
  display: block;
  position: relative;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.aw-carte-module:active { transform: scale(0.97); }
.aw-carte-module h2 { color: var(--texte); font-size: 16px; margin-bottom: 6px; }
.aw-carte-module p { color: var(--texte-doux); font-size: 12.5px; }
.aw-carte-module .icone { font-size: 27px; margin-bottom: 8px; display: block; }

.aw-carte-module-large {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 20px;
}
.aw-carte-module-large .icone { font-size: 34px; margin-bottom: 0; }
.aw-carte-module-large h2 { font-size: 18px; margin-bottom: 3px; }

.aw-badge-coin {
  position: absolute;
  top: -8px;
  right: 10px;
  background-color: var(--alerte);
  color: var(--texte);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.aw-badge-coin.populaire { background-color: var(--accent); color: #1C1200; }

/* ---------- Boutons ---------- */
.aw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--police-texte);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--rayon-petit);
  padding: 13px 20px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  text-decoration: none;
}
.aw-btn:active { transform: scale(0.97); }
.aw-btn-primaire { background-color: var(--accent); color: #1C1200; box-shadow: var(--ombre-accent); }
.aw-btn-secondaire { background-color: transparent; color: var(--texte); border: 1px solid var(--bordure); }
.aw-btn-alerte { background-color: transparent; color: var(--alerte); border: 1px solid var(--alerte); }
.aw-btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- Badges de statut ---------- */
.aw-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--police-texte);
}
.aw-badge-attente { background-color: rgba(242, 169, 59, 0.15); color: var(--accent); }
.aw-badge-succes { background-color: rgba(63, 163, 77, 0.15); color: var(--succes); }
.aw-badge-alerte { background-color: rgba(232, 72, 58, 0.15); color: var(--alerte); }

/* ---------- Formulaires ---------- */
.aw-label { display: block; font-size: 13px; color: var(--texte-doux); margin-top: var(--espace-md); margin-bottom: 6px; font-weight: 500; }
.aw-input, .aw-select, .aw-textarea {
  width: 100%;
  background-color: var(--fond);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-petit);
  padding: 12px;
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: 14px;
  transition: border-color 0.15s ease;
}
.aw-input:focus, .aw-select:focus, .aw-textarea:focus { outline: none; border-color: var(--accent); }

/* ---------- Titres de section ---------- */
.aw-section-titre {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  color: var(--texte);
  margin-bottom: var(--espace-md);
}
.aw-section-titre::before {
  content: "";
  width: 4px;
  height: 18px;
  background-color: var(--accent);
  border-radius: 2px;
  display: inline-block;
}

/* ---------- Utilitaires ---------- */
.aw-conteneur { max-width: 600px; margin: 0 auto; padding: var(--espace-md); }
.aw-texte-doux { color: var(--texte-doux); }
.aw-texte-accent { color: var(--accent); }

/* ---------- Hero ---------- */
.aw-hero {
  background: radial-gradient(circle at 30% 15%, var(--surface-haute) 0%, var(--fond) 65%);
  padding: var(--espace-xl) var(--espace-md) var(--espace-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.aw-hero-eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--espace-sm);
}
.aw-hero h1 { font-size: 28px; line-height: 1.2; margin-bottom: var(--espace-sm); }
.aw-hero h1 span { color: var(--accent); }
.aw-hero p.sous-titre {
  color: var(--texte-doux);
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto var(--espace-lg);
}

/* ---------- Barre de recherche ---------- */
.aw-recherche {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  padding: 12px 18px;
  max-width: 420px;
  margin: 0 auto;
}
.aw-recherche svg { flex-shrink: 0; opacity: 0.6; }
.aw-recherche input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: 14px;
}
.aw-recherche input::placeholder { color: var(--texte-discret); }

/* ---------- Bandeau statistiques (defilement) ---------- */
.aw-stats-scroll {
  display: flex;
  gap: var(--espace-sm);
  overflow-x: auto;
  padding: var(--espace-md);
  scrollbar-width: none;
  background-color: var(--surface);
  border-top: 1px solid var(--bordure);
  border-bottom: 1px solid var(--bordure);
}
.aw-stats-scroll::-webkit-scrollbar { display: none; }
.aw-stat-pastille {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--fond);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  padding: 9px 16px;
  white-space: nowrap;
}
.aw-stat-pastille .icone { font-size: 15px; }
.aw-stat-pastille .chiffre { color: var(--accent); font-size: 13px; font-weight: 700; }
.aw-stat-pastille .label { color: var(--texte-doux); font-size: 11px; margin-left: 2px; }

/* ---------- Animation d'entree ---------- */
@keyframes awApparition {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.aw-anim { animation: awApparition 0.5s ease both; }
.aw-anim:nth-child(1) { animation-delay: 0.02s; }
.aw-anim:nth-child(2) { animation-delay: 0.08s; }
.aw-anim:nth-child(3) { animation-delay: 0.14s; }
.aw-anim:nth-child(4) { animation-delay: 0.20s; }
.aw-anim:nth-child(5) { animation-delay: 0.26s; }
.aw-anim:nth-child(6) { animation-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .aw-anim { animation: none; opacity: 1; }
}

/* ---------- Navigation basse (style app) ---------- */
.aw-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background-color: var(--surface);
  border-top: 1px solid var(--bordure);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}
.aw-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--texte-discret);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
}
.aw-nav-item .icone { font-size: 19px; }
.aw-nav-item.actif { color: var(--accent); }
body.aw-avec-nav-bas { padding-bottom: 74px; }
