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

body {
  font-family: 'Nunito', sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.split-screen-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* Lado izquierdo - Imagen de fondo */
.split-left {
  flex: 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
  z-index: 1;
  animation: slideHorizontal 30s ease-in-out infinite;
}

@keyframes slideHorizontal {
  0%, 100% {
    background-position: center center;
  }
  50% {
    background-position: 60% center;
  }
}

.split-left::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
  z-index: 1;
}

/* Logo en el formulario */
.logo-heidiplus-form {
  max-width: 250px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 20px auto;
  animation: fadeInDown 0.8s ease-out, subtlePulse 2.5s ease-in-out infinite;
  animation-delay: 0s, 1s;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
  filter: none;
  -webkit-filter: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo-heidiplus-form:hover {
  transform: scale(1.05);
}

@keyframes subtlePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.logo-text-form {
  display: none;
  text-align: center;
  margin-bottom: 20px;
}

.logo-text-form-h1 {
  color: #1a1a1a;
  font-size: 2.5rem;
  font-weight: 900;
  margin: 0;
}

.logo-text-form-h1 strong {
  color: #1a1a1a;
  font-weight: 900;
}

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

/* Lado derecho - Formulario */
.split-right {
  flex: 1;
  background: #ffffff;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 40px 20px 40px;
  overflow: hidden;
  position: relative;
}

.split-right::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

.form-container {
  width: 100%;
  max-width: 450px;
  animation: fadeInRight 0.8s ease-out;
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.98);
  padding: 35px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Ajustes para formulario de registro más compacto */
.form-body .row {
  margin-left: -10px;
  margin-right: -10px;
}

.form-body .row > [class*="col-"] {
  padding-left: 10px;
  padding-right: 10px;
}

.form-body .form-group {
  margin-bottom: 16px;
}

/* Hacer formulario más compacto */
.form-body form {
  margin-bottom: 0;
}

/* Reducir espaciado entre campos en registro */
.form-body .row .form-group {
  margin-bottom: 16px;
}

/* Reducir espaciado en formulario de registro para que sea más compacto */
.form-body form .form-group:last-of-type {
  margin-bottom: 16px;
}

/* Paso 2 - Contraseña: reducir márgenes */
#step2 .form-group {
  margin-bottom: 16px;
}

#step2 .form-group:last-of-type {
  margin-bottom: 10px;
}

.register-step {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Paso 2 - Contraseña: reducir márgenes */
#step2 .form-group {
  margin-bottom: 16px;
}

#step2 .form-group:last-of-type {
  margin-bottom: 10px;
}

/* Ajustes para formulario de registro más compacto */
.form-body .row {
  margin-left: -10px;
  margin-right: -10px;
}

.form-body .row > [class*="col-"] {
  padding-left: 10px;
  padding-right: 10px;
}

.form-body .form-group {
  margin-bottom: 20px;
}

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

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

.form-header {
  text-align: center;
  margin-bottom: 25px;
  position: relative;
}

.form-header::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #1a1a1a, transparent);
  border-radius: 2px;
}

.form-header h2 {
  font-weight: 700;
  font-size: 2rem;
  color: #1a1a1a;
  margin: 0;
  margin-top: 10px;
  position: relative;
  display: inline-block;
}

.form-header h2::before {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: #1a1a1a;
  transition: width 0.6s ease;
}

.form-header h2:hover::before {
  width: 100%;
}

.form-body {
  width: 100%;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  font-size: 0.95rem;
  display: block;
}

.form-control {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fafafa;
  width: 100%;
  position: relative;
}

.form-control:focus {
  border-color: #1a1a1a;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.15);
  outline: none;
  background: #fff;
  transform: translateY(-2px);
  border-width: 2.5px;
}

