/* ========================================
   COBRABLE — Login Split Screen
   Hero + Glassmorphism Login Card
   ======================================== */

/* ----------------------------------------
   1. Variables
   ---------------------------------------- */
:root {
  --lg-bg-1: #07111f;
  --lg-bg-2: #0c1b2f;
  --lg-bg-3: #081625;
  --lg-cyan: #22d3ee;
  --lg-blue: #3b82f6;
  --lg-green: #22c55e;
  --lg-white: rgba(255,255,255,.92);
  --lg-muted: rgba(255,255,255,.60);
  --lg-glass: rgba(255,255,255,.08);
  --lg-border: rgba(255,255,255,.12);
  --lg-shadow: 0 20px 60px rgba(0,0,0,.45);
  --lg-input-bg: rgba(255,255,255,.05);
  --lg-input-border: rgba(255,255,255,.10);
  --lg-input-focus: rgba(34,211,238,.55);
}

/* ----------------------------------------
   2. Body & full screen
   ---------------------------------------- */
body.login-body {
  margin: 0; padding: 0;
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  background:
    radial-gradient(circle at 10% 20%, rgba(34,211,238,.10), transparent 30%),
    radial-gradient(circle at 90% 15%, rgba(59,130,246,.12), transparent 28%),
    radial-gradient(circle at 80% 85%, rgba(34,197,94,.10), transparent 25%),
    linear-gradient(135deg, var(--lg-bg-1), var(--lg-bg-2), var(--lg-bg-3));
  min-height: 100vh;
  overflow-x: hidden;
  color: white;
}

/* ----------------------------------------
   3. Split screen layout
   ---------------------------------------- */
.lg-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  overflow-x: hidden;
  isolation: isolate;
}

/* ----------------------------------------
   4. Background layers
   ---------------------------------------- */
.lg-grid,
.lg-scan,
.lg-particles,
.lg-connections,
.lg-glow-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lg-grid {
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.95), rgba(0,0,0,.45));
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.95), rgba(0,0,0,.45));
}

.lg-scan::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 180px;
  background: linear-gradient(to bottom, transparent, rgba(34,211,238,.08), transparent);
  filter: blur(18px);
  animation: lgScanMove 8s linear infinite;
}

@keyframes lgScanMove {
  0% { transform: translateY(-220px); }
  100% { transform: translateY(calc(100vh + 220px)); }
}

.lg-glow-orbs::before,
.lg-glow-orbs::after {
  content: "";
  position: absolute;
  width: 380px; height: 380px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .22;
  animation: lgFloatOrb 11s ease-in-out infinite;
}

.lg-glow-orbs::before {
  top: -80px; left: -80px;
  background: var(--lg-cyan);
}

.lg-glow-orbs::after {
  right: -90px; bottom: -90px;
  background: var(--lg-blue);
  animation-delay: -4s;
}

@keyframes lgFloatOrb {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(35px, 20px) scale(1.08); }
}

/* SVG connection lines */
.lg-connections .lg-line {
  stroke: rgba(34,211,238,.35);
  stroke-width: 1.4;
  fill: none;
  stroke-dasharray: 8 10;
  animation: lgDashFlow 14s linear infinite;
  filter: drop-shadow(0 0 8px rgba(34,211,238,.16));
}

.lg-connections .lg-line-green {
  stroke: rgba(34,197,94,.25);
  animation-duration: 18s;
}

@keyframes lgDashFlow {
  to { stroke-dashoffset: -360; }
}

/* Particles */
.lg-particles i {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(155,239,255,.95);
  box-shadow: 0 0 14px rgba(34,211,238,.9);
  animation: lgFloatParticle linear infinite;
  opacity: .6;
}

@keyframes lgFloatParticle {
  from { transform: translateY(0) scale(1); opacity: 0; }
  15% { opacity: .6; }
  85% { opacity: .6; }
  to { transform: translateY(-120vh) scale(1.4); opacity: 0; }
}

/* Mouse light */
.lg-mouse-light {
  position: absolute;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,.16), transparent 62%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  filter: blur(18px);
  mix-blend-mode: screen;
}

