/* =================================
   CSS AUTH MODERNO - TEMA NARANJA
   ================================= */

:root {
  /* Paleta de colores naranjas */
  --primary-orange: #F39C12;
  --primary-orange-light: #FF8A5C;
  --primary-orange-dark: #E85A2B;
  --secondary-orange: #FFB07F;
  --accent-orange: #FF9F43;
  --orange-gradient: linear-gradient(135deg, #FFD700, #ffcc00,  #F39C12, #FF9F43);
  --orange-gradient-soft: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 159, 67, 0.05));
  
  /* Colores base */
  --white: #FFFFFF;
  --light-gray: #F8F9FA;
  --medium-gray: #E9ECEF;
  --dark-gray: #6C757D;
  --text-primary: #2D3436;
  --text-secondary: #636E72;
  --text-light: rgba(255, 255, 255, 0.9);
  
  /* Colores de estado */
  --success: #00B894;
  --warning: #FDCB6E;
  --danger: #E17055;
  --info: #74B9FF;
  
  /* Sombras y efectos */
  --shadow-light: 0 2px 12px rgba(255, 107, 53, 0.08);
  --shadow-medium: 0 8px 24px rgba(255, 107, 53, 0.12);
  --shadow-heavy: 0 16px 48px rgba(255, 107, 53, 0.16);
  --shadow-glow: 0 0 32px rgba(255, 107, 53, 0.3);
  --border-radius: 16px;
  --border-radius-small: 8px;
  
  /* Transiciones */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* =================================
   RESET Y BASE
   ================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #FFF5F0 0%, #FFFFFF 50%, #FFF8F5 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =================================
   ANIMACIONES KEYFRAMES
   ================================= */

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-10px) rotate(120deg); }
  66% { transform: translateY(5px) rotate(240deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
  40%, 43% { transform: translateY(-8px); }
  70% { transform: translateY(-4px); }
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* =================================
   FONDO ANIMADO
   ================================= */

.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.floating-shape {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: float 6s ease-in-out infinite;
}

.shape-1 {
  width: 80px;
  height: 80px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 120px;
  height: 120px;
  top: 20%;
  right: 15%;
  animation-delay: 2s;
}

.shape-3 {
  width: 60px;
  height: 60px;
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
}

.shape-4 {
  width: 100px;
  height: 100px;
  bottom: 30%;
  right: 10%;
  animation-delay: 1s;
}

.shape-5 {
  width: 140px;
  height: 140px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 3s;
  opacity: 0.3;
}

/* =================================
   LAYOUT PRINCIPAL
   ================================= */

.auth-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* =================================
   SIDEBAR DECORATIVO
   ================================= */

.auth-sidebar {
  flex: 0 0 50%;
  background: var(--orange-gradient);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: slideInLeft 0.8s ease-out;
}

.auth-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="4"/></g></svg>') repeat;
  animation: shimmer 20s linear infinite;
}

.sidebar-content {
  position: relative;
  z-index: 2;
  padding: 60px;
  color: var(--text-light);
  max-width: 500px;
}

.brand-section {
  margin-bottom: 60px;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.brand-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
  animation: pulse 3s infinite;
}

.brand-icon svg {
  width: 40px;
  height: 40px;
  color: white;
}

.brand-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(45deg, white, rgba(255, 255, 255, 0.8));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  font-weight: 400;
}

.feature-list {
  margin-bottom: 60px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out both;
}

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

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
  transition: var(--transition-medium);
}

.feature-item:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(255, 255, 255, 0.25);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.feature-text h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-text p {
  opacity: 0.8;
  font-size: 0.95rem;
  line-height: 1.5;
}

.decoration-circles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 8s ease-in-out infinite;
}

.circle-1 {
  width: 120px;
  height: 120px;
  top: 10%;
  right: 10%;
  animation-delay: 0s;
}

.circle-2 {
  width: 80px;
  height: 80px;
  bottom: 20%;
  left: 15%;
  animation-delay: 2s;
}

