/* ──────────────────────────────────────────────────────────
   LOGIN.CSS — CROMMIX Auth — Redesign v2
   ────────────────────────────────────────────────────────── */

/* ── ROOT LAYOUT ── */
.login-root {
  display: flex;
  min-height: 100vh;
  width: 100%;
  font-family: var(--f2);
  overflow: hidden;
}

/* ──────────────────────────────────────────────────────────
   PANNEAU GAUCHE — IMAGE VIVANTE
   ────────────────────────────────────────────────────────── */
.lp-visual {
  position: relative;
  flex: 1.15;
  overflow: hidden;
}

/* Image de fond — Ken Burns effect */
.lp-visual-img {
  position: absolute;
  inset: -5%;          /* légère marge pour le zoom */
  background-size: cover;
  background-position: center;
  animation: kenBurns 18s ease-in-out infinite alternate;
}

@keyframes kenBurns {
  0%   { transform: scale(1.08) translate(0px, 0px); }
  33%  { transform: scale(1.14) translate(-12px, -8px); }
  66%  { transform: scale(1.10) translate(8px, -14px); }
  100% { transform: scale(1.06) translate(-6px, 6px); }
}

/* Voile sombre — très léger pour laisser l'image visible */
.lp-visual-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(8, 6, 20, 0.52) 0%,
    rgba(8, 6, 20, 0.28) 50%,
    rgba(8, 6, 20, 0.60) 100%
  );
  z-index: 1;
}

/* Grain de film animé */
.lp-visual-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px;
  animation: grain 0.8s steps(1) infinite;
}
@keyframes grain {
  0%  { transform: translate(0, 0); }
  10% { transform: translate(-2%, -3%); }
  20% { transform: translate(3%, 2%); }
  30% { transform: translate(-1%, 4%); }
  40% { transform: translate(2%, -1%); }
  50% { transform: translate(-3%, 3%); }
  60% { transform: translate(1%, -4%); }
  70% { transform: translate(-2%, 1%); }
  80% { transform: translate(4%, 3%); }
  90% { transform: translate(-1%, -2%); }
  100%{ transform: translate(2%, 4%); }
}

/* Particules flottantes */
.lp-particles {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}
.lp-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(-20vh) scale(1.5); opacity: 0; }
}

/* Trait rouge vertical gauche */
.lp-accent-line {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, transparent, var(--rouge), transparent);
  z-index: 10;
  opacity: 0.7;
}

/* Logo flottant en bas du panel */
.lp-brand {
  position: absolute;
  bottom: 44px;
  left: 44px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lp-brand-name {
  font-family: var(--f1);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.lp-brand-name span { color: var(--rouge); }
.lp-brand-tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Numéro décoratif (coin bas droit de l'image) */
.lp-counter {
  position: absolute;
  bottom: 44px;
  right: 44px;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--f1);
  color: rgba(255,255,255,0.18);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

/* ──────────────────────────────────────────────────────────
   BOUTON RETOUR
   ────────────────────────────────────────────────────────── */
.btn-back {
  position: absolute;
  top: 36px;
  left: 40px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f2);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.04em;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 100px;
  padding: 9px 18px 9px 14px;
  text-decoration: none;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.2s;
}
.btn-back i {
  font-size: 0.75rem;
  transition: transform 0.25s;
}
.btn-back:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.28);
  transform: translateX(-2px);
}
.btn-back:hover i { transform: translateX(-3px); }

/* ──────────────────────────────────────────────────────────
   PANNEAU DROIT — FORMULAIRE
   ────────────────────────────────────────────────────────── */
.lp-form-panel {
  flex: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 52px;
  background: #fff;
  position: relative;
}

/* Motif géométrique décoratif */
.lp-form-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}

/* Cercle décoratif rouge — coin supérieur droit */
.lp-form-panel::after {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,0,0,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.lp-form-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 390px;
}

/* En-tête */
.lp-form-header {
  margin-bottom: 44px;
}

.lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rouge);
  margin-bottom: 16px;
}
.lp-eyebrow::before {
  content: '';
  display: inline-block;
  width: 22px; height: 2px;
  background: var(--rouge);
  border-radius: 2px;
}

.lp-form-header h1 {
  font-family: var(--f1);
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--txt);
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.lp-form-header p {
  font-size: 0.88rem;
  color: var(--txt2);
  line-height: 1.7;
}

/* ── CHAMPS FLOTTANTS ── */
.fg {
  position: relative;
  margin-bottom: 20px;
}

.fg input {
  width: 100%;
  height: 58px;
  padding: 22px 52px 8px 18px;
  background: #f8f8fb;
  border: 1.5px solid #e4e4ee;
  border-radius: 14px;
  font-family: var(--f2);
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--txt);
  outline: none;
  transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
  -webkit-appearance: none;
}
.fg input:hover { border-color: #ccc; }
.fg input:focus {
  background: #fff;
  border-color: var(--rouge);
  box-shadow: 0 0 0 4px rgba(255,0,0,0.07);
}

.fg label {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--txt2);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.2s cubic-bezier(.4,0,.2,1), color 0.2s, font-size 0.2s;
}
.fg input:focus + label,
.fg input:not(:placeholder-shown) + label {
  transform: translateY(-13px) scale(0.77);
  color: var(--rouge);
  font-weight: 600;
}

.fg-icon {
  position: absolute;
  right: 17px;
  top: 50%;
  transform: translateY(-50%);
  color: #bbb;
  font-size: 0.95rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
  line-height: 1;
}
.fg input:focus ~ .fg-icon { color: var(--rouge); }

/* ── OPTIONS ── */
.form-row-opts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 28px;
  font-size: 0.82rem;
}
.form-row-opts .check-label {
  display: flex; align-items: center; gap: 7px;
  color: var(--txt2); cursor: pointer; user-select: none;
}
.form-row-opts input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--rouge); cursor: pointer;
}
.form-row-opts a {
  color: var(--txt2); font-weight: 500;
  transition: color 0.2s;
}
.form-row-opts a:hover { color: var(--rouge); }

/* ── BOUTON PRINCIPAL ── */
.btn-primary-login {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 14px;
  background: var(--rouge);
  font-family: var(--f1);
  font-size: 0.97rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s;
}
.btn-primary-login::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.btn-primary-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255,0,0,0.28);
}
.btn-primary-login:hover::after { transform: translateX(100%); }
.btn-primary-login:active { transform: translateY(0); box-shadow: none; }

/* ── DIVIDER ── */
.form-sep {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0;
  font-size: 0.75rem;
  color: #c0c0d0;
  letter-spacing: 0.07em;
  font-weight: 600;
  text-transform: uppercase;
}
.form-sep::before, .form-sep::after {
  content: ''; flex: 1; height: 1px; background: #eaeaf0;
}

/* ── SSO ── */
.sso-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.btn-sso {
  height: 48px;
  background: #f8f8fb;
  border: 1.5px solid #e4e4ee;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--f2);
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--txt);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn-sso:hover {
  border-color: #bbb;
  box-shadow: 0 4px 14px rgba(0,0,0,0.07);
  transform: translateY(-1px);
  color: var(--txt);
}

/* ── ALERTE ── */
.lp-alert {
  display: none;
  align-items: flex-start;
  gap: 10px;
  background: #fff6f6;
  border: 1px solid #ffd0d0;
  border-left: 3px solid var(--rouge);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 0.82rem;
  color: var(--txt2);
  line-height: 1.5;
}

/* ── PIED DE FORMULAIRE ── */
.lp-form-foot {
  margin-top: 34px;
  font-size: 0.78rem;
  color: var(--txt3);
  text-align: center;
  line-height: 1.75;
}
.lp-form-foot a { color: var(--rouge); font-weight: 600; transition: opacity .2s; }
.lp-form-foot a:hover { opacity: 0.7; }

.lp-copyright {
  position: absolute;
  bottom: 22px;
  left: 0; right: 0;
  text-align: center;
  font-size: 0.7rem;
  color: #ccc;
}

