/* ══════════════════════════════════════════════════════════
   LOGIN — Full-bleed campus image with floating glass form
   Premium Upgrade with micro-interactions & modern colors
   ══════════════════════════════════════════════════════════ */

/* ── Layout: image fills everything, form floats on left ── */
.login-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0a192f;
}

/* ── Center panel (form) ────────────────────── */
.login-section {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  background: rgba(10, 25, 47, 0.75);
  backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  color: #e6f1ff;
}

.login-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.login-bg canvas {
  width: 100%;
  height: 100%;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 390px;
  margin: auto;
  padding: var(--space-4) 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  animation: fadeInScale 0.6s var(--ease-out);
}
.login-card::before {
  display: none;
}

.login-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ffd700, #b8860b);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: transform 0.4s var(--ease-out);
}
.login-logo:hover {
  transform: rotate(10deg) scale(1.08);
}
.login-logo svg {
  width: 26px;
  height: 26px;
  color: #020c1b;
}

.login-title {
  text-align: center;
  margin-bottom: 4px;
  font-size: var(--font-size-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffd700, #ffeb82);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-subtitle {
  text-align: center;
  font-size: var(--font-size-xs);
  color: #8892b0;
  margin-bottom: var(--space-6);
  font-weight: 500;
}

.login-form .form-group {
  margin-bottom: var(--space-4);
}
.login-form .form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: #ccd6f6;
  margin-bottom: var(--space-1);
}
.login-form .form-label svg {
  width: 14px;
  height: 14px;
  color: #ffd700;
}
.login-form .form-input {
  padding: 0.65rem 1rem;
  background: rgba(2, 12, 27, 0.6);
  color: #e6f1ff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  width: 100%;
}
.login-form .form-input:focus {
  background: rgba(2, 12, 27, 0.9);
  border-color: #ffd700;
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.15);
}

.login-form .btn-primary {
  width: 100%;
  padding: 0.75rem;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  margin-top: var(--space-4);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ffd700, #b8860b);
  color: #020c1b;
  border: none;
  box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
  transition: all var(--transition-base);
}
.login-form .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184, 134, 11, 0.5);
  background: linear-gradient(135deg, #ffeb82, #ffd700);
}
.login-form .btn-primary:active {
  transform: translateY(0);
}

.login-error {
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--accent-red);
  margin-top: var(--space-3);
  display: none;
  padding: var(--space-2);
  background: rgba(186, 26, 26, 0.08);
  border-radius: var(--radius-xs);
  border: 1px solid rgba(186, 26, 26, 0.15);
}
.login-error.visible {
  display: block;
  animation: fadeIn 0.3s var(--ease-out);
}

/* ── Quick Login demo section ────────────────── */
.login-demo {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-light);
}
.login-demo-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8892b0;
  text-align: center;
  margin-bottom: var(--space-3);
}

