/* ============================================================
   GRAMMALAB — Pages d'authentification (allauth)
   Hérite de base.html : nav GrammaLab + footer
   Cohérent avec main.css (variables, Poppins, bleu France)
   ============================================================ */


/* ============================================================
   🎯 LAYOUT — Centrage de la page auth
   ============================================================ */
.auth-page {
  width: 100%;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.auth-page__inner {
  width: 100%;
  max-width: 540px;
}


/* ============================================================
   💳 CARTE D'AUTHENTIFICATION
   ============================================================ */
.auth-card {
  width: 100%;
  max-width: 540px;
  padding: 2rem 2rem 1.75rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--line);
}

.auth-card h2 {
  font-family: 'Poppins', system-ui, sans-serif;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.auth-card>p {
  text-align: center;
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}


/* ============================================================
   🔐 FORMULAIRE — Champs et icônes
   ============================================================ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 1rem;
}

.auth-form .form-group label {
  align-self: flex-start;
  max-width: 500px;
  width: 100%;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
  font-size: 0.95rem;
}

.input-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--muted);
}

.toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
}

.input-wrapper input {
  width: 100%;
  background-color: var(--alt);
  border: 1px solid var(--line);
  padding: 0.65rem 2.2rem;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  color: var(--text);
}

.input-wrapper input:focus {
  border-color: var(--fr-blue);
  background-color: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 85, 164, 0.15);
}

.input-wrapper input::placeholder {
  color: #a1a5ad;
}


/* ============================================================
   🔑 LIEN "Mot de passe oublié"
   ============================================================ */
.password-wrapper {
  text-align: right;
  max-width: 500px;
  margin: 0.25rem auto 0;
}

.password-wrapper a {
  color: var(--fr-blue);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.password-wrapper a:hover {
  color: #004183;
  text-decoration: underline;
}


/* ============================================================
   🔘 BOUTON SUBMIT — Bleu France, en pilule
   ============================================================ */
.auth-card button[type="submit"] {
  max-width: 500px;
  margin: 0.75rem auto 0.25rem;
  display: block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background-color: var(--fr-blue);
  color: #ffffff;
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.auth-card button[type="submit"]:hover {
  background-color: #004183;
}

.auth-card button[type="submit"]:active {
  transform: translateY(1px);
}

.auth-card button[type="submit"]:focus-visible {
  outline: 3px solid rgba(0, 85, 164, 0.35);
  outline-offset: 2px;
}


/* ============================================================
   🔗 LIENS TRICOLORES (en bas de carte)
   ============================================================ */
.auth-links {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-links a {
  text-align: center;
  display: block;
  font-size: 0.9rem;
  color: var(--fr-blue);
  margin-top: 0.4rem;
  text-decoration: none;
}

.auth-links .link-tricolor {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  max-width: max-content;
  margin: 0 auto;
}

.link-tricolor {
  position: relative;
  display: inline-block;
  text-decoration: none;
  max-width: max-content;
  color: var(--text);
  font-weight: 600;
  padding: 0.15rem 0;
  transition: color 0.2s ease;
}

.link-tricolor::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--fr-blue), var(--fr-white), var(--fr-red));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}

.link-tricolor:hover,
.link-tricolor:focus {
  color: var(--fr-blue);
}

.link-tricolor:hover::after,
.link-tricolor:focus::after {
  transform: scaleX(1);
}

.link-tricolor.is-active,
.link-tricolor[aria-current="page"] {
  color: var(--fr-blue);
}

.link-tricolor.is-active::after,
.link-tricolor[aria-current="page"]::after {
  transform: scaleX(1);
}

.link-tricolor:focus-visible {
  outline: 2px solid rgba(0, 85, 164, 0.35);
  outline-offset: 2px;
}


/* ============================================================
   ⚪ DIVIDER — "Of met je e-mailadres"
   ============================================================ */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 0.75rem auto;
  max-width: 500px;
  font-size: 0.9rem;
  color: var(--muted);
  gap: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--line);
}


/* ============================================================
   👥 LOGIN SOCIAL — Google & Microsoft (normes officielles)
   ============================================================ */
.social-login {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.5rem auto 0;
  max-width: 500px;
  width: 100%;
}

.auth-provider-btn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  height: 40px;
  padding: 0 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.21px;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-provider-btn__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bouton Google — couleurs et typo officielles */
