:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #dadddb;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.6;
}

.login-container {
  display: flex;
  width: 100%;
  max-width: 1000px;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-height: 600px;
  position: relative;
}

/* Columna izquierda - Información de la empresa */
.info-section {
  flex: 1;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.info-section::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(240deg);
  }
}

.company-logo {
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  position: relative;
  z-index: 2;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.company-logo i {
  font-size: 48px;
  color: white;
}

.company-info h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
  letter-spacing: -1px;
}

.company-info p {
  font-size: 18px;
  margin-bottom: 24px;
  opacity: 0.9;
  position: relative;
  z-index: 2;
}

.features-list {
  list-style: none;
  text-align: left;
  position: relative;
  z-index: 2;
}

.features-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 16px;
  opacity: 0.9;
}

.features-list i {
  width: 20px;
  font-size: 16px;
}

/* Columna derecha - Formulario de login */
.login-section {
  flex: 1;
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 16px;
}

.error-message,
.success-message {
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  transform: translateY(-10px);
  opacity: 0;
  animation: slideIn 0.4s ease-out forwards;
}

@keyframes slideIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.success-message {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.attempts-warning {
  background: #fffbeb;
  border: 1px solid #fed7aa;
  color: #92400e;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.form-group {
  margin-bottom: 24px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 16px 20px;
  padding-left: 52px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  transition: var(--transition);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 400;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgb(37 99 235 / 0.1);
}

.form-input.error {
  border-color: var(--error-color);
  box-shadow: 0 0 0 4px rgb(239 68 68 / 0.1);
}

.input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 18px;
  transition: var(--transition);
}

.form-input:focus + .input-icon {
  color: var(--primary-color);
}

.password-toggle {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
}

.password-toggle:hover {
  color: var(--primary-color);
  background: var(--bg-secondary);
}

.login-button {
  width: 100%;
  padding: 18px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-button:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.login-button:active:not(:disabled) {
  transform: translateY(0);
}

.login-button:disabled {
  background: var(--secondary-color);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-button .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.login-button.loading .spinner {
  display: block;
}

.login-button.loading .button-text {
  display: none;
}

.forgot-password {
  text-align: center;
  margin-bottom: 32px;
}

.forgot-password a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.forgot-password a:hover {
  color: var(--primary-dark);
}

.security-info {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.security-info .icon {
  color: var(--success-color);
  font-size: 24px;
  margin-bottom: 12px;
}

.security-info .text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
    max-width: 420px;
    min-height: auto;
  }

  .info-section {
    padding: 40px 32px;
    min-height: 300px;
  }

  .company-logo {
    width: 80px;
    height: 80px;
  }

  .company-logo i {
    font-size: 32px;
  }

  .company-info h1 {
    font-size: 24px;
  }

  .company-info p {
    font-size: 16px;
  }

  .login-section {
    padding: 40px 32px;
  }

  .login-header h2 {
    font-size: 24px;
  }

  .features-list {
    display: none;
  }
}

@media (max-width: 480px) {
  .login-container {
    margin: 10px;
    border-radius: 12px;
  }

  .info-section,
  .login-section {
    padding: 32px 24px;
  }
}

/* Animaciones de entrada */
.login-container {
  animation: fadeInUp 0.8s ease-out;
}

.info-section > * {
  animation: fadeInLeft 0.8s ease-out;
  animation-fill-mode: both;
}

.info-section > *:nth-child(1) {
  animation-delay: 0.1s;
}
.info-section > *:nth-child(2) {
  animation-delay: 0.2s;
}
.info-section > *:nth-child(3) {
  animation-delay: 0.3s;
}
.info-section > *:nth-child(4) {
  animation-delay: 0.4s;
}

.login-section > * {
  animation: fadeInRight 0.8s ease-out;
  animation-fill-mode: both;
}

.login-section > *:nth-child(1) {
  animation-delay: 0.2s;
}
.login-section > *:nth-child(2) {
  animation-delay: 0.3s;
}
.login-section > *:nth-child(3) {
  animation-delay: 0.4s;
}
.login-section > *:nth-child(4) {
  animation-delay: 0.5s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