.circle-3 {
  width: 200px;
  height: 200px;
  top: 50%;
  right: -50px;
  animation-delay: 4s;
  opacity: 0.05;
}

/* =================================
   FORMULARIO
   ================================= */

.form-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 60px;
  background: var(--white);
  position: relative;
  animation: slideInRight 0.8s ease-out;
}

.form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(255, 107, 53, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

.form-header {
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

.welcome-section {
  margin-bottom: 24px;
}

.form-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: var(--orange-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInUp 0.6s ease-out;
}

.form-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0, 184, 148, 0.1);
  color: var(--success);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.security-icon {
  width: 16px;
  height: 16px;
}

.security-icon svg {
  width: 100%;
  height: 100%;
}

/* =================================
   ALERTAS
   ================================= */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--border-radius-small);
  margin-bottom: 32px;
  border-left: 4px solid;
  animation: fadeInUp 0.4s ease-out;
}

.alert-error {
  background: rgba(225, 112, 85, 0.1);
  border-left-color: var(--danger);
  color: var(--danger);
}

.alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-content h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.alert-content p {
  font-size: 0.875rem;
  opacity: 0.9;
  line-height: 1.4;
}

/* =================================
   FORMULARIO
   ================================= */

.login-form {
  position: relative;
  z-index: 1;
}

.input-group {
  margin-bottom: 28px;
  animation: fadeInUp 0.6s ease-out both;
}

.input-group:nth-child(1) { animation-delay: 0.3s; }
.input-group:nth-child(2) { animation-delay: 0.4s; }

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: var(--transition-fast);
}

.label-icon {
  width: 16px;
  height: 16px;
  color: var(--primary-orange);
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--medium-gray);
  border-radius: var(--border-radius-small);
  font-size: 1rem;
  background: var(--white);
  transition: var(--transition-medium);
  position: relative;
  z-index: 1;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
  transform: translateY(-2px);
}

.form-input:focus + .input-border {
  transform: scaleX(1);
}

.input-border {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--orange-gradient);
  border-radius: 0 0 var(--border-radius-small) var(--border-radius-small);
  transform: scaleX(0);
  transition: var(--transition-medium);
  z-index: 2;
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition-fast);
  z-index: 3;
}

.password-toggle:hover {
  color: var(--primary-orange);
  background: rgba(255, 107, 53, 0.1);
}

.eye-icon {
  width: 20px;
  height: 20px;
}

/* =================================
   OPCIONES DEL FORMULARIO
   ================================= */

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease-out 0.5s both;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--medium-gray);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  position: relative;
}

.checkbox-input:checked + .checkbox-custom {
  background: var(--orange-gradient);
  border-color: var(--primary-orange);
}

.checkbox-input:checked + .checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
  animation: bounce 0.4s ease;
}

.checkbox-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.forgot-link {
  color: var(--primary-orange);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition-fast);
  position: relative;
}

.forgot-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--orange-gradient);
  transition: var(--transition-fast);
}

.forgot-link:hover::after {
  width: 100%;
}

.forgot-link:hover {
  color: var(--primary-orange-dark);
}

/* =================================
   BOTÓN DE ENVÍO
   ================================= */

.submit-button {
  width: 100%;
  padding: 18px 24px;
  background: var(--orange-gradient);
  color: white;
  border: none;
  border-radius: var(--border-radius-small);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-medium);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: var(--shadow-medium);
  animation: fadeInUp 0.6s ease-out 0.6s both;
}

.submit-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition-medium);
}

.submit-button:hover::before {
  left: 100%;
}

.submit-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-heavy);
  background: linear-gradient(135deg, var(--primary-orange-dark),var(--accent-orange), #FFD700);
}

.submit-button:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}



.button-text {
  transition: var(--transition-fast);
}

.button-loader {
  display: none;
  gap: 4px;
}

.submit-button.loading .button-text {
  opacity: 0;
}

.submit-button.loading .button-loader {
  display: flex;
}

.submit-button.loading .button-arrow {
  opacity: 0;
}

