/*
 * Pages d'authentification — même langage visuel que la page d'accueil.
 *
 * Reprend les jetons de market-home.css : dégradé d'encre du bandeau héros,
 * grille et halos, pastille « kicker », carte blanche posée sur le bleu et
 * bouton ambre comme unique action pleine.
 */

.auth-market {
  --auth-primary: #4680ff;
  --auth-text: #1d2630;
  --auth-muted: #697586;
  --auth-border: rgba(29, 38, 48, 0.1);
  --auth-surface-soft: #f0f4fa;
  --auth-amber: #ffc107;
  --auth-amber-deep: #f0a800;
  --auth-on-amber: #1a1200;
  --auth-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: stretch;
  overflow: hidden;
  background: linear-gradient(118deg, #0d255d 0%, #214aa6 46%, #4680ff 100%);
  color: #ffffff;
  isolation: isolate;
}

/* Halos colorés, identiques au héros de l'accueil. */
.auth-market::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    radial-gradient(circle at 76% 10%, rgba(113, 202, 255, 0.34), transparent 28%),
    radial-gradient(circle at 12% 92%, rgba(40, 167, 69, 0.22), transparent 26%),
    radial-gradient(circle at 92% 82%, rgba(255, 193, 7, 0.2), transparent 22%);
  content: "";
}

/* Trame de 48 px estompée vers le bas. */
.auth-market::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-position: center;
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 75%, transparent 100%);
  pointer-events: none;
}

/* ---------------------------------------------------------------- Volet marque */

.auth-market__brand {
  display: flex;
  flex-direction: column;
  padding: clamp(2.5rem, 4vw, 4.5rem) clamp(2rem, 4vw, 4.5rem);
}

.auth-market__brand-logo {
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
  padding: 0.46rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.auth-kicker i { color: #ffd15c; font-size: 1rem; }

.auth-market .auth-title {
  max-width: 15ch;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.1rem, 1.5rem + 1.9vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  text-wrap: balance;
}

/* Un seul mot en lumière, comme le titre de l'accueil. */
.auth-title .accent { color: #ffd15c; }

.auth-market .auth-lead {
  max-width: 46ch;
  margin: 1.15rem 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.02rem;
  line-height: 1.7;
}

/* Liste d'arguments — reprend .market-hero__trust en version empilée. */
.auth-market .brand-features {
  margin: 2.25rem 0 0;
  padding: 0;
  list-style: none;
}

.auth-market .brand-features li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.95rem;
}

.auth-market .feature-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffd15c;
  font-size: 1.05rem;
}

/* Le panneau change au choix du rôle : on adoucit la bascule. */
.signup-brand-context {
  transition: opacity 300ms var(--auth-ease-out), transform 300ms var(--auth-ease-out);
}

.signup-brand-context.changing {
  opacity: 0;
  transform: translateY(8px);
}

.auth-market .brand-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.9rem;
  margin-top: auto;
  padding-top: 2.5rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.85rem;
}

.auth-market .brand-trust strong {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 750;
}

/* ---------------------------------------------------------------- Volet formulaire */

.auth-market__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 3vw, 3rem);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  padding: clamp(1.75rem, 3vw, 2.75rem);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(5, 18, 48, 0.28);
  color: var(--auth-text);
}

/* La carte d'inscription accueille cinq tuiles : elle respire davantage. */
.auth-card--wide { max-width: 560px; }

.auth-card__title {
  margin: 0 0 0.35rem;
  color: var(--auth-text);
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.auth-card__sub {
  margin: 0;
  color: var(--auth-muted);
  font-size: 0.92rem;
}

.auth-card a.auth-link {
  color: var(--auth-primary);
  font-weight: 700;
  text-decoration: none;
}

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

/* Champs : fond doux, bordure invisible au repos — comme la carte de recherche. */
.auth-card .form-label {
  margin-bottom: 0.45rem;
  color: var(--auth-muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Les champs rendus par Django (allauth) n'ont pas toujours .form-control :
   on cible aussi les balises nues pour un rendu homogène. */
.auth-card .form-control,
.auth-card .form-select,
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="tel"],
.auth-card select,
.auth-card textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--auth-surface-soft);
  color: var(--auth-text);
}

.auth-card .form-control::placeholder,
.auth-card input::placeholder { color: #98a2b3; }

.auth-card .form-control:focus,
.auth-card .form-select:focus,
.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
  border-color: var(--auth-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(70, 128, 255, 0.16);
}

.auth-card .input-group-text {
  border: 1px solid transparent;
  background: var(--auth-surface-soft);
  color: var(--auth-muted);
}

/* Action principale : ambre sur encre, l'unique bouton plein de la page. */
.auth-card .btn-auth-primary {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--auth-amber-deep);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--auth-amber), var(--auth-amber-deep));
  box-shadow: 0 8px 20px rgba(240, 168, 0, 0.32);
  color: var(--auth-on-amber);
  font-weight: 700;
  transition: transform 150ms var(--auth-ease-out), box-shadow 180ms ease, background-color 180ms ease;
}

.auth-card .btn-auth-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffcd2e, var(--auth-amber));
  box-shadow: 0 11px 26px rgba(240, 168, 0, 0.42);
  color: var(--auth-on-amber);
}

.auth-card .btn-auth-primary:active:not(:disabled) { transform: scale(0.985); }