/* ----------------------------------------
   5. Hero section (left)
   ---------------------------------------- */
.lg-hero {
  position: relative;
  z-index: 2;
  padding: 160px 42px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
}

.lg-brand {
  position: absolute;
  top: 28px; left: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: .3px;
}

.lg-brand-badge {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(34,211,238,.95), rgba(59,130,246,.95));
  box-shadow: 0 0 25px rgba(34,211,238,.35);
  display: grid;
  place-items: center;
}

/* === Logo Cobra-ble: tinta el PNG en blanco con CSS filter (sin fondo) === */
.lg-logo-card {
  display: inline-block;
  margin: 0 auto 18px;
  background: transparent;
}
.lg-logo-card img {
  height: 72px; width: auto; display: block;
  filter: brightness(0) invert(1);
}
.lg-logo-card .lg-logo-glow { display: none; }

.lg-logo-card--hero img { height: 88px; }

.lg-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(34,211,238,.22);
  background: rgba(255,255,255,.04);
  border-radius: 999px;
  color: #9befff;
  font-size: 13px;
  width: fit-content;
  backdrop-filter: blur(12px);
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.lg-title {
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  line-height: 1.05;
  font-weight: 800;
  max-width: 600px;
  text-wrap: balance;
  text-shadow: 0 8px 35px rgba(0,0,0,.35);
}

.lg-title span {
  background: linear-gradient(90deg, #ffffff, #9befff, #8bf7c0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lg-subtitle {
  margin-top: 14px;
  max-width: 560px;
  color: var(--lg-muted);
  font-size: .88rem;
  line-height: 1.7;
}

/* ----------------------------------------
   6. Floating KPI cards (hero decoration)
   ---------------------------------------- */
.lg-dash-wrap {
  margin-top: 20px;
  position: relative;
  height: 340px;
  max-width: 760px;
  overflow: visible;
}

.lg-card {
  position: absolute;
  border: 1px solid var(--lg-border);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 22px;
  box-shadow: var(--lg-shadow);
  overflow: hidden;
}

.lg-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.06), transparent);
  transform: translateX(-120%);
  animation: lgShine 6s linear infinite;
}

@keyframes lgShine {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.lg-kpi-main { left: 0; top: 0; width: 280px; padding: 20px; animation: lgDrift1 7s ease-in-out infinite; }
.lg-kpi-right { right: 60px; top: 0; width: 200px; padding: 16px; animation: lgDrift2 8s ease-in-out infinite; }
.lg-kpi-bottom { left: 200px; bottom: 20px; width: 250px; padding: 16px; animation: lgDrift3 9s ease-in-out infinite; }
.lg-mini-call { right: 0; bottom: 60px; width: 190px; padding: 14px; animation: lgDrift4 7.5s ease-in-out infinite; }

@keyframes lgDrift1 { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-14px) translateX(8px); } }
@keyframes lgDrift2 { 0%,100% { transform: translateY(0); } 50% { transform: translateY(12px); } }
@keyframes lgDrift3 { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-10px) translateX(-10px); } }
@keyframes lgDrift4 { 0%,100% { transform: translateY(0); } 50% { transform: translateY(10px); } }

.lg-card-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1.1px; color: rgba(255,255,255,.62); margin-bottom: 10px; }
.lg-card-value { font-size: 2rem; font-weight: 800; letter-spacing: -.5px; margin-bottom: 8px; }
.lg-card-sub { color: rgba(255,255,255,.64); font-size: 13px; line-height: 1.5; }

.lg-trend {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 7px 10px;
  background: rgba(34,197,94,.14);
  color: #a6f4c5;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
}

.lg-bars { display: flex; align-items: flex-end; gap: 8px; height: 90px; margin-top: 14px; }
.lg-bars span {
  flex: 1;
  border-radius: 12px 12px 5px 5px;
  background: linear-gradient(to top, rgba(34,211,238,.25), rgba(34,211,238,.92));
  box-shadow: 0 0 20px rgba(34,211,238,.16);
  animation: lgPulseBars 2.5s ease-in-out infinite;
  transform-origin: bottom;
}
.lg-bars span:nth-child(1){ height: 35%; animation-delay: .1s; }
.lg-bars span:nth-child(2){ height: 58%; animation-delay: .3s; }
.lg-bars span:nth-child(3){ height: 82%; animation-delay: .5s; }
.lg-bars span:nth-child(4){ height: 48%; animation-delay: .7s; }
.lg-bars span:nth-child(5){ height: 70%; animation-delay: .9s; }

