/* ── Login modal — ultra-premium XL split layout ── */

#login-modal {
  --lm-cyan: #22d3ee;
  --lm-violet: #a78bfa;
  --lm-indigo: #6366f1;
  --lm-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --lm-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

#login-modal-backdrop {
  background:
    radial-gradient(ellipse 90% 70% at 50% 35%, rgba(34, 211, 238, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 70% 55% at 85% 15%, rgba(99, 102, 241, 0.14) 0%, transparent 50%),
    rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

#login-modal-content {
  width: min(100%, 76rem);
  max-height: min(94vh, 52rem);
}

.lm-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  min-height: min(94vh, 52rem);
  overflow: hidden;
  border-radius: 2rem;
  background: linear-gradient(155deg, rgba(12, 20, 36, 0.98) 0%, rgba(8, 14, 28, 0.99) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(34, 211, 238, 0.08),
    0 50px 120px rgba(0, 0, 0, 0.62),
    0 0 120px rgba(34, 211, 238, 0.07);
}

.lm-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.45) 0%,
    rgba(255, 255, 255, 0.06) 28%,
    rgba(167, 139, 250, 0.35) 55%,
    rgba(255, 255, 255, 0.04) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
}

@media (min-width: 900px) {
  .lm-shell {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    min-height: 36rem;
  }
}

/* ── Visual panel ── */
.lm-visual {
  position: relative;
  display: none;
  min-height: 22rem;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (min-width: 900px) {
  .lm-visual {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: auto;
    border-bottom: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }
}

.lm-visual__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 28% 22%, rgba(34, 211, 238, 0.32) 0%, transparent 38%),
    radial-gradient(circle at 78% 58%, rgba(167, 139, 250, 0.26) 0%, transparent 42%),
    radial-gradient(circle at 50% 100%, rgba(99, 102, 241, 0.2) 0%, transparent 48%),
    linear-gradient(168deg, #050912 0%, #0a1424 42%, #0e1a30 100%);
}

.lm-visual__noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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");
  pointer-events: none;
}

.lm-viz-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.lm-visual__scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(34, 211, 238, 0.14) 48%,
    rgba(34, 211, 238, 0.28) 50%,
    rgba(34, 211, 238, 0.14) 52%,
    transparent 100%
  );
  transform: translateY(-110%);
}

#login-modal.is-open .lm-visual__scan {
  animation: lm-scan-sweep 1.1s var(--lm-ease-out) 0.15s forwards;
}

.lm-visual__hud {
  position: relative;
  z-index: 4;
  margin: 1.75rem 1.75rem 0;
  padding: 1rem 1.125rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(34, 211, 238, 0.18);
  background: rgba(6, 12, 24, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@media (min-width: 900px) {
  .lm-visual__hud {
    margin: 2rem 2rem 0;
    padding: 1.125rem 1.25rem;
  }
}

.lm-hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.875rem;
}

.lm-hud-label {
  font-family: var(--font-title);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.95);
}

.lm-hud-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  font-family: var(--font-title);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(103, 232, 249, 0.95);
}

.lm-hud-status::before {
  content: "";
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: var(--lm-cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.9);
  animation: lm-pulse 1.8s ease-in-out infinite;
}

.lm-hud-status.is-ready {
  color: rgba(167, 243, 208, 0.95);
}

.lm-hud-status.is-ready::before {
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.85);
}

.lm-hud-nodes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.lm-hud-node {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.35s var(--lm-ease), background 0.35s var(--lm-ease), box-shadow 0.35s var(--lm-ease);
}

.lm-hud-node.is-active {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.12);
}

.lm-hud-node strong {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.lm-hud-node span {
  font-family: var(--font-title);
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
}

.lm-visual__content {
  position: relative;
  z-index: 4;
  padding: 1.5rem 1.75rem 2rem;
}

@media (min-width: 900px) {
  .lm-visual__content {
    padding: 1.75rem 2rem 2.25rem;
  }
}

.lm-visual__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.125rem;
  padding: 0.4375rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.1);
  font-family: var(--font-title);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(165, 243, 252, 0.98);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.1);
}

.lm-visual__badge-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: var(--lm-cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.9);
  animation: lm-pulse 2s ease-in-out infinite;
}

.lm-visual__title {
  max-width: 20rem;
  font-size: clamp(1.75rem, 2.8vw, 2.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #fff;
}

.lm-visual__subtitle {
  margin-top: 0.875rem;
  max-width: 22rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgba(203, 213, 225, 0.82);
}

.lm-visual__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.lm-visual__stat {
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 8rem;
  padding: 1rem 1.125rem;
  border-radius: 1.125rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.lm-visual__stat strong {
  display: block;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.lm-visual__stat span {
  display: block;
  margin-top: 0.1875rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.92);
}

/* ── Form panel ── */
.lm-form-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.25rem 1.75rem;
  overflow-y: auto;
}

@media (min-width: 640px) {
  .lm-form-panel {
    padding: 3rem 3.25rem;
  }
}

.lm-form-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 100% 0%, rgba(34, 211, 238, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(167, 139, 250, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.lm-form-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
}

.lm-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(226, 232, 240, 0.9);
  transition: background 0.2s var(--lm-ease), color 0.2s var(--lm-ease), border-color 0.2s var(--lm-ease), transform 0.2s var(--lm-ease);
}

.lm-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(34, 211, 238, 0.4);
  color: #fff;
  transform: scale(1.04);
}

.lm-header {
  position: relative;
  margin-bottom: 2.25rem;
}

.lm-kicker {
  font-family: var(--font-title);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(34, 211, 238, 0.9);
}

