/* Popup Modal Styles - Professional UNL Registration */

/* Overlay - sin fondo oscuro, solo para posicionamiento */
.popup-overlay {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Modal Container */
.popup-modal {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.1);
  width: 520px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  position: relative;
  transform: translateX(500px) scale(0.9);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.popup-overlay.active .popup-modal {
  transform: translateX(0) scale(1);
  animation: slideIn 0.5s ease-out forwards;
}

@keyframes slideIn {
  0% {
    transform: translateX(500px) scale(0.9);
    opacity: 0;
  }

  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* Header with gradient */
.popup-header {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
  padding: 20px 24px;
  border-radius: 20px 20px 0 0;
  position: relative;
  overflow: hidden;
}

.popup-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.popup-header h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 6px 0;
  position: relative;
  z-index: 1;
  letter-spacing: -0.3px;
}

.popup-header p {
  font-size: 12px;
  margin: 0;
  opacity: 0.95;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

/* Close Button */
.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg) scale(1.1);
}

/* Form Body */
.popup-body {
  padding: 18px 24px;
}

/* Form Groups Layout */
#unl-registration-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}

.form-group {
  margin-bottom: 0;
}

.form-group:first-child,
.btn-submit {
  grid-column: span 2;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group label .required {
  color: #dc2626;
  margin-left: 4px;
  font-size: 14px;
}

/* Input Fields */
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: white;
  color: #1f2937;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  background: #fff;
}

.form-control::placeholder {
  color: #9ca3af;
  font-size: 13px;
}

/* Select Styling */
select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23dc2626'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  padding-right: 36px;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
  margin-top: 10px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
}

.btn-submit:active {
  transform: translateY(0);
}

/* Custom Scrollbar */
.popup-modal::-webkit-scrollbar {
  width: 6px;
}

.popup-modal::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 0 20px 20px 0;
}

.popup-modal::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.popup-modal::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive Design */
@media (max-width: 640px) {
  .popup-overlay {
    bottom: 10px;
    right: 10px;
    /* Asegurar que se vea centrado si la pantalla es muy pequeña */
    left: 10px;
    display: flex;
    justify-content: center;
  }

  .popup-modal {
    margin: 0 auto;
    width: 100%;
    max-width: 340px;
    max-height: 60vh;
    /* Máximo 60% de la altura para no tapar todo */
    border-radius: 16px;
  }

  .popup-header {
    padding: 12px 16px;
    border-radius: 16px 16px 0 0;
  }

  .popup-header h2 {
    font-size: 15px;
    /* Texto más pequeño */
    margin-bottom: 2px;
  }

  .popup-header p {
    font-size: 10px;
    line-height: 1.2;
  }

  .popup-body {
    padding: 14px;
  }

  .form-group {
    margin-bottom: 10px;
    /* Menos espacio */
  }

  .form-group label {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .form-control {
    padding: 6px 10px;
    /* Inputs más compactos */
    font-size: 12px;
    height: auto;
  }

  /* Ajustar select */
  select.form-control {
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 25px;
  }

  .btn-submit {
    padding: 10px;
    font-size: 12px;
    margin-top: 12px;
    border-radius: 8px;
  }

  /* Botón cerrar más pequeño */
  .popup-close {
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    font-size: 16px;
  }
}

/* Error states */
.form-control.error {
  border-color: #dc2626;
  background-color: #fef2f2;
}

.error-message {
  color: #dc2626;
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

.form-control.error+.error-message {
  display: block;
}

/* Pulse effect for attention */
@keyframes popupPulse {

  0%,
  100% {
    box-shadow: 0 20px 60px rgba(220, 38, 38, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.1);
  }

  50% {
    box-shadow: 0 20px 60px rgba(220, 38, 38, 0.6), 0 0 0 1px rgba(220, 38, 38, 0.2);
  }
}

.popup-overlay.active .popup-modal {
  animation: slideIn 0.5s ease-out forwards, popupPulse 2s ease-in-out 0.5s 2;
}