/* login.css — Page de connexion du Portail des démos (split-screen).
   Palette : blanc-labo froid à gauche, nuit indigo→violet à droite ; accent indigo. */

:root {
  --ink: #0E1526;
  --muted: #5B6577;
  --line: #E3E7EF;
  --surface: #F7F8FB;
  --white: #FFFFFF;
  --accent: #4C5FEF;
  --accent-strong: #3A4BD6;
  --accent-050: #EEF0FF;
  --danger: #C0392B;
  --danger-bg: #FDECEA;

  --night-1: #12183A;
  --night-2: #251A4E;
  --night-3: #0C1030;
  --glow-a: #6D5CF0;
  --glow-b: #22B8D6;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;

  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { height: 100%; max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

.auth {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ------------------------------- Panneau formulaire ------------------------------- */
.auth__form {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--surface);
}

.auth__inner {
  width: 100%;
  max-width: 380px;
}

/* Entrée en cascade des éléments */
.auth__inner > * {
  opacity: 0;
  animation: rise .6s cubic-bezier(.2, .7, .2, 1) forwards;
}
.auth__inner > *:nth-child(1) { animation-delay: .04s; }
.auth__inner > *:nth-child(2) { animation-delay: .12s; }
.auth__inner > *:nth-child(3) { animation-delay: .20s; }
.auth__inner > *:nth-child(4) { animation-delay: .28s; }
.auth__inner > *:nth-child(5) { animation-delay: .36s; }
.auth__inner > *:nth-child(6) { animation-delay: .44s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Marque */
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 2.25rem;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--white);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 6px 16px -6px rgba(76, 95, 239, .6);
}
.brand__word {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: .02em;
  font-size: 1rem;
  color: var(--ink);
}

/* Titre + description */
.intro { margin-bottom: 1.75rem; }
.intro__title {
  margin: 0 0 .35rem;
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 680;
  letter-spacing: -.02em;
}
.intro__desc {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}

/* Alerte d'erreur */
.alert {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.25rem;
  padding: .7rem .85rem;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: .875rem;
  border: 1px solid rgba(192, 57, 43, .18);
}

/* Formulaire */
.form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field > label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink);
}

.control {
  position: relative;
  display: flex;
  align-items: center;
}
.control__icon {
  position: absolute;
  left: .85rem;
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
}
.control input {
  width: 100%;
  height: 46px;
  padding: 0 2.6rem;
  font-size: .95rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.control input::placeholder { color: #9AA3B2; }
.control input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-050);
}
.control__toggle {
  position: absolute;
  right: .5rem;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.control__toggle:hover { color: var(--ink); background: #EEF1F6; }
.control__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Ligne « se souvenir de moi » */
.row { display: flex; align-items: center; }
.check {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .875rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--white);
  transition: background .15s, border-color .15s;
}
.check__box .bi { font-size: .8rem; opacity: 0; transform: scale(.6); transition: .15s; }
.check input:checked + .check__box {
  background: var(--accent);
  border-color: var(--accent);
}
.check input:checked + .check__box .bi { opacity: 1; transform: none; }
.check input:focus-visible + .check__box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Bouton */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  height: 48px;
  margin-top: .25rem;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--white);
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--accent-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn[disabled] { opacity: .8; cursor: default; }
.btn__spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin .7s linear infinite;
}
.btn.is-loading .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Pied */
.foot {
  margin: 1.75rem 0 0;
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------- Panneau visuel (droite) ------------------------------- */
.auth__aside {
  position: relative;
  flex: 1 1 50%;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 80% 0%, var(--night-2) 0%, var(--night-1) 45%, var(--night-3) 100%);
  isolation: isolate;
}
.aside__glow {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 70%;
  background:
    radial-gradient(40% 50% at 25% 30%, rgba(109, 92, 240, .55), transparent 70%),
    radial-gradient(35% 45% at 80% 20%, rgba(34, 184, 214, .35), transparent 70%);
  filter: blur(10px);
  animation: drift 16s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(4%, 3%, 0) scale(1.08); }
}

/* Fenêtres de navigateur flottantes */
.previews {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
}
.win {
  position: absolute;
  width: min(340px, 60%);
  margin: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(8px);
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .6);
  overflow: hidden;
  animation: float 9s ease-in-out infinite;
}
.win__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .06);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.win__bar span {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255, 255, 255, .35);
}
.win__bar span:nth-child(1) { background: #ff6058; }
.win__bar span:nth-child(2) { background: #ffbd2e; }
.win__bar span:nth-child(3) { background: #29c93f; }
.win__bar em {
  margin-left: auto;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: .68rem;
  color: rgba(255, 255, 255, .55);
  letter-spacing: .01em;
}
.win__body { padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.wf { border-radius: 5px; background: rgba(255, 255, 255, .16); }
.wf--head { height: 12px; width: 45%; }
.wf--hero { height: 62px; background: linear-gradient(120deg, rgba(109,92,240,.55), rgba(34,184,214,.4)); }
.wf--line { height: 9px; width: 100%; }
.wf--line.short { width: 65%; }
.wf--row { display: flex; gap: 9px; }
.wf--col { flex: 1; height: 34px; }

.win--1 {
  transform: translate(-32%, -22%) rotate(-6deg);
  animation-delay: 0s;
}
.win--2 {
  transform: translate(30%, 4%) rotate(5deg);
  width: min(300px, 54%);
  animation-delay: 1.4s;
  opacity: .96;
}
.win--3 {
  transform: translate(-6%, 32%) rotate(-2deg);
  width: min(270px, 50%);
  animation-delay: 2.6s;
  opacity: .9;
}
@keyframes float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -14px; }
}

/* Légende */
.aside__caption {
  position: absolute;
  left: 3rem;
  bottom: 2.75rem;
  z-index: 2;
  max-width: 70%;
}
.aside__caption .eyebrow {
  margin: 0 0 .4rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .6);
}
.aside__caption .lead {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
}

/* ------------------------------- Responsive ------------------------------- */
@media (max-width: 900px) {
  .auth__aside { display: none; }
  .auth__form { flex: 1 1 100%; width: 100%; padding: 2rem 1.25rem; }
  .auth__inner { max-width: 440px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth__inner > *,
  .aside__glow,
  .win,
  .btn__spinner { animation: none; }
  .auth__inner > * { opacity: 1; }
}