.lm-title {
  margin-top: 0.625rem;
  font-size: clamp(2rem, 4.5vw, 2.625rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: #fff;
}

.lm-lead {
  margin-top: 0.75rem;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(148, 163, 184, 0.96);
}

.lm-field label {
  display: block;
  margin-bottom: 0.5625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(226, 232, 240, 0.94);
}

.lm-input-wrap {
  position: relative;
}

.lm-input-icon {
  position: absolute;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1875rem;
  height: 1.1875rem;
  color: rgba(148, 163, 184, 0.78);
  pointer-events: none;
  transition: color 0.2s var(--lm-ease);
}

.lm-input {
  width: 100%;
  padding: 1rem 1.125rem 1rem 2.875rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  font-size: 1rem;
  transition:
    border-color 0.2s var(--lm-ease),
    background 0.2s var(--lm-ease),
    box-shadow 0.2s var(--lm-ease);
}

.lm-input::placeholder {
  color: rgba(100, 116, 139, 0.88);
}

.lm-input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(255, 255, 255, 0.055);
  box-shadow:
    0 0 0 3px rgba(34, 211, 238, 0.14),
    0 0 32px rgba(34, 211, 238, 0.1);
}

.lm-input-wrap:focus-within .lm-input-icon {
  color: rgba(34, 211, 238, 0.95);
}

.lm-toggle-pwd {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.3125rem;
  border: 0;
  background: transparent;
  color: rgba(148, 163, 184, 0.78);
  cursor: pointer;
  transition: color 0.2s var(--lm-ease);
}

.lm-toggle-pwd:hover {
  color: rgba(34, 211, 238, 0.95);
}

.lm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
}

.lm-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5625rem;
  cursor: pointer;
  font-size: 0.8125rem;
  color: rgba(203, 213, 225, 0.92);
}

.lm-check input {
  width: 1.0625rem;
  height: 1.0625rem;
  border-radius: 0.3125rem;
  accent-color: var(--lm-cyan);
}

.lm-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(34, 211, 238, 0.96);
  transition: color 0.2s var(--lm-ease);
}

.lm-link:hover {
  color: #67e8f9;
}

.lm-submit {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 1.0625rem 1.75rem;
  border: 0;
  border-radius: 9999px;
  background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 40%, #6366f1 100%);
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  cursor: pointer;
  box-shadow:
    0 0 40px rgba(34, 211, 238, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transition:
    transform 0.22s var(--lm-ease),
    box-shadow 0.22s var(--lm-ease),
    opacity 0.22s var(--lm-ease);
}

.lm-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.38) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--lm-ease);
}

.lm-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 0 56px rgba(34, 211, 238, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.lm-submit:hover:not(:disabled)::before {
  transform: translateX(120%);
}

.lm-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.lm-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(148, 163, 184, 0.96);
}

.lm-footer a {
  font-weight: 700;
  color: rgba(34, 211, 238, 0.96);
}

.lm-error {
  display: none;
  margin-bottom: 1.125rem;
  padding: 0.875rem 1.125rem;
  border-radius: 1rem;
  border: 1px solid rgba(248, 113, 113, 0.38);
  background: rgba(239, 68, 68, 0.12);
  font-size: 0.8125rem;
  color: #fecaca;
}

.lm-error.is-visible {
  display: block;
  animation: lm-shake 0.45s var(--lm-ease);
}

.lm-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.375rem;
}

/* Mobile visual strip */
@media (max-width: 899px) {
  .lm-visual {
    display: block;
    min-height: 14rem;
  }

  .lm-visual__content,
  .lm-visual__stats {
    display: none;
  }

  .lm-visual__hud {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    margin: 0;
    z-index: 5;
  }
}

/* Entrance */
#login-modal.is-open #login-modal-content {
  animation: lm-modal-in 0.6s var(--lm-ease-out) forwards;
}

#login-modal.is-open .lm-visual__hud,
#login-modal.is-open .lm-visual__content {
  animation: lm-slide-up 0.65s var(--lm-ease-out) 0.1s both;
}

#login-modal.is-open .lm-form-inner > * {
  animation: lm-slide-up 0.55s var(--lm-ease-out) both;
}

#login-modal.is-open .lm-header { animation-delay: 0.08s; }
#login-modal.is-open .lm-error { animation-delay: 0.12s; }
#login-modal.is-open .lm-form { animation-delay: 0.14s; }
#login-modal.is-open .lm-footer { animation-delay: 0.2s; }

@keyframes lm-modal-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(18px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes lm-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lm-scan-sweep {
  0% {
    opacity: 0;
    transform: translateY(-110%);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(110%);
  }
}

@keyframes lm-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.82); }
}

@keyframes lm-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .lm-visual__scan,
  .lm-hud-status::before,
  .lm-visual__badge-dot,
  #login-modal.is-open #login-modal-content,
  #login-modal.is-open .lm-visual__hud,
  #login-modal.is-open .lm-visual__content,
  #login-modal.is-open .lm-form-inner > * {
    animation: none !important;
  }
}

/* Proportions grand écran : cadre et rôles typographiques fluides. */

@media (min-width: 1600px) {
 #login-modal-content { width: min(100%, clamp(76rem, calc(36rem + 40vw), 120rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; }
 .lm-shell { min-height: 0; }
 .lm-form-panel { min-width: 0; }
 .lm-check, .lm-link, .lm-field-label, .lm-form-footer { font-size: var(--fs-small); }
 .lm-submit { font-size: var(--fs-button); min-height: 3em; height: auto; }
}