@keyframes lgPulseBars {
  0%,100% { transform: scaleY(1); opacity: .95; }
  50% { transform: scaleY(1.08); opacity: 1; }
}

.lg-wave { margin-top: 14px; height: 58px; position: relative; border-radius: 16px; background: rgba(255,255,255,.03); overflow: hidden; }
.lg-wave svg { width: 200%; height: 100%; position: absolute; left: 0; top: 0; animation: lgMoveWave 9s linear infinite; }
@keyframes lgMoveWave { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.lg-agent-list { margin-top: 10px; display: grid; gap: 10px; }
.lg-agent-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.04); font-size: 13px; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lg-green); box-shadow: 0 0 12px rgba(34,197,94,.85); animation: lgLiveDot 1.4s ease-in-out infinite; }
@keyframes lgLiveDot { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.45); opacity: .65; } }

/* ----------------------------------------
   7. Login panel (right)
   ---------------------------------------- */
.lg-panel {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lg-login-box {
  width: min(430px, 100%);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(6, 17, 31, .72);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: 28px;
  padding: 30px;
  box-shadow: 0 30px 80px rgba(0,0,0,.42);
  position: relative;
  overflow: hidden;
  animation: lgCardEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes lgCardEnter {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lg-login-box::before {
  content: "";
  position: absolute; inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(34,211,238,.45), transparent, rgba(34,197,94,.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Logo + title inside login */
.lg-login-header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 20px;
}

.lg-login-header::after {
  content: '';
  position: absolute; bottom: 0;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34,211,238,.3), rgba(34,197,94,.3), transparent);
}

.lg-login-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.lg-login-subtitle {
  color: rgba(255,255,255,.62);
  line-height: 1.6;
  font-size: .9rem;
}

/* ----------------------------------------
   8. Form inputs
   ---------------------------------------- */
.lg-input-group { margin-bottom: 14px; }

.lg-input-label {
  display: block;
  margin-bottom: 8px;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.65);
}

.lg-input {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  border: 1px solid var(--lg-input-border);
  background: var(--lg-input-bg);
  color: white;
  padding: 0 16px;
  font-size: .9rem;
  outline: none;
  transition: .25s ease;
}

.lg-input:focus {
  border-color: var(--lg-input-focus);
  box-shadow: 0 0 0 4px rgba(34,211,238,.10);
  background: rgba(255,255,255,.07);
}

.lg-input::placeholder { color: rgba(255,255,255,.30); }

/* Password group with toggle */
.lg-pwd-group { position: relative; }
.lg-pwd-group .lg-input { padding-right: 48px; }
.lg-pwd-toggle {
  position: absolute;
  right: 4px; top: 50%; transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255,255,255,.45);
  padding: 8px 12px;
  cursor: pointer;
  transition: color .2s;
}
.lg-pwd-toggle:hover { color: var(--lg-cyan); }

/* ----------------------------------------
   9. Options row
   ---------------------------------------- */
.lg-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 20px;
  font-size: .85rem;
  color: rgba(255,255,255,.62);
}

.lg-options .form-check-input {
  background-color: var(--lg-input-bg);
  border-color: var(--lg-input-border);
}

.lg-options .form-check-input:checked {
  background-color: var(--lg-blue);
  border-color: var(--lg-blue);
}

.lg-options .form-check-label {
  color: rgba(255,255,255,.62);
  font-size: .85rem;
}

.lg-link {
  color: var(--lg-cyan) !important;
  text-decoration: none;
  font-size: .85rem;
  transition: color .2s;
}

.lg-link:hover {
  color: #fff !important;
  text-decoration: underline;
}

/* ----------------------------------------
   10. Submit button
   ---------------------------------------- */
