/* Pages de connexion (templates/registration/auth_base.html : connexion, code
   recu par e-mail, blocage) : carte centree,
   precedee sur grand ecran d'un panneau d'accueil. Couleur du site : #ba9966. */

.auth-page {
  --auth-brand: #ba9966;
  --auth-brand-dark: #8f7246;
  --auth-text: var(--gris-texte-fort);
  --auth-muted: var(--gris-marque);
  --auth-border: var(--gris-bordure);
  margin: 0;
  min-height: 100vh;
  background: var(--gris-fond);
  color: var(--auth-text);
  font-family: lato, Helvetica, Arial, sans-serif;
  font-size: 15px;
}

.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  max-width: 1300px;     /* meme largeur que la page « Devenir Host » */
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 16px;
}

.auth a {
  color: var(--auth-brand-dark);
  font-weight: 600;
}

.auth a:hover {
  color: var(--auth-text);
}

/* --- Panneau d'accueil (grand ecran seulement) --- */

.auth-welcome {
  display: none;
  flex: 1;
  max-width: 560px;
  text-align: center;
  color: var(--auth-muted);
}

.auth-welcome__logo {
  width: 260px;
  height: auto;
}

.auth-welcome__title {
  margin: 20px 0 8px;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--auth-text);
}

.auth-welcome__lead {
  margin-bottom: 10px;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 2;          /* espace entre les trois lignes du message */
  color: var(--auth-brand-dark);
}

.auth-welcome__art {
  width: 165px;
  height: auto;
  margin-top: 16px;
  opacity: .9;
}

/* --- Carte --- */

.auth-card {
  width: 100%;
  max-width: 460px;
  padding: 32px 28px;
  background: #fff;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(79, 75, 75, .08);
}

.auth-card__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  text-decoration: none;
}

.auth-card__title {
  margin: 0 0 20px;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  color: var(--auth-text);
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.auth-field input {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--auth-border);
  border-radius: 6px;
  font-size: 1rem;
  color: var(--auth-text);
  background: #fff;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--auth-brand);
  box-shadow: 0 0 0 3px rgba(186, 153, 102, .25);
}

.auth-field__help {
  margin: 6px 0 0;
  font-size: .9rem;
  color: var(--auth-muted);
}

.auth-field .errorlist {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  color: #b42318;
  font-size: .9rem;
}

.auth-error {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #f1b8b2;
  border-radius: 6px;
  background: #fdf0ef;
  color: #b42318;
}

.auth-error p {
  margin: 0;
}

.auth-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 11px 16px;
  border: none;
  border-radius: 8px;
  background: var(--auth-brand);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s;
}

.auth-btn:hover,
.auth-btn:focus-visible {
  background: var(--auth-text);
}

.auth-card__alt {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--auth-border);
  text-align: center;
  color: var(--auth-muted);
}

/* Texte courant de la carte (code recu par e-mail, blocage) */
.auth-card__text {
  margin-bottom: 16px;
  line-height: 1.5;
}

.auth-card__alt p {
  margin: 0 0 8px;
}

.auth-card__alt p:last-child {
  margin-bottom: 0;
}

/* Champ du code a 6 chiffres */
.auth-field input.auth-code {
  font-size: 1.4rem;
  letter-spacing: .4em;
  text-align: center;
}

