/* ════════════════════════════════════════════════════════════════
   ORBITCYB — LOGIN  ·  Dark Enterprise
   ════════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --lc-bg       : #0a0a0a;
  --lc-surface  : #111111;
  --lc-surface-2: #171717;
  --lc-border   : #262626;
  --lc-accent   : #22c55e;
  --lc-accent-h : #16a34a;
  --lc-accent-a : #15803d;
  --lc-text     : #f5f5f5;
  --lc-muted    : #a3a3a3;
  --lc-dim      : #737373;
  --lc-error    : #ef4444;
  --lc-input-bg : #0d0d0d;
  --lc-brand-bg : #111111;
}

*,
*::before,
*::after { box-sizing: border-box; }


/* ════════════════════════════════════════════════════════════════
   KEYFRAMES — preservados íntegros para login-module.js
   ════════════════════════════════════════════════════════════════ */

@keyframes lc-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes error-shake {
  0%, 100% { transform: translateX(0);    }
  25%       { transform: translateX(-4px); }
  75%       { transform: translateX(4px);  }
}

/* login-module.js asigna estos via element.style.animation */
@keyframes pulse {
  0%, 100% { opacity: 1;   }
  50%       { opacity: 0.4; }
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0    rgba(34, 197, 94, 0.6); }
  70%       { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);   }
}


/* ════════════════════════════════════════════════════════════════
   FONDO — negro neutro, sin grid, sin decoración
   ════════════════════════════════════════════════════════════════ */

.login-page-bg {
  position: fixed;
  inset: 0;
  background-color: var(--lc-bg);
  overflow: hidden;
  z-index: 0;
}

#loginContainer {
  display: flex !important;
}

/* Grid desactivado — elemento en HTML se conserva pero invisible */
.grid-overlay {
  display: none;
}


/* ════════════════════════════════════════════════════════════════
   SPLIT LAYOUT
   ════════════════════════════════════════════════════════════════ */

.login-split {
  position: relative;
  z-index: 10;
  display: flex;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
}


/* ════════════════════════════════════════════════════════════════
   DESKTOP  ≥ 901px
   ════════════════════════════════════════════════════════════════ */

/* Panel izquierdo */
.lsp-brand {
  flex: 0 0 clamp(300px, 42%, 520px);
  background: var(--lc-brand-bg);
  border-right: 1px solid #2f2f2f;   /* ligeramente más visible que --lc-border */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px clamp(32px, 5vw, 56px);
}

.lsp-brand-inner {
  max-width: 360px;
  width: 100%;
}

.lsp-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--lc-border);
}

.logo-orb {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--lc-accent);
}

.logo-orb::before { display: none; }
.logo-orb i       { position: relative; z-index: 1; }

.logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--lc-text);
  line-height: 1.1;
}

.logo-subtitle {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--lc-dim);
  margin-top: 4px;
}

.lsp-desc {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--lc-muted);
  margin: 0 0 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--lc-border);
}

.lsp-features {
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lsp-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--lc-dim);
  letter-spacing: 0.1px;
}

.lsp-features li i {
  color: var(--lc-accent);
  font-size: 12px;
  flex-shrink: 0;
}

.lsp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #404040;
}

.lsp-version {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  background: #1a1a1a;
  border: 1px solid #262626;
  padding: 2px 8px;
  border-radius: 3px;
  color: #404040;
  letter-spacing: 0.4px;
}

/* Panel derecho */
.lsp-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px clamp(24px, 5vw, 56px);
  min-height: 100vh;
}

/* Desktop: sin card explícita — el fondo negro es la superficie */
.login-card {
  width: 100%;
  max-width: 400px;
  animation: lc-enter 0.35s ease both;
}


/* ════════════════════════════════════════════════════════════════
   PANTALLAS GRANDES  ≥ 1400px
   ════════════════════════════════════════════════════════════════ */

@media (min-width: 1400px) {
  .lsp-brand  { flex: 0 0 520px; }
  .lsp-form   { padding: 64px 80px; }
  .login-card { max-width: 420px; }
}


/* ════════════════════════════════════════════════════════════════
   TABLET  481px – 900px
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .lsp-brand { display: none; }

  .lsp-form {
    width: 100%;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
  }

  .login-card {
    max-width: 420px;
    background: var(--lc-surface);
    border: 1px solid var(--lc-border);
    border-top: 2px solid var(--lc-accent);
    border-radius: 8px;
    padding: 36px 32px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.60);
  }
}


/* ════════════════════════════════════════════════════════════════
   MOBILE  ≤ 480px
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .lsp-form { padding: 16px; }

  .login-card {
    max-width: 100%;
    padding: 28px 20px 24px;
    border-radius: 7px;
  }

  .login-heading h1 { font-size: 20px; }
  .login-heading p  { font-size: 13px; }

  /* Evita zoom automático en iOS */
  .form-input {
    font-size: 16px !important;
    padding: 13px;
  }

  .login-button {
    height: 50px;
    font-size: 15px;
    margin-top: 10px;
  }

  #dbStatus {
    font-size: 11px !important;
    padding: 8px 10px !important;
  }
}


