/* =============================================
   EASYSUITE - LOGIN CSS
   Paleta: Púrpura #7c3aed (Suite) + Naranja #f59e0b (Fac) + Verde #10b981 (Stock)
   ============================================= */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8fafc;
  min-height: 100vh;
  color: #0f172a;
}

/* =============================================
   LAYOUT PRINCIPAL
   ============================================= */
.login-container {
  display: flex;
  min-height: 100vh;
}

/* =============================================
   PANEL IZQUIERDO - BRANDING
   ============================================= */
.login-brand {
  flex: 1;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #4c1d95 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 60%);
  top: -150px;
  right: -150px;
  pointer-events: none;
}

.login-brand::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 60%);
  bottom: -100px;
  left: -100px;
  pointer-events: none;
}

.brand-content {
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 400px;
}

.brand-logo {
  margin-bottom: 24px;
}

.logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 12px 40px rgba(245, 158, 11, 0.4);
}

.brand-name {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 8px;
}

.brand-easy {
  color: white;
}

.brand-suite {
  color: #fbbf24;
}

.brand-tagline {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 32px;
}

.brand-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  margin: 0 auto 32px;
  border-radius: 2px;
}

.brand-systems {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 40px;
}

.system-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}

/* EasyFac - Naranja */
.system-badge.easyfac {
  border-color: rgba(245, 158, 11, 0.4);
}
.system-badge.easyfac svg {
  color: #fbbf24;
}

/* EasyStock - Verde */
.system-badge.easystock {
  border-color: rgba(16, 185, 129, 0.4);
}
.system-badge.easystock svg {
  color: #34d399;
}

/* EasyPOS - Rosa */
.system-badge.easypos {
  border-color: rgba(236, 72, 153, 0.4);
}
.system-badge.easypos svg {
  color: #f472b6;
}

/* EasyCompras - Azul */
.system-badge.easycompras {
  border-color: rgba(14, 165, 233, 0.4);
}
.system-badge.easycompras svg {
  color: #38bdf8;
}

/* EasyCRM - Violeta */
.system-badge.easycrm {
  border-color: rgba(139, 92, 246, 0.4);
}
.system-badge.easycrm svg {
  color: #a78bfa;
}

.brand-footer {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

/* =============================================
   PANEL DERECHO - FORMULARIO
   ============================================= */
.login-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  background: white;
}

.form-container {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}

.form-header {
  margin-bottom: 32px;
}

.form-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.form-header p {
  color: #64748b;
  font-size: 1rem;
}

/* =============================================
   FORMULARIO
   ============================================= */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: #0f172a;
  margin-bottom: 8px;
  font-size: 0.875rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 14px 14px 48px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.2s;
  background: white;
  color: #0f172a;
}

.input-wrapper input:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.input-wrapper input::placeholder {
  color: #94a3b8;
}

.toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.toggle-password:hover {
  color: #7c3aed;
}

/* =============================================
   OPCIONES
   ============================================= */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

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

.checkbox-wrapper input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.checkbox-wrapper input:checked + .checkmark {
  background: #7c3aed;
  border-color: #7c3aed;
}

.checkbox-wrapper input:checked + .checkmark::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.checkbox-label {
  color: #475569;
  font-size: 0.875rem;
}

.link-recuperar {
  color: #7c3aed;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.link-recuperar:hover {
  color: #6d28d9;
  text-decoration: underline;
}

/* =============================================
   BOTÓN LOGIN
   ============================================= */
.btn-login {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s;
  font-family: inherit;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.3);
}

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

.btn-login.loading .btn-text,
.btn-login.loading .btn-icon {
  display: none;
}

.btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-login.loading .btn-spinner {
  display: block;
}

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

/* =============================================
   DIVIDER
   ============================================= */
.divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.divider span {
  padding: 0 16px;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* =============================================
   INFO BOX
   ============================================= */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #f1f5f9;
  border-radius: 12px;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
}

.info-box svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #7c3aed;
}

/* =============================================
   FOOTER
   ============================================= */
.form-footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.form-footer p {
  color: #94a3b8;
  font-size: 0.875rem;
}

.form-footer a {
  color: #7c3aed;
  text-decoration: none;
  font-weight: 500;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* =============================================
   MODALES
   ============================================= */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 20px;
  max-width: 450px;
  width: 100%;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
  animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.modal-body {
  padding: 24px;
}

.modal-body > p {
  color: #64748b;
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 0 24px 24px;
}

.modal-footer button {
  flex: 1;
  padding: 14px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-secondary {
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  color: #475569;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border: none;
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary.loading span {
  display: none;
}

.btn-primary .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-primary.loading .btn-spinner {
  display: block;
}

/* =============================================
   PASSWORD STRENGTH
   ============================================= */
.password-strength {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: all 0.3s;
}

.strength-text {
  font-size: 0.75rem;
  font-weight: 500;
  min-width: 60px;
}

/* =============================================
   TOAST
   ============================================= */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #7c3aed;
  animation: toastSlide 0.3s ease;
  max-width: 400px;
}

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

.toast.success {
  border-left-color: #10b981;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast.warning {
  border-left-color: #f59e0b;
}

.toast-message {
  color: #0f172a;
  font-size: 0.95rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .login-brand {
    display: none;
  }
  
  .login-form-panel {
    padding: 40px 24px;
  }
}

@media (max-width: 480px) {
  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .modal-content {
    margin: 20px;
  }
  
  .modal-footer {
    flex-direction: column;
  }
}