/* Bouton presente comme un lien (« Envoyer un nouveau code ») */
.auth-link-button {
  padding: 0;
  border: none;
  background: none;
  color: var(--auth-brand-dark);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.auth-link-button:hover {
  color: var(--auth-text);
}

/* Lien presente comme le bouton principal (« Connexion », « Reinitialiser ») */
.auth a.auth-btn {
  color: #fff;
  text-align: center;
  text-decoration: none;
}

.auth a.auth-btn:hover {
  color: #fff;
}

/* Aide sous un champ (regles du mot de passe) */
.auth-field__hint {
  margin-top: 6px;
  font-size: .85rem;
  color: var(--auth-muted);
}

.auth-field__hint ul {
  margin: 0;
  padding-left: 18px;
}

/* Pages de mot de passe : logo seul au-dessus de la carte (auth_logo_base.html) */
.auth--logo {
  flex-direction: column;
  gap: 24px;
}

.auth-logo img {
  width: 210px;
  height: auto;
}

.auth--logo .auth-card__brand {
  display: none;
}

/* Grand ecran : panneau d'accueil a gauche ; ses logos remplacent ceux de la carte */
/* --- Inscription (authentication/signup.html) : carte large --- */

.auth--wide .auth-card {
  max-width: 900px;
}

/* Deux colonnes sur grand ecran, espacees ; une seule sur mobile */
.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* un long nom de ville n'elargit pas la colonne */
  column-gap: 24px;
}

@media (min-width: 768px) {
  .auth-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .auth-field--full {
    grid-column: 1 / -1;
  }
}

.auth-field__legend {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

/* Boutons radio « Particulier / Entreprise » cote a cote */
.auth-radios > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.auth-radios label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  cursor: pointer;
}

.auth-field .auth-radios input,
.auth-check input {
  display: inline-block;
  width: auto;
  margin: 0;
  accent-color: var(--auth-brand);
}

/* Case des mentions legales, texte a cote */
.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-check input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex: none;
}

.auth-check label {
  margin: 0;
  font-weight: normal;
  line-height: 1.5;
}

/* Listes pays / ville (Select2) : meme cadre que les champs, fleche entiere.
   min-width: 0 annule le minimum de 20em (300 px) de django-autocomplete-light
   (autocomplete_light/select2.css), qui faisait deborder les listes de la carte
   sur petit ecran (320 px). */
.auth-field .select2-container {
  width: 100% !important;
  min-width: 0;
}

.auth-field .select2-container .select2-selection--single {
  height: 42px;
  border: 1px solid var(--auth-border);
  border-radius: 6px;
}

.auth-field .select2-container .select2-selection--single .select2-selection__rendered {
  padding-left: 12px;
  line-height: 40px;
  color: var(--auth-text);
}

.auth-field .select2-container .select2-selection--single .select2-selection__arrow {
  top: 1px;
  right: 6px;
  height: 40px;
}

.auth-field .select2-container--focus .select2-selection--single,
.auth-field .select2-container--open .select2-selection--single {
  border-color: var(--auth-brand);
}

@media (min-width: 992px) {
  .auth-welcome {
    display: block;
  }

  .auth:not(.auth--logo) {
    gap: 96px;
  }

  .auth-card__brand {
    display: none;
  }
}

/* Lien vers les mentions legales, avant le bouton d'inscription */
.auth-legal-link {
  margin-bottom: 20px;
}

/* Inscription, profil : logo a gauche de la carte et formulaire en haut de page
   sur grand ecran ; logo au-dessus sur mobile */
.auth--side {
  justify-content: flex-start;
}

@media (min-width: 992px) {
  .auth--side {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 40px;
    padding-top: 32px;
  }

  .auth--side .auth-logo {
    position: sticky;
    top: 32px;
  }
}

/* Liste ouverte des pays / villes : placee a la racine de la page par Select2, hors
   du champ ; meme correction du minimum de 20em que ci-dessus */
body > .select2-container {
  min-width: 0;
}

/* Case « Je preleve la VAT » : texte d'alerte toujours visible, encadre pour attirer l'oeil */
.auth-vat__help {
  margin: -6px 0 14px;
  padding: 8px 12px;
  border-left: 3px solid #ba9966;
  background: var(--gris-fond, #f6f1e9);
  font-size: 0.85rem;
}

/* Pays du compte non gere par le site (registration/_country_coverage.html) */
.auth-coverage {
  margin: -4px 0 12px;
  padding: 8px 12px;
  border-left: 3px solid #ba9966;
  background: var(--gris-fond, #f6f1e9);
  font-size: 0.85rem;
}
