/* ── Briques réutilisables ────────────────────────────────────────────── */

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  background: #fff;
  border: 1px solid var(--line);
  transition: transform .08s, box-shadow .15s, background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 19px; height: 19px; flex: none; }

.btn--primary {
  background: var(--grad-brand);
  color: #fff;
  border: none;
  box-shadow: 0 6px 18px rgba(40, 120, 200, .28);
}
.btn--pink {
  background: var(--grad-pink);
  color: #fff;
  border: none;
  box-shadow: 0 6px 18px rgba(233, 30, 140, .28);
}
.btn--green { background: var(--grad-green); color: #fff; border: none; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--blue); }
.btn--soft { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
.btn--danger { background: var(--red-soft); border-color: #F6C9C9; color: var(--red); }
.btn--block { width: 100%; }
.btn--sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: var(--r-sm); }
.btn--lg { height: 54px; font-size: 16px; border-radius: var(--r-lg); }

.iconbtn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  position: relative;
  transition: background .15s;
}
.iconbtn:hover { background: var(--blue-soft); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn .dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--pink);
  border: 1.5px solid #fff;
}
.iconbtn .badge {
  position: absolute;
  top: 3px; right: 2px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  border: 2px solid #fff;
  box-sizing: content-box;
}

/* Cartes */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 18px;
}
.card + .card { margin-top: 14px; }
.card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}
.card__title .ico {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  flex: none;
}
.card__title .ico svg { width: 18px; height: 18px; }
/* Pastille d'icône. Le centrage appartient à la pastille elle-même : le laisser
   aux règles contextuelles décentrait l'icône partout où l'une d'elles
   manquait. Les règles spécifiques ne font plus varier que taille et arrondi. */
.ico {
  display: grid;
  place-items: center;
  flex: none;
}
.ico--blue { background: rgba(40,120,200,.12); color: var(--blue); }
.ico--pink { background: rgba(233,30,140,.12); color: var(--pink); }
.ico--green { background: var(--green-soft); color: var(--green); }
.ico--amber { background: var(--amber-soft); color: var(--amber); }

/* Puces / étiquettes */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: all .15s;
}
.chip svg { width: 15px; height: 15px; }
.chip--on { background: var(--pink-soft); border-color: rgba(233,30,140,.35); color: var(--pink); }
.chip--blue { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
.chip--green { background: var(--green-soft); border-color: transparent; color: var(--green); }
.chip--amber { background: var(--amber-soft); border-color: transparent; color: #A9741A; }
.chip--red { background: var(--red-soft); border-color: transparent; color: var(--red); }
.chip--interest {
  background: linear-gradient(135deg, rgba(233,30,140,.12), rgba(40,120,200,.08));
  border-color: rgba(233,30,140,.25);
  color: var(--dark);
  font-weight: 500;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Compteur de demandes restantes */
.quota {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 700;
}
.quota svg { width: 15px; height: 15px; }
.quota--low { background: var(--red-soft); color: var(--red); }
.quota--admin { background: linear-gradient(135deg, rgba(233,30,140,.15), rgba(40,120,200,.15)); color: var(--pink); }

/* Onglets */
.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow-1);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: all .18s;
}
.tab[aria-selected="true"] {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(40,120,200,.25);
}

/* Formulaires */
.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40,120,200,.12);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.select { appearance: none; 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='%236B7280' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.hint { font-size: 12.5px; color: var(--muted-light); margin-top: 5px; }
.error-text { font-size: 13px; color: var(--red); margin-top: 6px; }

.input-group { position: relative; }
/* Le retrait n'est réservé qu'aux champs qui portent réellement une icône :
   appliqué à tous, il décalerait le texte dans le vide. */
.input-group:has(.lead) .input { padding-left: 44px; }
.input-group:has(.trail) .input { padding-right: 46px; }
.input-group .lead {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted-light);
  pointer-events: none;
}
.input-group .lead svg { width: 19px; height: 19px; }
.input-group .trail {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
}

.range { width: 100%; accent-color: var(--blue); }

/* Avatars et images */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--line);
  flex: none;
}
.avatar--ph {
  display: grid;
  place-items: center;
  color: var(--muted-light);
  background: var(--bg);
}
.avatar--ph svg { width: 55%; height: 55%; }

.img-ph {
  background: linear-gradient(100deg, #EEF1F5 30%, #F7F9FB 50%, #EEF1F5 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }

/* Squelettes de chargement */
.skel {
  border-radius: var(--r-md);
  background: linear-gradient(100deg, #EAEEF3 30%, #F5F7FA 50%, #EAEEF3 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}

/* Notifications éphémères */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottomnav-h) + var(--safe-b) + 16px);
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast {
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-3);
  animation: toast-in .22s ease-out;
}
.toast--ok { background: var(--pink); }
.toast--err { background: var(--red); }
.toast--info { background: var(--blue); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Fenêtres modales et panneaux glissants */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(16, 24, 40, .45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in .18s ease-out;
}
@media (min-width: 700px) { .overlay { align-items: center; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 14px 22px calc(28px + var(--safe-b));
  animation: sheet-up .24s cubic-bezier(.22,.9,.3,1);
}
@media (min-width: 700px) {
  .sheet { border-radius: var(--r-xl); padding-bottom: 26px; }
}
@keyframes sheet-up {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: none; opacity: 1; }
}
.sheet__grip {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: #D8DDE5;
  margin: 0 auto 18px;
}
.sheet__title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}
.sheet__text {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}
.sheet__actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.sheet__actions .btn { flex: 1; }

/* États vides */
.empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
}
.empty svg { width: 68px; height: 68px; color: #D5DAE2; }
.empty h3 { font-size: 17px; color: var(--muted); font-weight: 600; }
.empty p { font-size: 14px; color: var(--muted-light); }

/* Badge « profil vérifié » */
.verified {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  flex: none;
}
.verified svg { width: 11px; height: 11px; }

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner--blue { border-color: rgba(40,120,200,.25); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-center { display: grid; place-items: center; padding: 60px 0; }
