/* ==========================================================
   Connexion / Inscription — design « Aurora Sign Up »
   (traduction CSS des classes Tailwind du brief)
   ========================================================== */

:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --brand-gray: #1A1A1A;
  --white-60: rgba(255, 255, 255, 0.6);
  --white-40: rgba(255, 255, 255, 0.4);
  --white-20: rgba(255, 255, 255, 0.2);
  --white-10: rgba(255, 255, 255, 0.1);
  --white-5: rgba(255, 255, 255, 0.05);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
.auth-body {
  font-family: var(--font-sans);
  background: #000;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(255, 255, 255, 0.3); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- main : flex min-h-screen w-full bg-black p-2 (lg: h-screen overflow-hidden p-4) ---------- */
.auth {
  display: flex;
  width: 100%;
  min-height: 100vh;
  padding: 8px;
  background: #000;
  transition: all .5s;
}

/* ---------- Colonne gauche (lg:flex w-[52%]) ---------- */
.auth-hero {
  position: relative;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 52%;
  height: 100%;
  padding: 0 48px 128px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
/* Vidéo sans aucun voile ni dégradé */
.auth-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* fond : la Terre vue de l'espace (horizon dans le tiers haut, textes sur la partie sombre) */
.auth-bg { object-position: center 30%; }
.auth-hero { outline: 1px solid rgba(255, 255, 255, 0.09); outline-offset: -1px; }   /* bord visible malgré le haut noir de l’image */
.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.brand-logo {
  position: relative;
  width: 33px;
  height: 20px;
  overflow: hidden;
  flex: none;
}
.brand-logo img {
  position: absolute;
  max-width: none;
  width: 148.73%;
  height: 164.29%;
  left: -23.83%;
  top: -30.36%;
}
.brand-logo--light img { filter: invert(1); }
/* Logo officiel Aurium (blanc sur fond noir) : le noir disparaît sur la vidéo */
.hero-logo { display: block; width: auto; height: 30px; mix-blend-mode: screen; }

.hero-heading { text-align: center; }
.hero-heading h2 {
  margin: 0;
  font-size: 36px;
  line-height: 40px;
  font-weight: 500;
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.hero-heading p {
  margin: 12px 0 0;
  padding: 0 16px;
  font-size: 14px;
  line-height: 1.625;
  color: var(--white-60);
}

/* ---------- <StepItem> ---------- */
.steps { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.steps[hidden] { display: none; }
.step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--brand-gray);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  transition: background .3s, color .3s, border-color .3s;
}
.step-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--white-10);
  font-size: 13px;
  font-weight: 600;
  color: var(--white-40);
  transition: background .3s, color .3s;
}
.step.is-active { background: #fff; color: #000; border-color: #fff; }
.step.is-active .step-num { background: #000; color: #fff; }
.step.is-done .step-num { background: var(--white-20); color: #fff; }

/* Apparition échelonnée : opacité 0→1, y 10→0, 0.5s ; décalage 0.15s après 0.2s */
.reveal { opacity: 0; animation: reveal .5s ease forwards; }
.hero-content .reveal:nth-child(1) { animation-delay: .2s; }
.hero-content .reveal:nth-child(2) { animation-delay: .35s; }
.steps .reveal:nth-child(1) { animation-delay: .5s; }
.steps .reveal:nth-child(2) { animation-delay: .65s; }
.steps .reveal:nth-child(3) { animation-delay: .8s; }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Colonne droite ---------- */
.auth-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 48px 16px;
  overflow-y: auto;
}
.auth-inner {
  width: 100%;
  max-width: 576px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: fade-in .8s ease-out both;
}
.auth-inner.is-swapping { animation: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.auth-head h1 {
  margin: 0;
  font-size: 30px;
  line-height: 36px;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.auth-head p { margin: 8px 0 0; font-size: 14px; color: var(--white-40); }
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  color: var(--white-40);
}
.auth-back:hover { color: #fff; }

/* <SocialButton> */
.socials { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  border: 1px solid var(--white-10);
  border-radius: 12px;
  background: #000;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s;
}
.social-btn:hover { background: var(--white-5); }

/* Séparateur « Ou » */
.divider { position: relative; display: flex; justify-content: center; }
.divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; border-top: 1px solid var(--white-10); }
.divider span {
  position: relative;
  padding: 0 16px;
  background: #000;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white-40);
}

/* <InputGroup> */
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.input-group label, .input-label { font-size: 14px; font-weight: 500; color: #fff; }
.input-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.input-wrap { position: relative; }
.input-group input, .input-group select {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 12px;
  background: var(--brand-gray);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: box-shadow .2s;
}
.input-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-opacity='.4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.input-group select:invalid { color: var(--white-20); }
.input-group option { color: #000; }
.input-group input::placeholder { color: var(--white-20); }
.input-group input:focus, .input-group select:focus { box-shadow: 0 0 0 2px var(--white-20); }
.input-group input.is-invalid { box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.6); }
.input-wrap input { padding-right: 48px; }
.eye-btn {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--white-40);
}
.eye-btn:hover { color: #fff; }
.helper { margin: 0; font-size: 12px; color: var(--white-40); }
.field-error { margin: 0; font-size: 12px; color: #f87171; }
.form-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.1);
  font-size: 13px;
  color: #fca5a5;
}
.form-error[hidden], .field-error[hidden] { display: none; }
.form-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--white-5);
  font-size: 13px;
  line-height: 1.5;
  color: var(--white-60);
}
.form-note strong { color: #fff; font-weight: 500; }
.link-quiet { padding: 0; border: 0; background: none; font-size: 12px; color: var(--white-40); text-decoration: none; }
.link-quiet:hover { color: #fff; }

.btn-submit {
  width: 100%;
  height: 56px;
  margin-top: 16px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #000;
  font-size: 15px;
  font-weight: 600;
  transition: background .2s, transform .1s;
}
.btn-submit:hover { background: rgba(255, 255, 255, 0.9); }
.btn-submit:active { transform: scale(0.98); }

.auth-foot { margin: 0; text-align: center; font-size: 14px; color: var(--white-40); }
.auth-foot a, .auth-foot button { padding: 0; border: 0; background: none; font-weight: 500; color: #fff; text-decoration: none; }
.auth-foot a:hover, .auth-foot button:hover { text-decoration: underline; }

/* Mode démo (Supabase pas encore configuré) */
.demo-box { padding: 14px 16px; border: 1px dashed var(--white-20); border-radius: 14px; background: var(--white-5); font-size: 13px; color: var(--white-60); }
.demo-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 500; color: #fff; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: #f5b301; flex: none; }
.demo-creds { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; }
.demo-creds dt { color: var(--white-40); }
.demo-creds dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: #fff; user-select: all; }
.demo-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.demo-btn { height: 34px; padding: 0 14px; border: 1px solid var(--white-20); border-radius: 10px; background: var(--white-10); font: inherit; font-size: 13px; font-weight: 500; color: #fff; cursor: pointer; }
.demo-btn:hover { background: var(--white-20); }

/* Toast */
.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff;
  color: #000;
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.auth-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Breakpoints Tailwind : sm 640, lg 1024, xl 1280 ---------- */
@media (min-width: 640px) {
  .auth-panel { padding-left: 48px; padding-right: 48px; }
  .auth-inner { gap: 40px; }
}
@media (min-width: 1024px) {
  .auth { height: 100vh; overflow: hidden; padding: 16px; }
  .auth-hero { display: flex; }
  .auth-panel { padding: 24px 64px; overflow: hidden; }
  .auth-inner { gap: 24px; }
}
/* Écrans d'ordinateur peu hauts : le formulaire défile plutôt que d'être coupé */
@media (min-width: 1024px) and (max-height: 820px) {
  .auth-panel { overflow-y: auto; justify-content: flex-start; }
  .auth-inner { margin: auto 0; }
  .auth-hero { padding-bottom: 64px; }
}
@media (min-width: 1280px) {
  .auth-panel { padding-left: 96px; padding-right: 96px; }
}
@media (max-width: 420px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .auth-inner { animation: none; opacity: 1; }
}

/* Sélecteur de langue FR / EN */
.auth-panel { position: relative; }
.auth-lang {
  position: absolute;
  top: 16px;
  right: 16px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted, rgba(0, 0, 0, 0.5));
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
html[lang="fr"] .auth-lang span:first-child, html[lang="en"] .auth-lang span:last-child { color: var(--text-strong, #111); font-weight: 600; }

.helper a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.helper a:hover { text-decoration-thickness: 2px; }