.auth-provider-btn--google {
  background-color: #ffffff;
  color: #1f1f1f;
  border: 1px solid #c7c7c7;
  font-family: "Roboto", "Google Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.auth-provider-btn--google:hover {
  background-color: #f8f9fa;
  border-color: #d2e3fc;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3),
    0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.auth-provider-btn--google:active {
  background-color: #e8f0fe;
}

/* Bouton Microsoft — couleurs et typo officielles */
.auth-provider-btn--microsoft {
  background-color: #ffffff;
  color: #5e5e5e;
  border: 1px solid #c7c7c7;
  font-family: "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
}

.auth-provider-btn--microsoft:hover {
  background-color: #f5f5f5;
  border-color: #5e5e5e;
}

.auth-provider-btn--microsoft:active {
  background-color: #ebebeb;
}

.auth-icon {
  flex-shrink: 0;
  height: 18px;
  width: 18px;
}


/* ============================================================
   ⚠️ MESSAGES D'ERREUR
   ============================================================ */
.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 0.5rem;
  padding: 0.85rem 1rem;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid var(--fr-red);
  border-radius: 8px;
  color: #991b1b;
  font-size: 0.95rem;
  line-height: 1.4;
  box-sizing: border-box;
}

.auth-error__icon {
  flex-shrink: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.auth-error__content {
  flex: 1;
  min-width: 0;
}

.auth-error__message {
  margin: 0;
}

.auth-error__message+.auth-error__message {
  margin-top: 0.4rem;
}


/* ============================================================
   📱 RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 600px) {
  .auth-page {
    padding: 1.5rem 1rem;
  }

  .auth-card {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .auth-card h2 {
    font-size: 1.4rem;
  }

  .social-login {
    flex-direction: column;
  }

  .auth-provider-btn {
    flex: 1 1 auto;
  }
}

/* ============================================================
   🏷️ TITRES ET SOUS-TITRES SPÉCIFIQUES (auth-title, auth-subtitle)
   ============================================================ */
.auth-card .auth-title {
  font-family: 'Poppins', system-ui, sans-serif;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.auth-card .auth-subtitle {
  text-align: center;
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ============================================================
   🔘 BOUTON SUBMIT — Forcer bleu France (sélecteur spécifique)
   ============================================================ */
.auth-card .auth-button,
.auth-card button.auth-button[type="submit"] {
  max-width: 500px;
  margin: 0.75rem auto 0.25rem;
  display: block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background-color: var(--fr-blue);
  color: #ffffff;
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.auth-card .auth-button:hover,
.auth-card button.auth-button[type="submit"]:hover {
  background-color: #004183;
}

.auth-card .auth-button:active,
.auth-card button.auth-button[type="submit"]:active {
  transform: translateY(1px);
}

.auth-card .auth-button:focus-visible,
.auth-card button.auth-button[type="submit"]:focus-visible {
  outline: 3px solid rgba(0, 85, 164, 0.35);
  outline-offset: 2px;
}

/* ============================================================
   🎯 MINI-BANNIÈRE D'ACCUEIL — Pages d'authentification
   ============================================================ */
.auth-banner {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-image: url('/static/img/hero_img_grammalab.webp');
  background-size: cover;
  background-position: center;
  isolation: isolate;
}

.auth-banner__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
}

.auth-banner__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.5rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.auth-banner__title {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  color: #ffffff;
  line-height: 1.1;
}

.auth-banner__subtitle {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 400;
  margin: 0.1rem 0 0.5rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.2;
}

.auth-banner__tricolor {
  display: inline-flex;
  gap: 4px;
}

.auth-banner__tricolor span {
  display: block;
  width: 38px;
  height: 4px;
  border-radius: 1px;
}

.auth-banner__tricolor span:nth-child(1) {
  background-color: var(--fr-blue);
}

.auth-banner__tricolor span:nth-child(2) {
  background-color: #ffffff;
}

.auth-banner__tricolor span:nth-child(3) {
  background-color: var(--fr-red);
}

/* Responsive — Mobile */
@media (max-width: 600px) {
  .auth-banner {
    height: 140px;
  }

  .auth-banner__title {
    font-size: 1.4rem;
  }

  .auth-banner__subtitle {
    font-size: 0.9rem;
  }

  .auth-banner__tricolor span {
    width: 28px;
    height: 3px;
  }
}

/* ============================================================
   📝 TEXTES SECONDAIRES — auth-info, auth-hint
   ============================================================ */
.auth-card .auth-info {
  text-align: center;
  margin: 0.75rem 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}

.auth-card .auth-hint {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.auth-card .auth-hint a {
  color: var(--fr-blue);
  text-decoration: none;
}

.auth-card .auth-hint a:hover {
  text-decoration: underline;
}

/* ============================================================
   🎯 ACTIONS — auth-actions (boutons groupés)
   ============================================================ */
.auth-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* ============================================================
   📋 LIENS-BOUTONS (a.auth-button — pour les liens stylés en bouton)
   ============================================================ */
a.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
}