.loader-dot {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  animation: loaderPulse 1.4s ease-in-out infinite both;
}

.loader-dot:nth-child(1) { animation-delay: -0.32s; }
.loader-dot:nth-child(2) { animation-delay: -0.16s; }
.loader-dot:nth-child(3) { animation-delay: 0s; }

.button-arrow {
  width: 20px;
  height: 20px;
  transition: var(--transition-fast);
}

.submit-button:hover .button-arrow {
  transform: translateX(4px);
}

/* =================================
   PIE DEL FORMULARIO
   ================================= */

.form-footer {
  margin-top: 40px;
  animation: fadeInUp 0.6s ease-out 0.7s both;
}

.divider {
  position: relative;
  text-align: center;
  margin: 32px 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--medium-gray);
}

.divider-text {
  background: var(--white);
  color: var(--text-secondary);
  padding: 0 16px;
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
}

.signup-text {
  text-align: center;
  font-size: 1rem;
  color: var(--text-secondary);
}

.signup-link {
  color: var(--primary-orange);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
  position: relative;
}

.signup-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--orange-gradient);
  transition: var(--transition-fast);
}

.signup-link:hover::after {
  width: calc(100% - 20px);
}

.signup-link:hover {
  color: var(--primary-orange-dark);
}

.signup-link:hover .link-arrow {
  transform: translateX(4px);
}

.link-arrow {
  width: 16px;
  height: 16px;
  transition: var(--transition-fast);
}

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

@media (max-width: 1024px) {
  .auth-sidebar {
    flex: 0 0 40%;
  }
  
  .sidebar-content {
    padding: 40px;
  }
  
  .brand-title {
    font-size: 2.5rem;
  }
  
  .form-container {
    padding: 60px 40px;
  }
}

@media (max-width: 768px) {
  .auth-wrapper {
    flex-direction: column;
  }
  
  .auth-sidebar {
    flex: none;
    min-height: 40vh;
    padding: 40px 20px;
  }
  
  .sidebar-content {
    padding: 40px 20px;
    text-align: center;
  }
  
  .brand-title {
    font-size: 2rem;
  }
  
  .feature-list {
    display: none;
  }
  
  .form-container {
    padding: 40px 20px;
    min-height: 60vh;
  }
  
  .form-title {
    font-size: 2rem;
  }
  
  .form-options {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .auth-sidebar {
    min-height: 30vh;
  }
  
  .sidebar-content {
    padding: 20px;
  }
  
  .brand-icon {
    width: 60px;
    height: 60px;
  }
  
  .brand-icon svg {
    width: 30px;
    height: 30px;
  }
  
  .brand-title {
    font-size: 1.75rem;
  }
  
  .brand-subtitle {
    font-size: 1rem;
  }
  
  .form-container {
    padding: 30px 16px;
  }
  
  .form-title {
    font-size: 1.75rem;
  }
  
  .form-subtitle {
    font-size: 1rem;
  }
  
  .form-input {
    padding: 14px 16px;
  }
  
  .submit-button {
    padding: 16px 20px;
    font-size: 1rem;
  }
}

/* =================================
   ANIMACIONES ESPECIALES
   ================================= */

.form-container > * {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out both;
}

.form-header { animation-delay: 0.1s; }
.alert { animation-delay: 0.2s; }
.login-form { animation-delay: 0.3s; }
.form-footer { animation-delay: 0.4s; }

/* Efectos hover mejorados */
.form-input:hover {
  border-color: var(--primary-orange-light);
}

.checkbox-wrapper:hover .checkbox-custom {
  border-color: var(--primary-orange);
  background: rgba(255, 107, 53, 0.05);
}

/* Estados de focus mejorados */
.submit-button:focus {
  outline: none;
  box-shadow: var(--shadow-heavy), 0 0 0 4px rgba(255, 107, 53, 0.2);
}

.forgot-link:focus,
.signup-link:focus {
  outline: 2px solid var(--primary-orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =================================
   UTILIDADES
   ================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}