.form-control:hover:not(:focus) {
  border-color: #c0c0c0;
  background: #f5f5f5;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Contenedor para input de contraseña con icono */
.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-input-wrapper .form-control {
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #666;
  font-size: 1rem;
  transition: color 0.3s ease;
  z-index: 10;
}

.password-toggle:hover {
  color: #1a1a1a;
}

.form-control::placeholder {
  color: #999;
  transition: opacity 0.3s ease;
}

.form-control:focus::placeholder {
  opacity: 0.5;
}

.btn-primary {
  background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
  border: 2px solid #333;
  border-radius: 12px;
  padding: 16px;
  font-weight: 700;
  font-size: 1.1rem;
  width: 100%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border-color: #444;
}

.btn-primary:active {
  transform: translateY(-1px) scale(1);
}

/* Botón de asociarse en el formulario (diferente al de ingresar) */
.btn-associate-submit {
  background: transparent;
  border: 3px solid #1a1a1a;
  border-radius: 12px;
  padding: 16px;
  font-weight: 800;
  font-size: 1.1rem;
  width: 100%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.btn-associate-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.btn-associate-submit:hover::before {
  left: 0;
}

.btn-associate-submit:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  border-color: #1a1a1a;
  color: white;
}

.btn-associate-submit:active {
  transform: translateY(-1px) scale(1);
}

.btn-secondary {
  background: #6c757d;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-weight: 600;
  width: 100%;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

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

.divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: #e0e0e0;
}

.divider span {
  background: #ffffff;
  padding: 0 20px;
  position: relative;
  color: #666;
  font-size: 0.95rem;
}

.register-link {
  text-align: center;
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid #e0e0e0;
}

.register-link p {
  color: #666;
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.register-link a {
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
  display: inline-block;
}

.register-link a:hover {
  color: #000000;
  text-decoration: underline;
  transform: translateX(2px);
}

.btn-associate {
  display: inline-block;
  padding: 14px 30px;
  background: transparent;
  color: #1a1a1a !important;
  border: 3px solid #1a1a1a;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-top: 10px;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.btn-associate::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.btn-associate:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  border-color: #1a1a1a;
  color: white !important;
  text-decoration: none !important;
}

.btn-associate:hover::before {
  left: 0;
}

.btn-associate:active {
  transform: translateY(-1px) scale(1);
}

.alert {
  border-radius: 12px;
  border: none;
  padding: 14px 18px;
  margin-bottom: 25px;
}

.input-group-text {
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-right: none;
  border-radius: 12px 0 0 12px;
}

.input-group .form-control {
  border-left: none;
  border-radius: 0 12px 12px 0;
}

.input-group:focus-within .input-group-text {
  border-color: #333;
}

.form-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-check-input {
  width: 50px;
  height: 25px;
  cursor: pointer;
}

.divider strong {
  color: #1a1a1a;
  font-weight: 900;
  font-size: 1.1em;
}

/* Estilos para formulario de registro en dos pasos */
.register-step {
  animation: fadeIn 0.4s ease-out;
  margin-bottom: 0;
  padding-bottom: 0;
}

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

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0e0e0;
}

.step-number {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.step-number.active {
  background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.step-label {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

.step-actions {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  margin-bottom: 0;
}

.step-actions .btn {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.step-actions .btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.step-actions .btn:hover::after {
  width: 300px;
  height: 300px;
}

/* Efecto de brillo sutil en el formulario */
.form-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  border-radius: 20px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.form-container:hover::before {
  opacity: 1;
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* Animación de shake para campos inválidos */
.form-control.is-invalid {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

.form-control.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
  animation: shake 0.5s ease;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .split-screen-container {
    flex-direction: column;
    min-height: 100vh;
    position: relative;
  }

  .split-left {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 100vh;
    z-index: 0;
    animation: none;
  }

  .split-left::before {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.3) 100%);
  }

  .split-right {
    flex: 1;
    padding: 30px 20px;
    position: relative;
    z-index: 1;
  }

  .split-right::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
  }

  .split-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
  }

  .split-right::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
  }

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

  .form-container {
    max-width: 100%;
    padding: 25px 20px;
    background: rgba(255, 255, 255, 0.95);
  }

  .split-right::before {
    display: none;
  }

  .logo-heidiplus-form {
    max-width: 200px;
    margin-bottom: 15px;
    filter: none;
    box-shadow: none;
  }

  .logo-text-form-h1 {
    font-size: 2rem;
  }

  .form-header h2 {
    font-size: 1.6rem;
  }

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

@media (max-width: 576px) {
  .split-right {
    padding: 25px 15px;
    background: rgba(255, 255, 255, 0.98);
  }

  .logo-heidiplus-form {
    max-width: 180px;
    filter: none;
    box-shadow: none;
  }

  .logo-text-form-h1 {
    font-size: 1.8rem;
  }

  .form-header h2 {
    font-size: 1.4rem;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .form-control {
    padding: 12px 15px;
  }

  .btn-associate {
    padding: 12px 25px;
    font-size: 1rem;
  }
}

/* Footer */
.heidiplus-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid #e0e0e0;
  padding: 12px 20px;
  text-align: center;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content p {
  margin: 0;
  color: #666;
  font-size: 0.85rem;
  font-weight: 400;
}

.footer-content a {
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.footer-content a:hover {
  color: #000000;
  text-decoration: underline;
}

/* Ajustar padding del body para que el footer no tape contenido */

@media (max-width: 768px) {
  .heidiplus-footer {
    padding: 10px 15px;
  }

  .footer-content p {
    font-size: 0.8rem;
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay[style*="display: flex"] {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay[style*="display: flex"] .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 25px 30px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
  color: white;
  border-radius: 20px 20px 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.modal-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-body {
  padding: 30px;
}

.form-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 25px;
}

.forgot-password-link a:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast-notification {
  min-width: 320px;
  max-width: 450px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  border-left: 4px solid;
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-notification.hide {
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-message {
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #666;
  font-size: 0.9rem;
  transition: color 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.toast-close:hover {
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.05);
}

/* Tipos de Toast */
.toast-success {
  border-left-color: #28a745;
  background: #ffffff;
}

.toast-success .toast-icon {
  color: #28a745;
}

.toast-error {
  border-left-color: #dc3545;
  background: #ffffff;
}

.toast-error .toast-icon {
  color: #dc3545;
}

.toast-warning {
  border-left-color: #ffc107;
  background: #ffffff;
}

.toast-warning .toast-icon {
  color: #ffc107;
}

.toast-info {
  border-left-color: #17a2b8;
  background: #ffffff;
}

.toast-info .toast-icon {
  color: #17a2b8;
}

@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: auto;
    align-items: flex-end;
    justify-content: flex-end;
    width: auto;
    max-width: calc(100% - 20px);
  }

  .toast-notification {
    min-width: auto;
    max-width: 100%;
    width: 100%;
    transform: translateX(400px);
    margin-left: 0;
    margin-right: 0;
  }

  .toast-notification.show {
    transform: translateX(0);
  }

  .toast-notification.hide {
    transform: translateX(400px);
  }
}
