/* =========================================================
   Page de connexion — deux colonnes (charte « esprit Vuexy »)
   Chargée uniquement par app/Views/auth.php.

   Gauche : panneau au dégradé primaire, marque, accroche et
   illustration vectorielle inline (SVG dessiné à la main).
   Droite : carte de connexion sur le fond de page.
   Sous 992px : une seule colonne, le panneau devient un bandeau.

   Zéro dépendance : uniquement du CSS et un SVG en ligne.
   ========================================================= */

.auth-body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: stretch;
  background: var(--body-bg);
}

/* ---------------------------------------------------------
   Panneau gauche
   --------------------------------------------------------- */
.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: 3rem 3.5rem;
  background: var(--gradient-brand);
  color: #fff;
}
/* margin auto vertical : centré quand la place le permet, jamais rogné en
   haut sur un écran bas (ce que justify-content:center ferait). */
.auth-aside__contenu { margin: auto 0; }
/* Halos doux : un peu de profondeur sur le dégradé plat. */
.auth-aside::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(50% 45% at 85% 10%, rgba(255, 255, 255, .22), transparent 70%),
    radial-gradient(45% 40% at 10% 90%, rgba(249, 112, 102, .35), transparent 70%);
}
.auth-aside__contenu { position: relative; z-index: 2; max-width: 520px; width: 100%; }

.auth-aside__marque { display: flex; align-items: center; gap: .75rem; margin-bottom: 2.25rem; }
.auth-aside__logo {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .18); color: #fff; font-size: 22px;
  border: 1px solid rgba(255, 255, 255, .25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.auth-aside__nom { font-size: 20px; font-weight: 700; line-height: 1.1; letter-spacing: -.2px; }
.auth-aside__nom small { display: block; font-size: 11.5px; font-weight: 500; color: rgba(255,255,255,.7); letter-spacing: .3px; }

.auth-aside__titre {
  font-size: 32px; line-height: 1.2; font-weight: 700;
  margin: 0 0 .85rem;
  color: #fff; /* theme.css colore les titres avec --text : illisible ici */
  letter-spacing: -.3px;
}
.auth-aside__titre em { font-style: normal; color: #FDE8D0; }
.auth-aside__accroche { color: rgba(255,255,255,.82); font-size: 15px; margin: 0 0 2rem; max-width: 440px; }

/* Illustration : pelleteuse, tranchée, tablette. */
.auth-aside__illu {
  display: block; width: 100%; max-width: 480px; height: auto;
  margin: 0 auto 1.75rem;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .18));
}
.auth-aside__illu .illu-flotte { animation: illu-flotte 5s ease-in-out infinite; transform-origin: center; }
.auth-aside__illu .illu-bras { animation: illu-bras 6s ease-in-out infinite; transform-origin: 208px 128px; }
@keyframes illu-flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes illu-bras { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-4deg); } }

.auth-aside__points { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.auth-aside__points li { display: flex; align-items: center; gap: .75rem; font-size: 14px; color: rgba(255,255,255,.92); }
.auth-aside__points i {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
  font-size: 16px; color: #fff;
}

/* ---------------------------------------------------------
   Colonne droite : carte de connexion
   --------------------------------------------------------- */
.auth-main {
  position: relative;
  width: 100%; max-width: 480px; margin: 0 auto; padding: 2.5rem 1.5rem;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-card { padding: 2.25rem; border: 0; }
.auth-card:hover { transform: none; box-shadow: var(--shadow-card); }
.auth-card__logo {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: var(--gradient-brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 26px;
  margin-bottom: 1rem; box-shadow: var(--shadow-primary);
}
.auth-card h1 { font-size: 24px; font-weight: 700; margin-bottom: .25rem; letter-spacing: -.3px; }
.auth-pied { font-size: 12px; text-align: center; margin: 1rem 0 0; color: var(--text-muted); }

/* Bascule de thème posée en haut à droite de la colonne. */
.auth-theme {
  position: absolute; top: 1rem; right: 1rem; z-index: 5;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text-muted); font-size: 19px;
  box-shadow: var(--shadow-card); cursor: pointer;
  transition: color .15s, transform .12s;
}
.auth-theme:hover { color: var(--primary); }
.auth-theme:active { transform: scale(.94); }
.auth-theme:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--primary-02); }
.auth-theme .ri-sun-line { display: none; }
[data-theme="dark"] .auth-theme .ri-sun-line { display: inline; }
[data-theme="dark"] .auth-theme .ri-moon-line { display: none; }

/* Le remplissage automatique de Chrome force un fond blanc : on le repeint en sombre. */
[data-theme="dark"] .auth-card .form-control:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 40px var(--input-bg) inset;
}

/* Sous 992px : une seule colonne, panneau en bandeau court sans illustration. */
@media (max-width: 991.98px) {
  .auth-body { grid-template-columns: 1fr; align-items: start; }
  .auth-aside { padding: 1.75rem 1.5rem; justify-content: flex-start; }
  .auth-aside__marque { margin-bottom: 1.25rem; }
  .auth-aside__titre { font-size: 22px; }
  .auth-aside__accroche { margin-bottom: 0; font-size: 14px; }
  .auth-aside__illu, .auth-aside__points { display: none; }
  .auth-main { padding: 1.5rem 1rem 2rem; max-width: 520px; }
  .auth-card { padding: 1.5rem; }
  .auth-theme { top: .75rem; right: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-aside__illu .illu-flotte, .auth-aside__illu .illu-bras { animation: none; }
}
