/* ==================================================================
   auth.css, la page de connexion.
   ================================================================== */

.auth-body {
  display: grid;
  /* `safe` : quand le contenu depasse la hauteur de la fenetre, la boite
     s'aligne en haut au lieu de rester centree. Sans ce mot, le logo et
     le titre passaient au-dessus du bord superieur, hors d'atteinte. */
  place-items: safe center;
  align-content: safe center;
  min-height: 100dvh;
  padding: 28px 18px;
  background:
    radial-gradient(90% 70% at 50% -10%, rgba(120, 90, 255, .22), transparent 70%),
    radial-gradient(70% 60% at 100% 100%, rgba(63, 169, 255, .12), transparent 70%),
    var(--bg);
}

.auth {
  width: min(430px, 100%);
  text-align: center;
}

/* La page d'entree est le seul endroit ou le logo a la place de se
   montrer en entier : il n'y a rien d'autre a regarder, et c'est la
   premiere image que le visiteur garde de l'application. */
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.auth-logo {
  width: clamp(104px, 26vw, 150px);
  height: auto;
  filter: drop-shadow(0 14px 34px rgba(150, 90, 255, .42));
  animation: auth-logo-in .7s var(--ease-out) both;
}
@keyframes auth-logo-in {
  from { opacity: 0; transform: translateY(14px) scale(.9) rotate(-5deg); }
}
.auth-brand em { font-style: normal; color: #c4a4ff; }


.auth h1 {
  text-wrap: balance;
  font-size: clamp(25px, 5.5vw, 33px);
  line-height: 1.18;
  letter-spacing: -.02em;
}
.auth-lead {
  margin: 12px auto 26px;
  max-width: 36ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}

.auth-box {
  padding: 24px 22px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(24, 24, 38, .96), rgba(11, 11, 19, .98));
  box-shadow: var(--shadow);
  text-align: left;
}

.auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 12px;
  background: #fff;
  color: #1a1a24;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.auth-google svg { width: 18px; height: 18px; }
.auth-google:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -12px rgba(255, 255, 255, .55);
}
.auth-google:disabled { opacity: .6; cursor: default; }

.auth-or {
  position: relative;
  margin: 20px 0;
  text-align: center;
}
.auth-or::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--line);
}
.auth-or span {
  position: relative;
  padding: 0 12px;
  background: #14141f;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-3);
}

.auth-mail label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
}
.auth-mail input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 11px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(0, 0, 0, .3);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.auth-mail input:focus {
  outline: none;
  border-color: hsl(268 75% 65% / .85);
}
.auth-mail .btn { width: 100%; padding: 12px 0; font-size: 14px; }

.auth-msg {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .05);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}
.auth-msg.is-error {
  border-color: rgba(255, 77, 109, .45);
  background: rgba(255, 77, 109, .12);
  color: #ffc2ce;
}
.auth-msg.is-ok {
  border-color: rgba(46, 224, 138, .45);
  background: rgba(46, 224, 138, .1);
  color: #a8ffd6;
}

.auth-note {
  margin-top: 16px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.auth-legal {
  margin-top: 20px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-3);
}
.auth-legal a { color: var(--ink-2); }

/* L'écran d'attente pendant qu'on vérifie la session au chargement :
   le logo qui respire et une fine barre qui balaie. Il s'efface en
   fondu quand l'application est prête, au lieu de disparaître d'un coup. */
.gate {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 50% at 50% 42%, rgba(139, 92, 246, .16), transparent 70%),
    var(--bg);
  color: var(--ink-2);
  font-size: 13.5px;
  text-align: center;
  transition: opacity .45s var(--ease-out), visibility .45s;
}
.gate.is-out { opacity: 0; visibility: hidden; }
.gate-in { display: grid; place-items: center; gap: 18px; padding: 24px; }
.gate-in p + p { margin-top: 4px; }
.gate-logo {
  width: min(220px, 56vw); height: auto; aspect-ratio: 2000 / 1091;
  animation: gate-breathe 1.8s ease-in-out infinite;
}
@keyframes gate-breathe {
  0%, 100% { transform: scale(1); opacity: .85; }
  50%      { transform: scale(1.07); opacity: 1; }
}
.gate-bar {
  position: relative;
  width: 120px; height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
}
.gate-bar i {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #a78bfa, #22d3ee, transparent);
  animation: gate-sweep 1.1s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes gate-sweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(250%); }
}

/* ------------------- connexion par mot de passe ------------------- */

.auth-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
}
.auth-tab {
  flex: 1 1 0;
  padding: 8px 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.auth-tab.is-on {
  color: #fff;
  background: rgba(255, 255, 255, .11);
}

.auth-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
}
.auth-form label + input { margin-bottom: 12px; }
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(0, 0, 0, .3);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.auth-form input:focus {
  outline: none;
  border-color: hsl(268 75% 65% / .85);
}
.auth-form .btn { width: 100%; padding: 12px 0; font-size: 14px; margin-top: 4px; }

.auth-pass { position: relative; margin-bottom: 8px; }
.auth-pass input { padding-right: 68px !important; margin-bottom: 0 !important; }
.auth-eye {
  position: absolute;
  right: 6px; top: 50%;
  translate: 0 -50%;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.auth-eye:hover { background: rgba(255, 255, 255, .16); color: #fff; }

.auth-hint {
  margin-bottom: 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: space-between;
  margin-top: 14px;
}
.auth-link {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
}
.auth-link:hover { color: var(--ink); }

@media (max-width: 480px) { .auth h1 br { display: none; } }
