/* ============================================
   ENTERPRISE LOGIN - COMPACT & PROFESSIONAL
   ============================================ */

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Messages should live outside the login card so they don't disrupt layout */
.global-messages {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  transform: none;
  width: min(420px, calc(100vw - 2.5rem));
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
}

.global-messages .alert {
  margin: 0;
  pointer-events: auto;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.12);
}

.global-messages-toggle {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.35);
}

.global-messages-toggle:hover {
  background: rgba(30, 41, 59, 0.95);
}

.global-messages .toggle-count {
  background: rgba(129, 140, 248, 0.2);
  color: #c7d2fe;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.global-messages.is-collapsed .global-messages-list {
  display: none;
}

.global-messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .global-messages {
    top: 0.75rem;
    left: 0.75rem;
    width: calc(100vw - 1.5rem);
  }
}

/* Theme Toggle Button */
.theme-toggle-btn {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  border: none;
  animation: fadeInScale 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.theme-toggle-btn:hover {
  transform: scale(1.05);
}

.theme-toggle-btn i {
  font-size: 1.125rem;
  position: absolute;
  transition: all 0.3s ease;
}

.theme-icon-dark {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-icon-light {
  opacity: 0;
  transform: rotate(180deg) scale(0);
}

[data-theme="dark"] .theme-icon-dark {
  opacity: 0;
  transform: rotate(-180deg) scale(0);
}

[data-theme="dark"] .theme-icon-light {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Main Wrapper */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
}

/* Login Container */
.login-container {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  min-height: 600px;
  max-height: 90vh;
}

/* ============================================
   LEFT PANEL - FEATURES
   ============================================ */

.features-panel {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

/* Brand Header */
.brand-header {
  margin-bottom: 0.5rem;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.1s;
  opacity: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.brand-text {
  flex: 1;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.brand-tagline {
  font-size: 0.8125rem;
  margin: 0;
  opacity: 0.7;
}

/* Features Content */
.features-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.features-title {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.features-subtitle {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
  opacity: 0.8;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.25s;
  opacity: 0;
}

/* Features List */
.features-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.feature-item:nth-child(1) {
  animation-delay: 0.3s;
}

.feature-item:nth-child(2) {
  animation-delay: 0.4s;
}

.feature-item:nth-child(3) {
  animation-delay: 0.5s;
}

.feature-item:nth-child(4) {
  animation-delay: 0.6s;
}

.feature-item:hover {
  background: rgba(99, 102, 241, 0.03);
  transform: translateX(4px);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.125rem;
  transition: all 0.3s ease;
}

.feature-item:hover .feature-icon {
  transform: translateY(-2px);
}

.feature-icon.primary {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
}

.feature-icon.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.feature-icon.info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.feature-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.feature-text h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.feature-text p {
  font-size: 0.8125rem;
  margin: 0;
  opacity: 0.75;
  line-height: 1.4;
}

/* Trust Badges */
.trust-badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.7s;
  opacity: 0;
}

.trust-badge {
  text-align: center;
  animation: fadeInScale 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.trust-badge:nth-child(1) {
  animation-delay: 0.8s;
}

.trust-badge:nth-child(2) {
  animation-delay: 0.9s;
}

.trust-badge:nth-child(3) {
  animation-delay: 1s;
}

.trust-number {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.trust-label {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  opacity: 0.7;
  font-weight: 500;
}

/* ============================================
   RIGHT PANEL - LOGIN FORM
   ============================================ */

.login-panel {
  padding: 2.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.login-content {
  width: 100%;
  max-width: 380px;
}

/* Login Header */
.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-header h2 {
  font-size: 1.625rem;
  font-weight: 700;
  margin: 0 0 0.375rem 0;
  line-height: 1.2;
}

.login-header p {
  font-size: 0.9375rem;
  margin: 0;
  opacity: 0.7;
}

/* Alert Messages */
.alert {
  padding: 0.875rem 1rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.alert i {
  font-size: 1rem;
  flex-shrink: 0;
}

/* Login Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.form-label i {
  font-size: 0.8125rem;
  opacity: 0.7;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border-radius: 10px;
  border: 2px solid;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  transform: translateY(-1px);
}

.form-input::placeholder {
  opacity: 0.5;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.375rem;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, #2563eb 0%, #5558e3 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  transform: translateY(-1px);
}

/* Divider */
.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0;
  opacity: 0.5;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid currentColor;
}

.login-divider span {
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Login Footer */
.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.login-footer a {
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.login-footer a:hover {
  opacity: 0.7;
}

.login-footer span {
  opacity: 0.5;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Book Opening Animation */
@keyframes bookOpen {
  0% {
    transform: perspective(1200px) rotateY(-90deg);
    opacity: 0;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    transform: perspective(1200px) rotateY(0deg);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Apply animations */
.login-panel {
  animation: bookOpen 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transform-origin: left center;
}

.features-panel {
  animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.login-content > * {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.4s;
  opacity: 0;
}

.login-content > *:nth-child(1) {
  animation-delay: 0.5s;
}

.login-content > *:nth-child(2) {
  animation-delay: 0.6s;
}

.login-content > *:nth-child(3) {
  animation-delay: 0.7s;
}

.login-content > *:nth-child(4) {
  animation-delay: 0.8s;
}

.login-content > *:nth-child(5) {
  animation-delay: 0.9s;
}

/* Tablets and Below */
@media (max-width: 900px) {
  .login-container {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .features-panel {
    display: none;
  }

  .login-panel {
    padding: 2rem 1.5rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .theme-toggle-btn {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }

  .theme-toggle-btn i {
    font-size: 1rem;
  }

  .login-wrapper {
    padding: 0.5rem;
  }

  .login-container {
    border-radius: 16px;
  }

  .login-panel {
    padding: 1.75rem 1.25rem;
  }

  .login-header h2 {
    font-size: 1.5rem;
  }

  .form-input {
    padding: 0.6875rem 0.875rem;
  }
}

/* Height Adjustments */
@media (max-height: 700px) {
  .login-container {
    min-height: auto;
  }

  .features-panel {
    padding: 2rem 1.75rem;
    gap: 1.25rem;
  }

  .features-content {
    gap: 1rem;
  }

  .features-list {
    gap: 0.875rem;
  }

  .login-panel {
    padding: 2rem 1.75rem;
  }

  .login-header {
    margin-bottom: 1.5rem;
  }

  .login-form {
    gap: 1rem;
  }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .login-wrapper {
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .login-container {
    max-height: none;
  }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .login-panel,
  .features-panel,
  .login-content > *,
  .feature-item,
  .trust-badges,
  .trust-badge,
  .brand-header,
  .features-title,
  .features-subtitle,
  .theme-toggle-btn {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
