/* ARES Auth V5 — Fullscreen chooser */

#dlg-auth.ares-v5-choice-mode {
  background:
    radial-gradient(
      ellipse at 50% 15%,
      #14254c 0%,
      #080d1d 55%,
      #050710 100%
    ) !important;
}

#dlg-auth .ares-v5-chooser {
  width: min(100%, 440px);
  margin: auto;
  padding: 36px 24px 46px;
  box-sizing: border-box;
  color: #f5f7ff;
}

#dlg-auth .ares-v5-brand {
  text-align: center;
  margin-bottom: 36px;
}

#dlg-auth .ares-v5-brand img {
  display: block;
  width: 92px;
  height: 92px;
  object-fit: contain;
  margin: 0 auto 24px;
}

#dlg-auth .ares-v5-brand h2 {
  margin: 0;
  font-size: clamp(24px, 6vw, 32px);
  line-height: 1.2;
  letter-spacing: -.8px;
  font-weight: 750;
}

#dlg-auth .ares-v5-brand p {
  margin: 12px 0 0;
  color: #a6b4d1;
  font-size: 14px;
}

#dlg-auth .ares-v5-methods {
  display: grid;
  gap: 14px;
}

#dlg-auth .ares-v5-methods button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  width: 100%;
  border: 1px solid #47536f;
  border-radius: 30px;
  background: #151b2b;
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  padding: 12px 42px;
  transition: background .2s, transform .2s;
}

#dlg-auth .ares-v5-methods button:active:not(:disabled) {
  transform: scale(.985);
}

#dlg-auth .ares-v5-methods button:hover:not(:disabled) {
  background: #222c44;
}

#dlg-auth .ares-v5-methods button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

#dlg-auth .ares-v5-icon {
  position: absolute;
  left: 19px;
  font-size: 24px;
  line-height: 1;
}

#dlg-auth .ares-v5-google {
  font-weight: 800;
  color: #4285f4;
}

#dlg-auth .ares-v5-discord {
  color: #929bff;
}

#dlg-auth .ares-v5-legal {
  color: #9daac4;
  font-size: 12px;
  line-height: 1.65;
  text-align: center;
  margin: 28px 4px 0;
}

#dlg-auth .ares-v5-legal a {
  color: #dce6ff;
  text-decoration: underline;
}

#dlg-auth .ares-v5-error {
  color: #ff9fae;
  font-size: 12px;
  text-align: center;
}

#dlg-auth .ares-v5-back {
  position: absolute;
  left: 20px;
  top: 24px;
  z-index: 5;
  border: 0;
  background: transparent;
  color: #aebcda;
  font-size: 14px;
  cursor: pointer;
}

#dlg-auth.ares-v5-choice-mode .auth-entete,
#dlg-auth.ares-v5-choice-mode #form-connexion,
#dlg-auth.ares-v5-choice-mode #form-inscription,
#dlg-auth.ares-v5-choice-mode .ares-oauth-choices,
#dlg-auth.ares-v5-choice-mode .ares-auth-divider,
#dlg-auth.ares-v5-choice-mode .ares-auth-footer {
  display: none !important;
}

#dlg-auth.ares-v5-choice-mode .ares-v5-back {
  display: none !important;
}

#dlg-auth.ares-v5-email-mode .ares-v5-chooser {
  display: none !important;
}

#dlg-auth.ares-v5-email-mode .ares-oauth-choices {
  display: none !important;
}

@media (max-width: 600px) {
  #dlg-auth .ares-v5-chooser {
    padding: 24px 22px 38px;
  }

  #dlg-auth .ares-v5-brand {
    margin-bottom: 30px;
  }

  #dlg-auth .ares-v5-methods {
    gap: 12px;
  }

  #dlg-auth .ares-v5-methods button {
    min-height: 56px;
  }
}


/* ARES Auth V5.1 — Official provider icons */
#dlg-auth .ares-v5-methods img.ares-v5-icon {
  position: absolute !important;
  left: 19px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 24px !important;
  height: 24px !important;
  object-fit: contain !important;
}

#dlg-auth .ares-v51-mail {
  font-size: 23px !important;
  color: #dce5fa !important;
}

/* Supprimer le contour bleu de focus persistant sur iOS */
#dlg-auth .ares-v5-methods button,
#dlg-auth .ares-v5-methods button:focus,
#dlg-auth .ares-v5-methods button:focus-visible,
#dlg-auth .ares-v5-methods button:active {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

#dlg-auth .ares-v5-methods button {
  box-shadow: none !important;
}

#dlg-auth .ares-v5-methods button:focus-visible {
  border-color: #8296c5 !important;
  box-shadow: 0 0 0 2px #8296c5 !important;
}

