/**
 * SIA Login Corporate Styles - Enterprise Design
 * Diseño empresarial profesional de dos columnas
 * Requiere: design-system.css, bootstrap-icons
 */

/* ============================================
   BASE STYLES
   ============================================ */

body.login-page {
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
  background-color: #f5f7fa;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   LAYOUT - TWO COLUMN
   ============================================ */

.login-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ============================================
   LEFT SIDE - BRAND INFORMATION
   ============================================ */

.login-brand-side {
  flex: 0 0 50%;
  background: linear-gradient(135deg, #0f3d47 0%, #145E63 50%, #1a7a81 100%);
  color: var(--color-white);
  padding: 4rem 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Subtle pattern overlay */
.login-brand-side::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.brand-content {
  max-width: 540px;
  position: relative;
  z-index: 1;
}

/* Logo Section */
.brand-logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.brand-logo-icon {
  width: 56px;
  height: 56px;
  background: var(--color-white);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.brand-name {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  margin: 0;
  line-height: 1;
}

.brand-text {
  background: linear-gradient(135deg, #CFA51B 0%, #DA8A19 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-version {
  font-size: 1rem;
  font-weight: var(--font-weight-normal);
  opacity: 0.9;
}

/* Brand Title & Description */
.brand-title {
  font-size: 1.75rem;
  font-weight: var(--font-weight-semibold);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.brand-description {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 2.5rem;
}

/* Features */
.brand-features {
  margin-bottom: 2.5rem;
}

.feature-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.feature-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #CFA51B;
}

.feature-content {
  flex: 1;
}

.feature-title {
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.25rem;
}

.feature-text {
  font-size: 0.875rem;
  line-height: 1.5;
  opacity: 0.85;
  margin: 0;
}

/* Badges */
.brand-badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge-item {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   RIGHT SIDE - LOGIN FORM
   ============================================ */

.login-form-side {
  flex: 0 0 50%;
  background: var(--color-white);
  padding: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-container {
  width: 100%;
  max-width: 440px;
}

/* Form Header */
.form-header {
  margin-bottom: 2rem;
}

.form-title {
  font-size: 1.75rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-gray-800);
  margin-bottom: 0.5rem;
}

.form-subtitle {
  font-size: 0.9rem;
  color: var(--color-gray-600);
  margin: 0;
}

/* Alert */
.alert-login {
  padding: 0.875rem 1rem;
  border-radius: 8px;
  border: none;
  border-left: 4px solid var(--color-danger);
  background-color: rgba(220, 53, 69, 0.1);
  color: #721c24;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
  margin-bottom: 0.5rem;
}

.input-group-custom {
  position: relative;
}

.form-control-custom {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-gray-800);
  background-color: var(--color-white);
  border: 2px solid var(--color-gray-300);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.form-control-custom:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(20, 94, 99, 0.1);
}

.form-control-custom::placeholder {
  color: var(--color-gray-400);
}

/* Password Toggle */
.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-gray-500);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s ease;
}

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

/* Form Options */
.form-options {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

.forgot-password-link {
  font-size: 0.875rem;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: color 0.2s ease;
}

.forgot-password-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  background: var(--gradient-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(20, 94, 99, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(20, 94, 99, 0.3);
}

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

.btn-submit.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-submit.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-white);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
  margin-left: 0.5rem;
}

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

/* Form Footer */
.form-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-gray-200);
  text-align: center;
}

.footer-text {
  font-size: 0.8125rem;
  color: var(--color-gray-600);
  margin-bottom: 0.75rem;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.footer-link {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.separator {
  color: var(--color-gray-400);
}

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

@media (max-width: 1024px) {
  .login-brand-side {
    flex: 0 0 45%;
    padding: 3rem 2rem;
  }

  .login-form-side {
    flex: 0 0 55%;
    padding: 2rem;
  }

  .brand-title {
    font-size: 1.5rem;
  }

  .brand-description {
    font-size: 0.875rem;
  }
}

@media (max-width: 768px) {
  .login-wrapper {
    flex-direction: column;
  }

  .login-brand-side {
    flex: 0 0 auto;
    min-height: auto;
    padding: 2rem 1.5rem;
  }

  .brand-content {
    max-width: 100%;
  }

  .brand-logo-container {
    margin-bottom: 1.5rem;
  }

  .brand-logo-icon {
    width: 48px;
    height: 48px;
    font-size: 1.75rem;
  }

  .brand-name {
    font-size: 1.75rem;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .brand-description {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
  }

  .brand-features {
    margin-bottom: 1.5rem;
  }

  .feature-item {
    margin-bottom: 1rem;
  }

  .login-form-side {
    flex: 0 0 auto;
    padding: 2rem 1.5rem;
  }

  .form-container {
    max-width: 100%;
  }

  .form-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .login-brand-side {
    padding: 1.5rem 1rem;
  }

  .login-form-side {
    padding: 1.5rem 1rem;
  }

  .brand-badges {
    gap: 0.5rem;
  }

  .badge-item {
    padding: 0.375rem 0.75rem;
    font-size: 0.6875rem;
  }

  .form-control-custom {
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
  }

  .btn-submit {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.form-control-custom:focus,
.btn-submit:focus,
.password-toggle:focus,
.forgot-password-link:focus,
.footer-link:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .login-wrapper {
    display: none;
  }
}