.lg-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 16px;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--lg-blue), var(--lg-cyan));
  box-shadow: 0 16px 32px rgba(34,211,238,.22);
  transition: transform .18s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
}

.lg-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(34,211,238,.28);
}

.lg-btn:active {
  transform: translateY(0) scale(0.985);
}

.lg-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.15) 45%, rgba(255,255,255,.15) 55%, transparent 65%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.lg-btn:hover::before { transform: translateX(100%); }

/* Loading state */
.lg-btn--loading { pointer-events: none; opacity: 0.85; }
.lg-btn--loading .lg-btn__text { visibility: hidden; }
.lg-btn--loading::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lgSpin 0.6s linear infinite;
}
@keyframes lgSpin { to { transform: rotate(360deg); } }

/* ----------------------------------------
   11. Metric pills below button
   ---------------------------------------- */
.lg-metric-strip {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.lg-metric-pill {
  padding: 12px 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  text-align: center;
}

.lg-metric-pill strong { display: block; font-size: 1rem; margin-bottom: 4px; }
.lg-metric-pill span { color: rgba(255,255,255,.56); font-size: .72rem; }

/* ----------------------------------------
   12. Footer & register link
   ---------------------------------------- */
.lg-login-footer {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 6px;
  color: rgba(255,255,255,.54);
  font-size: .84rem;
}

/* ----------------------------------------
   13. Validation
   ---------------------------------------- */
.lg-login-box .text-danger {
  font-size: 0.75rem;
  color: #f87171 !important;
}

.lg-login-box .alert-danger {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.25);
  color: #fca5a5;
  font-size: 0.8rem;
  border-radius: 12px;
}

/* ----------------------------------------
   14. Modal (recuperar clave)
   ---------------------------------------- */
.lg-modal .modal-content {
  background: rgba(6, 17, 31, .92);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  color: white;
}

.lg-modal .modal-header { border-bottom: 1px solid rgba(255,255,255,.08); padding: 1rem 1.25rem; }
.lg-modal .modal-title { font-size: 1rem; font-weight: 600; }
.lg-modal .modal-body { padding: 1.25rem; }
.lg-modal .modal-footer { border-top: 1px solid rgba(255,255,255,.08); padding: 0.75rem 1.25rem; }
.lg-modal .btn-close { filter: invert(1) grayscale(100%) brightness(0.8); }

.lg-modal .alert-success { background: rgba(22,163,74,.12); border-color: rgba(22,163,74,.25); color: #86efac; border-radius: 10px; }
.lg-modal .alert-danger { background: rgba(220,38,38,.12); border-color: rgba(220,38,38,.25); color: #fca5a5; border-radius: 10px; }

.lg-modal-btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.6);
  border-radius: 10px;
  transition: all 0.2s;
}
.lg-modal-btn-ghost:hover { border-color: rgba(255,255,255,.25); color: white; background: rgba(255,255,255,.05); }

/* ----------------------------------------
   15. Responsive
   ---------------------------------------- */
@media (max-width: 1080px) {
  .lg-screen { grid-template-columns: 1fr; min-height: auto; overflow: visible; }
  .lg-hero { min-height: auto; padding-top: 90px; padding-bottom: 20px; }
  .lg-panel { padding-top: 0; padding-bottom: 40px; }
}

@media (max-width: 720px) {
  .lg-hero { padding: 80px 20px 16px; }
  .lg-panel { padding: 16px 16px 40px; }
  .lg-brand { left: 20px; }
  .lg-dash-wrap { height: 240px; transform: scale(.85); transform-origin: left top; }
  .lg-title { font-size: 1.5rem; }
  .lg-subtitle { font-size: .82rem; }
  .lg-login-box { padding: 22px; border-radius: 22px; }
  .lg-metric-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .lg-dash-wrap { display: none; }
  .lg-hero { min-height: auto; padding: 80px 16px 16px; }
  .lg-subtitle { display: none; }
  .lg-panel { padding: 8px 16px 40px; }
  .lg-login-box { padding: 20px; border-radius: 20px; }
  .lg-metric-strip { grid-template-columns: repeat(3, 1fr); }
}
