/* ═══════════════════════════════════════════════════
   login.css — CEA "Abya Yala"  |  dark modern
═══════════════════════════════════════════════════ */

:root {
  --bg-base:      #0d1117;
  --bg-surface:   #161b22;
  --bg-elevated:  #1c2230;
  --border:       #2d3748;
  --border-light: #374151;
  --accent:       #3b82f6;
  --accent-glow:  rgba(59,130,246,.18);
  --accent-2:     #8b5cf6;
  --accent-3:     #10b981;
  --danger:       #ef4444;
  --txt-primary:   #f1f5f9;
  --txt-secondary: #94a3b8;
  --txt-muted:     #64748b;
  --txt-faint:     #55647c;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --font: 'Plus Jakarta Sans', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--txt-primary);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ──────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ════════════════════════════════════════════════════
   PANEL IZQUIERDO
════════════════════════════════════════════════════ */
.panel-left {
  position: relative;
  background: var(--bg-surface);
  border-right: 0.5px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  gap: 1.5rem;
}

.panel-left::before {
  content: '';
  position: absolute;
  width: 380px; height: 380px;
  border-radius: 50%;
  border: 0.5px solid rgba(59,130,246,.08);
  top: -100px; left: -100px;
  pointer-events: none;
}
.panel-left::after {
  content: '';
  position: absolute;
  width: 240px; height: 240px;
  border-radius: 50%;
  border: 0.5px solid rgba(139,92,246,.08);
  bottom: -70px; right: -70px;
  pointer-events: none;
}

/* ── Canvas 3D ── */
.canvas-wrap {
  position: relative;
  z-index: 2;
  width: 200px;
  height: 200px;
  animation: fadeUp .5s ease both;
}

#cea3d {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Marca ── */
.brand-block {
  position: relative;
  z-index: 2;
  text-align: center;
  animation: fadeUp .6s .05s ease both;
}

.brand-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--txt-primary);
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.brand-tagline {
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--txt-muted);
}

/* ── Cita ── */
.brand-quote {
  position: relative;
  z-index: 2;
  background: rgba(59,130,246,.06);
  border-left: 2px solid rgba(59,130,246,.28);
  border-radius: 0 8px 8px 0;
  padding: .9rem 1.1rem;
  max-width: 290px;
  animation: fadeUp .7s .1s ease both;
}

.brand-quote p {
  font-size: 12px;
  line-height: 1.75;
  color: var(--txt-secondary);
  margin: 0;
  font-style: italic;
}

/* ── Bloque de presentación ── */
.pres-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 290px;
  position: relative;
  z-index: 2;
  animation: fadeUp .7s .15s ease both;
}

.pres-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-elevated);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 11px 13px;
  transition: border-color .2s;
}

.pres-item:hover {
  border-color: var(--border-light);
}

.pres-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(59,130,246,.12);
  border: 0.5px solid rgba(59,130,246,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  color: #60a5fa;
}

.pres-icon--purple {
  background: rgba(139,92,246,.12);
  border-color: rgba(139,92,246,.25);
  color: #a78bfa;
}

.pres-icon--green {
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.25);
  color: #34d399;
}

.pres-text { display: flex; flex-direction: column; gap: 2px; }

.pres-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--txt-primary);
  line-height: 1.3;
}

.pres-sub {
  font-size: 11px;
  color: var(--txt-muted);
  line-height: 1.4;
}

/* ════════════════════════════════════════════════════
   PANEL DERECHO
════════════════════════════════════════════════════ */
.panel-right {
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

.login-card {
  width: 100%;
  max-width: 390px;
  animation: fadeUp .5s .05s ease both;
}

/* ── Encabezado ── */
.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--txt-primary);
  letter-spacing: -0.4px;
  margin-bottom: 3px;
}

.login-card .subtitle {
  font-size: 12.5px;
  color: var(--txt-muted);
  margin-bottom: 1.4rem;
}

.gold-divider {
  width: 32px;
  height: 2px;
  background: var(--accent);
  border-radius: 99px;
  margin-bottom: 1.25rem;
}

/* ── Alerta de error ── */
.alert-login {
  background: rgba(239,68,68,.08);
  border: 0.5px solid rgba(239,68,68,.25);
  border-radius: var(--radius-xs);
  color: #fca5a5;
  font-size: 12px;
  padding: 9px 12px;
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.alert-login.show { display: flex; }

/* ── Labels ── */
.form-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--txt-secondary);
  margin-bottom: 5px;
}