/* Tabs pills selector */
.login-demo-tabs {
  display: flex;
  background: rgba(2, 12, 27, 0.6);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  gap: 2px;
}
.demo-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #8892b0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
}
.demo-tab-btn:hover {
  color: #ffd700;
  background: rgba(255, 255, 255, 0.05);
}
.demo-tab-btn.active {
  background: rgba(255, 215, 0, 0.1);
  color: #ffd700;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

/* Panels */
.login-demo-panels {
  position: relative;
  min-height: 130px;
}
.demo-panel {
  display: none;
}
.demo-panel.active {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: slideInDemo 0.4s var(--ease-out);
}

@keyframes slideInDemo {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Demo buttons */
.login-demo-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: rgba(2, 12, 27, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  color: #8892b0;
  font-size: var(--font-size-xs);
  text-align: left;
}
.login-demo-btn:hover {
  background: rgba(2, 12, 27, 0.9);
  border-color: #ffd700;
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
  color: #e6f1ff;
}

.login-demo-btn .demo-role {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  min-width: 82px;
  text-align: center;
}

/* Dynamic badges per role */
.demo-role.admin { background: #e0f2fe; color: #0369a1; }
.demo-role.dir { background: #f3e8ff; color: #6b21a8; }
.demo-role.ce { background: #fef3c7; color: #b45309; }
.demo-role.tit { background: #ccfbf1; color: #0f766e; }
.demo-role.coord { background: #e0e7ff; color: #3730a3; }
.demo-role.docente { background: #dcfce7; color: #15803d; }
.demo-role.alumno { background: #f1f5f9; color: #475569; }

/* ── Right panel (campus image — takes most of the screen) ── */
.campus-section {
  position: absolute;
  inset: 0;
  z-index: 0;
  min-height: 100vh;
  overflow: hidden;
  margin-left: 0;
}
.campus-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.campus-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.70) contrast(1.05);
  animation: bgPan 30s ease-in-out infinite alternate;
  transform-origin: center center;
}
.campus-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg, rgba(0, 32, 69, 0.40) 0%, rgba(15, 23, 42, 0.45) 50%, rgba(0, 32, 69, 0.35) 100%);
}

/* ── "Universidad Celsus" branding ── */
.campus-branding {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.brand-icon {
  width: 90px;
  height: 90px;
  margin-bottom: 1.5rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: brandPulse 3s ease-in-out infinite;
}
.brand-icon svg {
  width: 44px;
  height: 44px;
  color: #fff;
}

.brand-title {
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  line-height: 1.1;
  text-shadow: 0 4px 30px rgba(0,0,0,0.45);
  animation: brandSlideIn 1s var(--ease-out) both;
}
.brand-title span {
  display: block;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  background: linear-gradient(135deg, #ffffff 25%, #fed488 55%, #ffffff 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: brandShimmer 4s ease-in-out infinite;
}
.brand-tagline {
  font-size: clamp(0.9rem, 1.6vw, 1.2rem);
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 500;
  animation: brandSlideIn 1s var(--ease-out) 0.3s both;
}

/* Marquee ticker */
.campus-marquee {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(0, 32, 69, 0.9), rgba(69, 95, 136, 0.85), rgba(0, 32, 69, 0.9));
  padding: 0.75rem 0;
  border-top: 1px solid rgba(254, 212, 136, 0.3);
}
.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marqueeMove 20s linear infinite;
}
.marquee-track span {
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #fed488;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 0 20px rgba(254, 212, 136, 0.4);
}

/* ── Animations ──────────────────────────── */
@keyframes marqueeMove {
  from { transform: translateX(0); }
  to { transform: translateX(-33.33%); }
}
@keyframes bgPan {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.08) translate(-1.5%, 1.5%); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.96) translateX(-12px); }
  to { opacity: 1; transform: scale(1) translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes brandSlideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes brandPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(254, 212, 136, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 30px 8px rgba(254, 212, 136, 0.15); }
}
@keyframes brandShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 1150px) {
  /* No changes needed for flex layout */
}
@media (max-width: 960px) {
  .login-section { padding: 1.5rem; max-width: 90%; }
  .brand-title { font-size: 1.6rem; }
  .brand-title span { font-size: 2.2rem; }
}
@media (max-width: 640px) {
  .campus-section { min-height: 34vh; }
  .marquee-track { animation-duration: 12s; }
  .login-card { padding: var(--space-4) 0; }
  .brand-icon { width: 56px; height: 56px; margin-bottom: 1rem; }
  .brand-icon svg { width: 28px; height: 28px; }
}

/* ── Landscape mobile: pantallas de poca altura ────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .login-card { padding: var(--space-1) 0; }
  .login-logo { width: 36px; height: 36px; margin-bottom: var(--space-2); }
  .login-logo svg { width: 18px; height: 18px; }
  .login-title { font-size: var(--font-size-lg); margin-bottom: 2px; }
  .login-subtitle { margin-bottom: var(--space-3); font-size: 11px; }
  .login-form .form-group { margin-bottom: var(--space-3); }
  .login-form .form-input { padding: 0.45rem 0.85rem; }
  .login-form .btn-primary { margin-top: var(--space-2); padding: 0.55rem; }
  .login-demo { margin-top: var(--space-3); padding-top: var(--space-3); }
}

/* ══════════════════════════════════════════════════════════
   LIGHT MODE OVERRIDES
   ══════════════════════════════════════════════════════════ */
:root:not(.dark) .login-page { background: #f4f6f9; }

:root:not(.dark) .login-section {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 15px 40px rgba(15, 59, 115, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 59, 115, 0.15);
  color: #111c2c;
}

:root:not(.dark) .login-title {
  background: linear-gradient(135deg, #0f3b73, #1e5ba3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

:root:not(.dark) .login-subtitle { color: #43474e; }
:root:not(.dark) .login-form .form-label { color: #0f3b73; }
:root:not(.dark) .login-form .form-label svg { color: #c2942a; }

:root:not(.dark) .login-form .form-input {
  background: rgba(255, 255, 255, 0.9);
  color: #111c2c;
  border: 1px solid rgba(15, 59, 115, 0.2);
}
:root:not(.dark) .login-form .form-input:focus {
  background: #ffffff;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

:root:not(.dark) .login-demo-tabs {
  background: rgba(15, 59, 115, 0.05);
  border-color: rgba(15, 59, 115, 0.1);
}
:root:not(.dark) .demo-tab-btn { color: #43474e; }
:root:not(.dark) .demo-tab-btn:hover { color: #0f3b73; background: rgba(15, 59, 115, 0.05); }
:root:not(.dark) .demo-tab-btn.active {
  background: rgba(194, 148, 42, 0.1);
  color: #c2942a;
  border-color: rgba(194, 148, 42, 0.2);
}

:root:not(.dark) .login-demo-btn {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(15, 59, 115, 0.1);
  color: #43474e;
}
:root:not(.dark) .login-demo-btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: #c2942a;
  color: #0f3b73;
}

:root:not(.dark) .campus-bg img {
  content: url("/static/assets/banner2.jpg");
  filter: brightness(0.95) contrast(1.0);
}

:root:not(.dark) .campus-overlay {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(240, 244, 248, 0.5) 50%, rgba(255, 255, 255, 0.4) 100%);
}

:root:not(.dark) .brand-title {
  color: #0f3b73;
  text-shadow: 0 4px 20px rgba(255, 255, 255, 0.8);
}
:root:not(.dark) .brand-title span {
  background: linear-gradient(135deg, #0f3b73 25%, #c2942a 55%, #0f3b73 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
:root:not(.dark) .brand-tagline {
  color: #0f3b73;
}
:root:not(.dark) .brand-icon {
  background: rgba(15, 59, 115, 0.1);
  border-color: rgba(15, 59, 115, 0.2);
}
:root:not(.dark) .brand-icon svg { color: #0f3b73; }

:root:not(.dark) .campus-marquee {
  background: linear-gradient(90deg, rgba(244, 246, 249, 0.9), rgba(255, 255, 255, 0.85), rgba(244, 246, 249, 0.9));
  border-top: 1px solid rgba(15, 59, 115, 0.15);
}
:root:not(.dark) .marquee-track span {
  color: #0f3b73;
  text-shadow: none;
}
:root:not(.dark) #login-theme-toggle {
  background: rgba(255,255,255,0.8);
  border-color: rgba(15,59,115,0.2);
  color: #0f3b73;
}
:root:not(.dark) #login-theme-toggle:hover {
  background: rgba(255,255,255,1);
}
