/* ==========================================================================
   LOGIN & AUTHENTICATION SCREENS
   Instituto de Educación Superior Tecnológico Público "Nueva Esperanza"
   ========================================================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  background-color: var(--bg-body);
}

.auth-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Left Hero Banner Side */
.auth-hero-side {
  flex: 1.2;
  position: relative;
  background: linear-gradient(135deg, rgba(18, 40, 83, 0.92) 0%, rgba(13, 71, 161, 0.88) 100%),
              url('../assets/images/hero-students.jpg') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-10);
  color: #ffffff;
  overflow: hidden;
}

.auth-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 30%, rgba(211, 47, 47, 0.25) 0%, transparent 60%);
  pointer-events: none;
}

.auth-hero-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.auth-hero-logo {
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.auth-hero-content {
  position: relative;
  z-index: 2;
  max-width: 580px;
}

.auth-hero-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-4);
  color: #ffffff;
}

.auth-hero-title span {
  color: #ffb74d; /* Dorado flama */
}

.auth-hero-desc {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: var(--space-6);
}

.auth-hero-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: var(--text-sm);
  font-weight: 500;
}

.auth-hero-footer {
  position: relative;
  z-index: 2;
  font-size: var(--text-sm);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Right Form Side */
.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background-color: var(--bg-surface);
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  animation: slideUp var(--transition-slow) cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-brand-logo-mobile {
  display: none;
  height: 52px;
  margin: 0 auto var(--space-4);
}

.auth-system-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.auth-system-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Role Selector Segment */
.role-selector-wrap {
  margin-bottom: var(--space-6);
}

.role-selector-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.role-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background-color: var(--bg-surface-alt);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  gap: 4px;
}

.role-tab {
  padding: 0.5rem 0.25rem;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.role-tab .icon {
  width: 1rem;
  height: 1rem;
}

.role-tab:hover {
  color: var(--primary);
  background-color: rgba(var(--primary-rgb), 0.05);
}

.role-tab.active {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Password Toggle Wrapper */
.password-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field-wrap input {
  padding-right: 2.75rem !important;
}

.btn-toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.btn-toggle-password:hover {
  color: var(--text-primary);
}

/* Demo Credentials Hint Box */
.demo-accounts-pill {
  margin-top: var(--space-6);
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-surface-alt);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Mandatory Password Change Screen */
.password-change-box {
  animation: scaleUp var(--transition-normal) ease-out;
}

.password-requirements {
  background-color: var(--bg-surface-alt);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.requirement-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: 4px;
}

.requirement-item.valid {
  color: var(--success);
}

/* Post-Login Loading Overlay Screen */
.post-login-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #122853 0%, #0a1733 100%);
  color: #ffffff;
  z-index: var(--z-loader);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.post-login-loader.active {
  opacity: 1;
  visibility: visible;
}

.post-login-loader-content {
  text-align: center;
  max-width: 440px;
  padding: var(--space-6);
  animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.loader-logo-wrap {
  width: 90px;
  height: 90px;
  margin: 0 auto var(--space-6);
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 12px;
  box-shadow: 0 0 35px rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-greeting {
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--space-2);
  color: #ffffff;
}

.loader-subtext {
  font-size: var(--text-sm);
  color: #94a3b8;
  margin-bottom: var(--space-6);
}

.loader-progress-bar-bg {
  width: 100%;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.loader-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d32f2f 0%, #f57c00 50%, #ffd54f 100%);
  border-radius: var(--radius-full);
  transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(245, 124, 0, 0.7);
}

.loader-percentage {
  font-family: var(--font-family-mono);
  font-size: var(--text-base);
  font-weight: 700;
  color: #ffb74d;
  margin-top: var(--space-3);
}