.auth-card .btn-auth-primary:disabled {
  border-color: var(--auth-border);
  background: var(--auth-surface-soft);
  box-shadow: none;
  color: #98a2b3;
}

/* Pastille d'état des écrans de confirmation. */
.auth-status {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto;
  place-items: center;
  border: 1px solid var(--auth-border);
  border-radius: 18px;
  font-size: 1.85rem;
}

.auth-status--success {
  border-color: rgba(40, 167, 69, 0.25);
  background: rgba(40, 167, 69, 0.1);
  color: #1b7a35;
}

.auth-status--danger {
  border-color: rgba(220, 53, 69, 0.25);
  background: rgba(220, 53, 69, 0.1);
  color: #b02a37;
}

/* Marche à suivre — même trame que « Réserver prend 3 étapes ». */
.auth-steps {
  margin: 1.5rem 0;
  padding: 0;
  counter-reset: auth-step;
  list-style: none;
  text-align: left;
}

.auth-steps li {
  position: relative;
  padding: 0.45rem 0 0.45rem 2.35rem;
  color: var(--auth-muted);
  font-size: 0.9rem;
}

.auth-steps li::before {
  position: absolute;
  top: 0.4rem;
  left: 0;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(70, 128, 255, 0.2);
  border-radius: 9px;
  background: rgba(70, 128, 255, 0.08);
  color: var(--auth-primary);
  content: counter(auth-step);
  counter-increment: auth-step;
  font-size: 0.75rem;
  font-weight: 800;
}

/* Séparateur « ou continuer avec ». */
.auth-sep {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1.5rem 0 1.1rem;
  color: var(--auth-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.auth-social {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-social a {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--auth-border);
  border-radius: 11px;
  background: #ffffff;
  color: var(--auth-text);
  font-size: 1.05rem;
  transition: border-color 160ms ease, background-color 160ms ease, transform 150ms var(--auth-ease-out);
}

.auth-social a:hover {
  border-color: rgba(70, 128, 255, 0.45);
  background: var(--auth-surface-soft);
  color: var(--auth-primary);
  transform: translateY(-2px);
}

.auth-card .form-check-input:checked {
  border-color: var(--auth-primary);
  background-color: var(--auth-primary);
}

/* ---------------------------------------------------------------- Inscription */

.step-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 1.5rem 0;
}

.step-dot {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--auth-border);
  border-radius: 50%;
  background: var(--auth-surface-soft);
  color: var(--auth-muted);
  font-size: 0.85rem;
  font-weight: 750;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.step-dot.active {
  border-color: var(--auth-primary);
  background: var(--auth-primary);
  color: #ffffff;
}

.step-dot.completed {
  border-color: rgba(40, 167, 69, 0.3);
  background: rgba(40, 167, 69, 0.12);
  color: #28a745;
}

.step-connector {
  width: 54px;
  height: 2px;
  border-radius: 2px;
  background: var(--auth-border);
  transition: background-color 250ms ease;
}

.step-connector.done { background: var(--auth-primary); }

.auth-card__hint {
  margin: 0 0 0.9rem;
  color: var(--auth-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Tuiles de rôle : mêmes cartes que le catalogue de l'accueil. */
.role-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.role-tile {
  position: relative;
  padding: 1rem 0.85rem;
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(33, 52, 88, 0.06);
  cursor: pointer;
  text-align: center;
  transition:
    transform 200ms var(--auth-ease-out),
    box-shadow 200ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

/* Cinq rôles : le dernier occupe la largeur restante. */
.role-tile:last-child { grid-column: 1 / -1; }

.role-tile:hover {
  border-color: rgba(70, 128, 255, 0.42);
  box-shadow: 0 16px 36px rgba(33, 52, 88, 0.12);
  transform: translateY(-3px);
}

.role-tile.selected {
  border-color: var(--auth-primary);
  background: rgba(70, 128, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(70, 128, 255, 0.16);
}

.role-tile .role-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 0.6rem;
  place-items: center;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  font-size: 1.25rem;
}

.role-icon.icon-customer  { background: rgba(70, 128, 255, 0.1);  color: #4680ff; }
.role-icon.icon-organizer { background: rgba(40, 167, 69, 0.1);   color: #28a745; }
.role-icon.icon-venue     { background: rgba(255, 193, 7, 0.12);  color: #b47d00; }
.role-icon.icon-content   { background: rgba(114, 137, 218, 0.14); color: #5566c4; }
.role-icon.icon-transport { background: rgba(220, 53, 69, 0.1);   color: #dc3545; }

.role-tile .role-name {
  color: var(--auth-text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.role-tile .role-desc {
  margin-top: 0.2rem;
  color: var(--auth-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

/* Étape 2 injectée par HTMX. */
.signup-step-enter { animation: auth-step-in 320ms var(--auth-ease-out) both; }

@keyframes auth-step-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- Responsive */

@media (max-width: 991.98px) {
  .auth-market {
    display: block;
    min-height: 100vh;
  }

  .auth-market__brand { display: none; }

  .auth-market__panel {
    min-height: 100vh;
    padding-block: 2.5rem;
  }
}

@media (max-width: 575.98px) {
  .auth-card { padding: 1.35rem; }
  .role-grid { grid-template-columns: 1fr; }
  .role-tile:last-child { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-market *,
  .signup-brand-context {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .role-tile:hover,
  .auth-social a:hover { transform: none; }
}