/* Masquer les éléments du formulaire sur le choix de méthode */
#dlg-auth.ares-v5-choice-mode .ares-auth-switch,
#dlg-auth.ares-v5-choice-mode .ares-auth-switcher,
#dlg-auth.ares-v5-choice-mode .ares-v3-switch,
#dlg-auth.ares-v5-choice-mode .auth-note {
  display: none !important;
}

/* Retour vers les méthodes uniquement depuis le formulaire */
#dlg-auth.ares-v5-email-mode .ares-v5-back {
  display: inline-flex !important;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
}

/* =====================================================
   ARES AUTH V5.2 — Aucun bouton présélectionné
   ===================================================== */

/* Neutraliser les contours hérités des anciennes versions */
#dlg-auth .ares-v5-methods button,
#dlg-auth .ares-v5-methods button:focus,
#dlg-auth .ares-v5-methods button:focus-visible,
#dlg-auth .ares-v5-methods button:active,
#dlg-auth .ares-v5-methods button[aria-selected="true"] {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Aucun bouton OAuth ne doit paraître sélectionné */
#dlg-auth .ares-v5-methods button:not(:disabled) {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: #465471 !important;
}

/* Effet uniquement pendant le clic */
#dlg-auth .ares-v5-methods button:not(:disabled):active {
  background: #202b45 !important;
}

/* Accessibilité clavier : indicateur discret */
@media (hover: hover) and (pointer: fine) {
  #dlg-auth .ares-v5-methods button:focus-visible {
    outline: 2px solid #91a8d9 !important;
    outline-offset: 3px !important;
  }
}


/* =====================================================
   ARES AUTH V5.3 — CROIX DE FERMETURE
   ===================================================== */

#dlg-auth #auth-fermer {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;

  position: fixed !important;
  top: calc(env(safe-area-inset-top, 0px) + 22px) !important;
  right: 22px !important;

  width: 42px !important;
  height: 42px !important;

  align-items: center !important;
  justify-content: center !important;

  border-radius: 50% !important;
  border: 1px solid #435372 !important;

  background: #18243d !important;
  color: #e6edff !important;

  font-size: 25px !important;
  line-height: 1 !important;

  cursor: pointer !important;
  z-index: 99999 !important;

  box-shadow: none !important;
  transform: none !important;
}

#dlg-auth #auth-fermer:hover {
  background: #263652 !important;
}

#dlg-auth #auth-fermer:active {
  background: #334565 !important;
}

#dlg-auth #auth-fermer:focus-visible {
  outline: 2px solid #91a8d9 !important;
  outline-offset: 3px !important;
}

@media (max-width: 600px) {
  #dlg-auth #auth-fermer {
    top: calc(env(safe-area-inset-top, 0px) + 14px) !important;
    right: 16px !important;
  }
}




/* =====================================================
   ARES AUTH V5.5 — CROIX UNIQUEMENT SUR LE CHOIX
   ===================================================== */

/* Masquée par défaut */
#dlg-auth #auth-fermer {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Affichée uniquement sur le premier écran */
#dlg-auth.ares-v5-choice-mode #auth-fermer {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;

  position: fixed !important;
  top: 16px !important;
  right: 16px !important;

  width: 42px !important;
  height: 42px !important;

  align-items: center !important;
  justify-content: center !important;

  background: #18243c !important;
  color: #e7eeff !important;
  border: 1px solid #425579 !important;
  border-radius: 50% !important;

  z-index: 99999 !important;
  cursor: pointer !important;
}

/* Connexion et inscription : aucune croix */
#dlg-auth.ares-v5-email-mode #auth-fermer {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Conserver le bouton Retour sur les formulaires */
#dlg-auth.ares-v5-email-mode .ares-v5-back {
  display: flex !important;
  visibility: visible !important;
}

@media (min-width: 768px) {
  #dlg-auth.ares-v5-choice-mode #auth-fermer {
    top: 24px !important;
    right: 24px !important;
  }
}


/* ARES AUTH V5.6 — FIX CROIX */

/* La croix est maintenant enfant direct du dialogue. */
#dlg-auth > #auth-fermer {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Visible uniquement sur le choix des méthodes. */
#dlg-auth.ares-v5-choice-mode > #auth-fermer {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;

  position: fixed !important;
  top: 16px !important;
  right: 16px !important;

  width: 42px !important;
  height: 42px !important;

  align-items: center !important;
  justify-content: center !important;

  background: #18243c !important;
  color: #f0f4ff !important;
  border: 1px solid #526485 !important;
  border-radius: 50% !important;

  z-index: 99999 !important;
  pointer-events: auto !important;
}

/* Sur les formulaires, aucune croix. */
#dlg-auth.ares-v5-email-mode > #auth-fermer {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

#dlg-auth.ares-v5-choice-mode > #auth-fermer svg {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  stroke: currentColor !important;
}

@media (min-width: 768px) {
  #dlg-auth.ares-v5-choice-mode > #auth-fermer {
    top: 24px !important;
    right: 24px !important;
  }
}

/* FIN ARES AUTH V5.6 */