.hint-sub {
  font-size: 11px;
  color: var(--txt-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Input wrap ── */
.input-wrap { position: relative; }

.input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--txt-faint);
  pointer-events: none;
  transition: color .2s;
}
.input-wrap:focus-within .input-icon { color: var(--accent); }

.form-control {
  width: 100%;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--txt-primary);
  padding: 10px 12px 10px 36px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-control::placeholder { color: var(--txt-faint); }
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(223, 214, 214, 0.04);
  color: var(--txt-primary);
}

.form-hint {
  font-size: 10.5px;
  color: var(--txt-muted);
  margin-top: 4px;
  font-family: var(--mono);
}
.hint-hl { color: #60a5fa; font-weight: 500; }

/* ── Toggle contraseña ── */
.btn-eye {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--txt-faint);
  cursor: pointer;
  font-size: 15px; line-height: 1; padding: 2px;
  transition: color .2s;
}
.btn-eye:hover { color: var(--txt-secondary); }

/* ── Barra de fuerza ── */
.pwd-strength {
  display: flex; gap: 4px; margin-top: 7px;
}
.pwd-bar {
  flex: 1; height: 3px;
  border-radius: 99px;
  background: var(--border);
  transition: background .3s;
}
.pwd-bar.weak   { background: #ef4444; }
.pwd-bar.active { background: var(--accent); }
.pwd-bar.strong { background: var(--accent-3); }

.pwd-hint {
  font-size: 10.5px;
  color: var(--txt-muted);
  margin-top: 5px;
  font-family: var(--mono);
}

/* ── Recordar sesión ── */
.remember-row {
  display: flex; align-items: center; gap: 8px;
  margin: 13px 0 4px;
}
.custom-chk {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 0.5px solid var(--border-light);
  background: var(--bg-surface);
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  position: relative; flex-shrink: 0;
  transition: background .18s, border-color .18s;
}
.custom-chk:checked { background: var(--accent); border-color: var(--accent); }
.custom-chk:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(43deg);
}
.remember-label {
  font-size: 12px;
  color: var(--txt-secondary);
  cursor: pointer;
  user-select: none;
}

/* ── Botón Login ── */
.btn-login {
  width: 100%; padding: 11px;
  background: var(--accent); border: none;
  border-radius: var(--radius-sm); color: #fff;
  font-family: var(--font);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; letter-spacing: .02em;
  transition: background .2s, box-shadow .2s, transform .1s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 14px;
}
.btn-login:hover { background: #2563eb; box-shadow: 0 0 0 3px var(--accent-glow); }
.btn-login:active { transform: scale(.99); }

.btn-login .spinner-border { display: none; width: 1rem; height: 1rem; border-width: 2px; }
.btn-login.loading .spinner-border { display: inline-block; }
.btn-login.loading .btn-text,
.btn-login.loading .btn-icon { display: none; }

/* ── Divisor "o" ── */
.divider-or {
  display: flex; align-items: center; gap: 10px;
  margin: 13px 0; font-size: 11px; color: var(--txt-faint);
}
.divider-or::before, .divider-or::after {
  content: ''; flex: 1; height: 0.5px; background: var(--border);
}

/* ── Botón pantalla principal ── */
.btn-home {
  width: 100%; padding: 10px;
  background: transparent;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--txt-secondary);
  font-family: var(--font);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.btn-home:hover {
  background: var(--bg-surface);
  color: var(--txt-primary);
  border-color: var(--border-light);
}

/* ── Registro ── */
.register-line {
  text-align: center; font-size: 11.5px;
  color: var(--txt-muted); margin-top: 1.1rem;
}
.register-line a { color: #60a5fa; text-decoration: none; font-weight: 500; }
.register-line a:hover { text-decoration: underline; }

/* ── Footer ── */
.login-footer {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 1.1rem;
  font-size: 10.5px; color: var(--txt-faint);
}
.login-footer i { font-size: 13px; }

/* ─── Alertas flotantes ── */
#alertContainer {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; min-width: 300px;
}

/* ─── Animación ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ── */
@media (max-width: 768px) {
  .login-wrapper { grid-template-columns: 1fr; }
  .panel-left { display: none; }
  .panel-right { padding: 2rem 1.25rem; min-height: 100vh; }
}
