:root {
  --nasa-dark-blue: #0b1526;
  --nasa-blue: #0b3d91;
  --nasa-light-blue: #1e90ff;
  --nasa-cyan: #00d4ff;
  --nasa-accent: #4fc3f7;
  --nasa-glow: rgba(30, 144, 255, 0.3);
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, var(--nasa-dark-blue) 0%, #0d2137 50%, #0b1526 100%);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, white, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, white, transparent),
    radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 230px 80px, white, transparent),
    radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 350px 200px, white, transparent);
  background-repeat: repeat;
  background-size: 400px 400px;
  animation: twinkle 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

#stellarium-container {
  height: 85vh;
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  #stellarium-container {
    height: 70vh;
  }
}

.main-header {
  background: linear-gradient(180deg, var(--nasa-blue) 0%, var(--nasa-dark-blue) 100%);
  border-bottom: 2px solid var(--nasa-cyan);
  box-shadow: 0 4px 20px var(--nasa-glow);
  position: relative;
  z-index: 100;
}

.logo-container {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
}

.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-container:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--nasa-glow);
}

/* IMPORTANTE: z-index alto para nav-bar */
.nav-bar {
  background: linear-gradient(90deg, rgba(11, 61, 145, 0.95) 0%, rgba(30, 144, 255, 0.85) 50%, rgba(11, 61, 145, 0.95) 100%);
  border-bottom: 1px solid var(--nasa-cyan);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 9999;
}

.nav-btn {
  background: transparent;
  color: white;
  padding: 12px 20px;
  border: none;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-btn::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: left 0.5s ease;
}

.nav-btn:hover::before {
  left: 100%;
}

.nav-btn:hover {
  background: rgba(79, 195, 247, 0.3);
  text-shadow: 0 0 10px var(--nasa-cyan);
}

.nav-btn:active {
  background: rgba(79, 195, 247, 0.15);
  opacity: 0.7;
  transform: scale(0.98);
}

/* IMPORTANTE: Dropdown de idioma con z-index muy alto */
.language-dropdown {
  position: relative;
  display: inline-block;
}

.language-dropdown-content {
  display: none;
  position: absolute;
  background: var(--nasa-dark-blue);
  border: 1px solid var(--nasa-cyan);
  border-radius: 8px;
  min-width: 150px;
  z-index: 99999;
  top: 100%;
  right: 0;
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}

.language-dropdown:hover .language-dropdown-content {
  display: block;
}

.language-option {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  color: white;
}

.language-option:hover {
  background: rgba(79, 195, 247, 0.3);
}

.nasa-btn {
  background: linear-gradient(135deg, var(--nasa-blue) 0%, var(--nasa-light-blue) 100%);
  color: white;
  padding: 12px 24px;
  border: 1px solid var(--nasa-cyan);
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--nasa-glow);
  position: relative;
  overflow: hidden;
}

.nasa-btn:hover {
  background: linear-gradient(135deg, var(--nasa-light-blue) 0%, var(--nasa-cyan) 100%);
  box-shadow: 0 6px 25px rgba(0, 212, 255, 0.5);
  transform: translateY(-2px);
}

