/*
 * Connexion « Toussus en ce moment » : le formulaire d'un côté, le terrain vu du ciel de l'autre (aerodrome.css).
 * Le formulaire est utilisable dès la première image ; son arrivée ne fait qu'ajouter du mouvement.
 */
.login-body {
  background: var(--color-surface);
}

.login {
  display: grid;
  grid-template-areas: "scene access";
  grid-template-columns: minmax(0, 1.5fr) minmax(26rem, 1fr);
  min-height: 100vh;
  min-height: 100svh;
}

.login-access {
  grid-area: access;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--space-8) clamp(var(--space-6), 4vw, 4.5rem);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  font-weight: 600;
}

.login-brand img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-pill);
}

.login-access > .legal-links {
  justify-content: flex-start;
}

.login-card {
  display: grid;
  gap: var(--space-6);
  width: 100%;
  max-width: 24rem;
  margin: auto 0;
  padding: var(--space-12) 0;
}

.login-title {
  font-size: clamp(2.5rem, 1.75rem + 1.6vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.login-lead {
  max-width: 30ch;
  margin-top: var(--space-3);
  color: var(--color-text);
  font-size: var(--text-lg);
  line-height: 1.45;
}

.login-form {
  display: grid;
  gap: var(--space-5);
}

.login-form .input {
  min-height: 3rem;
}

.login-passkey {
  display: grid;
  gap: var(--space-2);
  margin-top: calc(-1 * var(--space-2));
}

.login-links {
  display: grid;
  gap: var(--space-3);
  font-size: var(--text-md);
}

.login-note {
  color: var(--color-text-muted);
  font-size: var(--text-md);
}

/* Le cartouche, comme sur une carte : le terrain, l'heure, le vent, la nuit qui vient. */
.aerodrome-now {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: grid;
  gap: var(--space-1);
  max-width: min(32rem, 100%);
  padding: var(--space-5) var(--space-8) var(--space-6) var(--space-6);
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.aerodrome-place {
  color: inherit;
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.aerodrome-time {
  margin-left: var(--space-2);
  color: var(--color-map-caption);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.aerodrome-wind {
  font-size: var(--text-base);
}

.aerodrome-details {
  color: var(--color-map-caption);
  font-size: var(--text-md);
}

/* Sur téléphone seulement : la marque de l'école passe sur la carte, le formulaire remonte. */
.aerodrome-brand {
  display: none;
}

.aerodrome-replay {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-primary);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out);
}

.aerodrome-replay[hidden] {
  display: none;
}

.aerodrome-replay:active {
  transform: scale(0.94);
}

.aerodrome-replay svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* L'arrivée : la marque, puis le titre, le formulaire et les liens, en moins d'une seconde. */
@media (prefers-reduced-motion: no-preference) {
  .login-brand,
  .login-card > * {
    animation: login-rise 640ms var(--ease-expo) both;
  }

  .login-card > :nth-child(1) {
    animation-delay: 60ms;
  }

  .login-card > :nth-child(2) {
    animation-delay: 130ms;
  }

  .login-card > :nth-child(3) {
    animation-delay: 200ms;
  }

  .login-card > :nth-child(n + 4) {
    animation-delay: 270ms;
  }

  .aerodrome-now > * {
    animation: login-rise 640ms var(--ease-expo) both;
  }

  .aerodrome-now > :nth-child(1) {
    animation-delay: 320ms;
  }

  .aerodrome-now > :nth-child(2) {
    animation-delay: 390ms;
  }

  .aerodrome-now > :nth-child(3) {
    animation-delay: 460ms;
  }

  /* Un refus fait hocher le formulaire, une fois. */
  .login-form:has(.notice--bad) {
    animation:
      login-rise 640ms var(--ease-expo) both,
      login-refused 420ms var(--ease-out) 380ms;
  }
}

@keyframes login-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes login-refused {
  20%,
  60% {
    transform: translateX(-7px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

@media (max-width: 60rem) {
  .login {
    grid-template-areas:
      "scene"
      "access";
    grid-template-columns: minmax(0, 1fr);
  }

  .login-access {
    padding: var(--space-4) var(--space-4) var(--space-8);
  }

  .login-brand {
    display: none;
  }

  .login-card {
    max-width: 30rem;
    margin: 0 auto;
    gap: var(--space-5);
    padding: var(--space-4) 0 var(--space-10);
  }

  .login-access > .legal-links {
    justify-content: center;
  }

  .login-title {
    font-size: 2.25rem;
  }

  .aerodrome-brand {
    position: absolute;
    top: var(--space-4);
    left: var(--space-4);
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-4) var(--space-1) var(--space-1);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--text-md);
    font-weight: 600;
  }

  .aerodrome-brand img {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-pill);
  }

  .aerodrome-now {
    gap: 0;
    padding: var(--space-2) var(--space-4) var(--space-3) var(--space-4);
  }

  .aerodrome-place {
    font-size: var(--text-base);
  }

  .aerodrome-wind,
  .aerodrome-details {
    font-size: var(--text-sm);
  }

  .aerodrome-replay {
    top: var(--space-4);
    right: var(--space-4);
  }
}