/* ════════════════════════════════════════════════════════════════
   MOBILE PEQUEÑO  ≤ 360px
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 360px) {
  .login-card       { padding: 24px 16px 20px; }
  .logo-text        { font-size: 16px; letter-spacing: 2px; }
  .login-heading h1 { font-size: 18px; }
}


/* ════════════════════════════════════════════════════════════════
   ENCABEZADO DEL FORMULARIO
   ════════════════════════════════════════════════════════════════ */

.login-heading {
  margin-bottom: 28px;
}

.login-heading h1 {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--lc-text);
  margin: 0 0 7px;
}

.login-heading p {
  font-size: 13px;
  color: var(--lc-muted);
  margin: 0;
}


/* ════════════════════════════════════════════════════════════════
   INDICADOR DE BASE DE DATOS
   ════════════════════════════════════════════════════════════════ */

#dbStatus {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 9px 12px !important;
  margin: 0 0 24px !important;
  border-radius: 5px !important;
  background: #0d0d0d !important;
  border: 1px solid #1f1f1f !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}

#dbStatusDot {
  flex-shrink: 0;
  width: 7px  !important;
  height: 7px !important;
  border-radius: 50% !important;
}


/* ════════════════════════════════════════════════════════════════
   ALERTAS
   ════════════════════════════════════════════════════════════════ */

.alert {
  display: none;
  padding: 10px 14px;
  border-radius: 5px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.alert.show {
  display: block;
  animation: alert-in 0.25s ease;
}

.alert.error {
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.20);
  color: #fca5a5;
}

.alert.success {
  background: rgba(34, 197, 94, 0.07);
  border: 1px solid rgba(34, 197, 94, 0.20);
  color: #86efac;
}


/* ════════════════════════════════════════════════════════════════
   FORMULARIO
   ════════════════════════════════════════════════════════════════ */

.form-group { margin-bottom: 18px; }

.form-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--lc-dim);
  margin-bottom: 8px;
  transition: color 0.15s ease;
}

.form-label i {
  font-size: 11px;
  color: #404040;
  transition: color 0.15s ease;
  min-width: 13px;
}

.form-group:focus-within .form-label   { color: var(--lc-muted); }
.form-group:focus-within .form-label i { color: var(--lc-accent); }

.form-input {
  width: 100%;
  padding: 11px 13px;
  background: var(--lc-input-bg);
  border: 1px solid var(--lc-border);
  border-radius: 5px;
  color: var(--lc-text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
  color: #404040;
}

.form-input:focus {
  outline: none;
  border-color: var(--lc-accent);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.10);
}

.form-input.error {
  border-color: rgba(239, 68, 68, 0.50);
}

.form-input.error:focus {
  border-color: var(--lc-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10);
}

/* Autofill Chromium */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #0d0d0d inset !important;
  -webkit-text-fill-color: #f5f5f5 !important;
  border-color: var(--lc-border);
  caret-color: #f5f5f5;
}

.form-error {
  display: none;
  font-size: 12px;
  color: #fca5a5;
  margin-top: 5px;
}

.form-error.show {
  display: block;
  animation: error-shake 0.35s ease;
}


/* ════════════════════════════════════════════════════════════════
   BOTÓN
   ════════════════════════════════════════════════════════════════ */

.login-button {
  width: 100%;
  height: 46px;
  padding: 0 20px;
  margin-top: 8px;
  background: var(--lc-accent);
  border: none;
  border-radius: 5px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;          /* ajuste: más presencia tipográfica */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: background 0.15s ease, transform 0.10s ease, box-shadow 0.15s ease;
}

.login-button::before { display: none; }

.login-button:hover:not(:disabled) {
  background: var(--lc-accent-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.20);
}

.login-button:active:not(:disabled) {
  background: var(--lc-accent-a);
  transform: translateY(0);
  box-shadow: none;
}

.login-button:disabled {
  opacity: 0.40;
  cursor: not-allowed;
}

.login-button #btnText {
  display: flex;
  align-items: center;
  gap: 9px;
  position: relative;
  z-index: 1;
}

.loading-spinner {
  display: inline-block;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}


/* ════════════════════════════════════════════════════════════════
   AOS
   ════════════════════════════════════════════════════════════════ */

[data-aos] {
  opacity: 0;
  transition-property: opacity, transform;
}

[data-aos].aos-animate { opacity: 1; }