.nasa-btn:active {
  opacity: 0.7;
  transform: translateY(0) scale(0.98);
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 100000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: linear-gradient(135deg, var(--nasa-dark-blue) 0%, #0d2137 100%);
  border: 2px solid var(--nasa-cyan);
  border-radius: 16px;
  padding: 30px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 50px var(--nasa-glow), inset 0 0 30px rgba(0, 212, 255, 0.1);
  animation: slideIn 0.4s ease;
}

@keyframes slideIn {
  from { 
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: 2px solid var(--nasa-cyan);
  color: var(--nasa-cyan);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--nasa-cyan);
  color: var(--nasa-dark-blue);
  transform: rotate(90deg);
}

.modal-title {
  color: var(--nasa-cyan);
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(79, 195, 247, 0.3);
}

.nasa-input {
  background: rgba(11, 61, 145, 0.3);
  border: 1px solid rgba(79, 195, 247, 0.5);
  border-radius: 8px;
  padding: 12px 16px;
  color: white;
  width: 100%;
  transition: all 0.3s ease;
}

.nasa-input-ra-dec {
  background: rgba(11, 61, 145, 0.3);
  border: 1px solid rgba(79, 195, 247, 0.5);
  border-radius: 8px;
  padding: 10px 6px;
  color: white;
  /* width: 10%;*/
  /* box-sizing: border-box;*/
  transition: all 0.3s ease;
}

.nasa-input:focus {
  outline: none;
  border-color: var(--nasa-cyan);
  box-shadow: 0 0 15px var(--nasa-glow);
  background: rgba(11, 61, 145, 0.5);
}

.nasa-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.input-row {
  display: flex;
  align-items: center;
}

.input-row label {
  margin: 0;
  padding: 0;
}

.input-row input {
  margin-left: 8px;   /* small space after each label */
  margin-right: 1px;    /* no extra space after input */
  width: 90px;
  padding: 4px;
}

/* Remove default spacing between input and next label */
.input-row input + label {
  margin-left: 0;
}

.degree-ra {
  position: relative;
  top: 1px;   /* move up */
  font-size: 1.2em; /* optional: slightly smaller */
}

.degree-lab {
  position: relative;
  top: 7px;   /* move up */
  /* font-size: 1.2em; optional: slightly smaller */
}

.degree {
  position: relative;
  top: -9px;   /* move up */
  font-size: 1.2em; /* optional: slightly smaller */
}

.coord-grid {
  display: grid;
  grid-template-columns: 60px 100px 60px 100px 60px 100px 60px;
  align-items: center;
  /* justify-items: center; */
  /* place-items: center; */
  gap: 6px 6px;  /* row gap / column gap */
}

.nasa-card {
  background: linear-gradient(135deg, rgba(11, 61, 145, 0.4) 0%, rgba(13, 33, 55, 0.6) 100%);
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.faq-item {
  border-bottom: 1px solid rgba(79, 195, 247, 0.2);
  padding: 15px 0;
}

.faq-question {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--nasa-cyan);
  font-weight: 500;
}

.faq-answer {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.glow-text {
  text-shadow: 0 0 10px var(--nasa-cyan), 0 0 20px var(--nasa-glow);
}

/* Estilos para selección de certificados */
.certificate-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px 0;
}

@media (max-width: 600px) {
  .certificate-grid {
    grid-template-columns: 1fr;
  }
}

.certificate-option {
  position: relative;
  cursor: pointer;
  border: 3px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  background: rgba(11, 61, 145, 0.3);
  aspect-ratio: 1.414;
}

.certificate-option:hover {
  border-color: var(--nasa-cyan);
  transform: scale(1.02);
  box-shadow: 0 0 25px var(--nasa-glow);
}

.certificate-option.selected {
  border-color: #ffd700;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.certificate-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.certificate-option:hover img {
  transform: scale(1.05);
}

.certificate-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 20px 10px 10px;
  text-align: center;
  color: white;
  font-weight: 600;
}

.certificate-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: #ffd700;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 16px;
}

.certificate-option.selected .certificate-check {
  display: flex;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px var(--nasa-glow); }
  50% { box-shadow: 0 0 20px var(--nasa-cyan); }
}

.certificate-option:not(.selected):hover {
  animation: pulse-glow 1.5s infinite;
}

.download-panel {
  text-align: center;
  padding: 30px;
}

.download-icon {
  font-size: 80px;
  color: #4ade80;
  margin-bottom: 20px;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.download-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  padding: 15px 40px;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.download-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
}

.process-steps {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(11, 61, 145, 0.3);
  border-radius: 20px;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
}

.step.active {
  background: var(--nasa-blue);
  color: var(--nasa-cyan);
}

.step.completed {
  background: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
}

.step.active .step-number,
.step.completed .step-number {
  background: currentColor;
  color: var(--nasa-dark-blue);
}

.resumen-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(79, 195, 247, 0.2);
}

.resumen-total {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  font-size: 1.2em;
  font-weight: bold;
  color: var(--nasa-cyan);
  border-top: 2px solid var(--nasa-cyan);
  margin-top: 10px;
}
/* Asegura que nada se salga horizontalmente */
#registroForm { 
  overflow-x: hidden;
}

/* Clave: permite que los items del grid se encojan dentro del contenedor */
#registroForm > * {
  min-width: 0;
}

/* Inputs siempre dentro */
.nasa-input,
.nasa-input-ra-dec {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* FIX REAL: coord-grid responsive (no fijo a 100px) */
.coord-grid {
  display: grid;
  width: 100%;
  align-items: center;
  gap: 8px 10px;

  /* 60px para RA/DEC + 3 inputs flexibles + unidades pequeñas */
  grid-template-columns:
    60px minmax(0, 1fr) 18px
    minmax(0, 1fr) 18px
    minmax(0, 1fr) 18px;
}

/* Ajuste móvil: reduce un poco para que no reviente */
@media (max-width: 480px) {
  .coord-grid {
    grid-template-columns:
      48px minmax(0, 1fr) 14px
      minmax(0, 1fr) 14px
      minmax(0, 1fr) 14px;
    gap: 6px 8px;
  }

  .nasa-input-ra-dec {
    padding: 8px 6px;
  }
}