/* ──────────────────────────────────────────────────────────
   MODE SOMBRE — ADMINISTRATION
   ────────────────────────────────────────────────────────── */
.login-root.mode-dark .lp-form-panel {
  background: #0c0d1a;
}
.login-root.mode-dark .lp-form-panel::before {
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
}
.login-root.mode-dark .lp-form-panel::after {
  background: radial-gradient(circle, rgba(255,0,0,0.08) 0%, transparent 70%);
}

.login-root.mode-dark .lp-form-header h1 { color: #f0f0f8; }
.login-root.mode-dark .lp-form-header p  { color: rgba(255,255,255,0.38); }
.login-root.mode-dark .lp-eyebrow { color: rgba(255,80,80,0.85); }
.login-root.mode-dark .lp-eyebrow::before { background: rgba(255,80,80,0.85); }

.login-root.mode-dark .fg input {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: #f0f0f8;
}
.login-root.mode-dark .fg input:hover { border-color: rgba(255,255,255,0.18); }
.login-root.mode-dark .fg input:focus {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,60,60,0.8);
  box-shadow: 0 0 0 4px rgba(255,0,0,0.1);
}
.login-root.mode-dark .fg label { color: rgba(255,255,255,0.35); }
.login-root.mode-dark .fg input:focus + label,
.login-root.mode-dark .fg input:not(:placeholder-shown) + label { color: rgba(255,80,80,0.9); }
.login-root.mode-dark .fg-icon { color: rgba(255,255,255,0.22); }
.login-root.mode-dark .fg input:focus ~ .fg-icon { color: rgba(255,80,80,0.8); }

.login-root.mode-dark .form-row-opts .check-label { color: rgba(255,255,255,0.38); }
.login-root.mode-dark .form-row-opts a { color: rgba(255,255,255,0.38); }
.login-root.mode-dark .form-row-opts a:hover { color: rgba(255,80,80,0.8); }

.login-root.mode-dark .form-sep { color: rgba(255,255,255,0.18); }
.login-root.mode-dark .form-sep::before,
.login-root.mode-dark .form-sep::after { background: rgba(255,255,255,0.07); }

.login-root.mode-dark .btn-sso {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
}
.login-root.mode-dark .btn-sso:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.22);
  color: #fff;
}

.login-root.mode-dark .lp-alert {
  background: rgba(255,0,0,0.07);
  border-color: rgba(255,0,0,0.2);
  color: rgba(255,200,200,0.8);
}

.login-root.mode-dark .lp-form-foot { color: rgba(255,255,255,0.22); }
.login-root.mode-dark .lp-form-foot a { color: rgba(255,80,80,0.75); }
.login-root.mode-dark .lp-copyright { color: rgba(255,255,255,0.15); }

/* Badge sécurité admin */
.admin-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,0,0,0.07);
  border: 1px solid rgba(255,0,0,0.16);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 26px;
  font-size: 0.79rem;
  color: rgba(255,100,100,0.8);
  font-weight: 500;
  line-height: 1.5;
}
.admin-badge i { font-size: 1rem; flex-shrink: 0; color: rgba(255,60,60,0.9); }

/* ──────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────── */
@media(max-width: 960px) {
  .login-root { flex-direction: column; }
  .lp-visual { flex: none; min-height: 240px; }
  .lp-brand { bottom: 28px; left: 28px; }
  .lp-brand-name { font-size: 1.5rem; }
  .btn-back { top: 24px; left: 24px; }
  .lp-form-panel { padding: 40px 28px 60px; }
}
@media(max-width: 480px) {
  .lp-form-panel { padding: 28px 18px 52px; }
  .lp-form-header h1 { font-size: 1.8rem; }
  .sso-grid { grid-template-columns: 1fr; }
}

.lp-brand-logo { display: block; height: 64px; width: auto; filter: drop-shadow(0 2px 10px rgba(0,0,0,.35)); }
@media (max-width: 600px) { .lp-brand-logo { height: 46px; } }
@media (max-width: 600px) { .lp-counter { display: none; } }
