/* =====================================================================
 * ADW Connexion sociale — front.css
 * Boutons "pills" inline (façon SPM), icône + libellé, survol vert ADW.
 * CSS écrit à la main (conventions ADW).
 * ===================================================================== */

.adw-sociallogin {
  --asl-surface: var(--adw-surface, #ffffff);
  --asl-light: var(--adw-surface-2, #f2f2f2);
  --asl-border: var(--adw-border, #f2f2f2);
  --asl-ink: var(--adw-ink, #1d2123);
  --asl-muted: var(--adw-muted, #6b7280);
  --asl-green: var(--adw-green, #91bd31);
  --asl-radius: 999px;

  margin-top: 1.25rem;
}

/* Tunnel de commande : le bloc s'insère entre les onglets et les formulaires,
 * il lui faut de l'air des deux côtés (le conteneur n'a qu'une marge haute). */
.adw-sociallogin--checkout {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

/* Séparateur "ou continuer avec" */
.adw-sociallogin__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  color: var(--asl-muted);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: .02em;
}

/* Placé après les boutons (page de connexion) : la marge bascule en haut. */
.adw-sociallogin__divider--after {
  margin: 1rem 0 0;
}

.adw-sociallogin__divider::before,
.adw-sociallogin__divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: #d9d9d9;
}

/* Liste : pills inline qui s'enroulent */
.adw-sociallogin__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

/* Pill */
.adw-sociallogin__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: auto;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--asl-border);
  border-radius: var(--asl-radius);
  background: var(--asl-light);
  color: var(--asl-ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .05s ease;
}

/* Survol : vert ADW + encre foncée (WCAG : jamais de blanc sur le vert) */
.adw-sociallogin__btn:hover,
.adw-sociallogin__btn:focus-visible {
  background: var(--asl-green);
  border-color: var(--asl-green);
  color: var(--asl-ink);
  text-decoration: none;
}

.adw-sociallogin__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(145, 189, 49, .35);
}

.adw-sociallogin__btn:active {
  transform: translateY(1px);
}

.adw-sociallogin__btn.is-loading {
  pointer-events: none;
  opacity: .6;
}

/* Boîte d'icône calée sur 20px, la taille portée par les attributs width/height
 * des SVG. Un écart (18 vs 20) décentrait le logo dès que la règle svg ci-dessous
 * était neutralisée par le thème. align-items/justify-content recentrent quoi
 * qu'il arrive, line-height:0 supprime l'espace de ligne hérité du bouton. */
.adw-sociallogin__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  line-height: 0;
}

.adw-sociallogin__icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.adw-sociallogin__label {
  display: inline-block;
}

/* Mobile : pills pleine largeur pour des cibles tactiles confortables */
@media (max-width: 480px) {
  .adw-sociallogin__btn {
    flex: 1 1 100%;
  }
}

/* Message d'erreur */
.adw-sociallogin__alert {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #f0c8c8;
  border-radius: 8px;
  background: #fdf1f1;
  color: #8a1f1f;
  font-size: 0.875rem;
}

/* Tuile de la grille « Mon compte ». Le thème habille déjà .link-item : on ne
 * touche à rien, sinon la tuile jurerait à côté de « Mes commandes ». */
.adw-sociallogin-tile .link-item {
  display: block;
}

/* Page « Connexions sociales » de l'espace client */
.adw-sociallogin-account__section + .adw-sociallogin-account__section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--adw-border, #f2f2f2);
}

/* Bouton « Lier » : action principale de la liste des fournisseurs en attente.
 * Vert ADW sur encre foncée — jamais de blanc sur le vert (WCAG AA). */
.adw-sociallogin-account__link-btn {
  flex: 0 0 auto;
  align-self: center;
  margin-left: auto;
  padding: 0.375rem 1rem;
  border: 1px solid var(--adw-green, #91bd31);
  border-radius: 999px;
  background: var(--adw-green, #91bd31);
  color: var(--adw-ink, #1d2123);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: filter .2s ease;
}

.adw-sociallogin-account__link-btn:hover,
.adw-sociallogin-account__link-btn:focus-visible {
  filter: brightness(.94);
  color: var(--adw-ink, #1d2123);
  text-decoration: none;
}

.adw-sociallogin-account__link-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(145, 189, 49, .35);
}

/* Espace client : connexions liées + liaison d'un nouveau réseau */
.adw-sociallogin-account {
  --asl-green: var(--adw-green, #91bd31);
  margin-top: 1rem;
}

.adw-sociallogin-account__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--adw-ink, #1d2123);
}


.adw-sociallogin-account__hint {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--adw-muted, #6b7280);
}

.adw-sociallogin-account__notice {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #d3e3a8;
  border-radius: 8px;
  background: #f4f9e8;
  color: #3f5313;
  font-size: 0.875rem;
}

.adw-sociallogin-account__list {
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.adw-sociallogin-account__item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--adw-border, #f2f2f2);
}

/* L'icône garde sa hauteur de ligne face à un bloc désormais sur deux lignes */
.adw-sociallogin-account__item > .adw-sociallogin__icon {
  margin-top: 0.125rem;
}

.adw-sociallogin-account__item:last-child {
  border-bottom: 0;
}

/* Identité empilée en colonne : nom + badge sur la première ligne, e-mail dessous */
.adw-sociallogin-account__identity {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.adw-sociallogin-account__provider {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--adw-ink, #1d2123);
}

.adw-sociallogin-account__email {
  font-size: 0.8125rem;
  color: var(--adw-muted, #6b7280);
  overflow-wrap: anywhere;
}

/* Date de liaison : information secondaire, sous l'e-mail */
.adw-sociallogin-account__date {
  font-size: 0.75rem;
  color: var(--adw-muted, #6b7280);
}

/* Instagram ne transmet pas d'e-mail : on le dit plutôt que de laisser un vide */
.adw-sociallogin-account__email--none {
  font-style: italic;
  opacity: .8;
}

/* Badge « e-mail vérifié » — encre foncée sur vert ADW pâle (jamais de blanc
 * sur le vert : le contraste ne passerait pas WCAG AA) */
.adw-sociallogin-account__badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.adw-sociallogin-account__badge--verified {
  border: 1px solid #c8dd96;
  background: #f0f7e0;
  color: #3f5313;
}

/* Action destructive : discrète au repos, explicite au survol */
.adw-sociallogin-account__unlink {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--adw-border, #f2f2f2);
  border-radius: 999px;
  color: var(--adw-muted, #6b7280);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.adw-sociallogin-account__unlink:hover,
.adw-sociallogin-account__unlink:focus-visible {
  border-color: #e0b4b4;
  background: #fdf1f1;
  color: #8a1f1f;
  text-decoration: none;
}

.adw-sociallogin-account__unlink:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(138, 31, 31, .18);
}

@media (prefers-reduced-motion: reduce) {
  .adw-sociallogin__btn {
    transition: none;
  }
  .adw-sociallogin__btn:active {
    transform: none;
  }
}
