/*
 * Estilos Test de Riesgo Público - Gainovo
 * Diseño oscuro responsive inspirado en boletín HTML.
 */

:root {
  --trp-bg: #0a0a0f;
  --trp-card: #16161f;
  --trp-border: #252535;
  --trp-text: #e8edf7;
  --trp-text-soft: #aab4c8;
  --trp-primary: #0F52AA;
  --trp-primary-2: #167BFF;
  --trp-accent: #38bdf8;
  --trp-danger: #ef4444;
  --trp-radius: 18px;
}

.trp-test {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top right, rgba(22, 123, 255, 0.12), transparent 45%), var(--trp-bg);
  border: 1px solid var(--trp-border);
  border-radius: 24px;
  color: var(--trp-text);
  max-width: 840px;
  margin: 0 auto;
  padding: 1.25rem;
}

.trp-card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.02), rgba(22, 123, 255, 0.04));
  border: 1px solid var(--trp-border);
  border-radius: var(--trp-radius);
  padding: 1.25rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.trp-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #dbeafe;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(15, 82, 170, 0.35);
  border-radius: 999px;
  margin-bottom: 0.8rem;
}

.trp-intro h2,
.trp-preguntas h3,
.trp-modal-content h3,
.trp-modal-content h4 {
  font-family: 'Montserrat', sans-serif;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.trp-intro p,
.trp-modal-head p,
.trp-note,
.trp-disclaimer {
  color: var(--trp-text-soft);
}

.trp-grid-datos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin: 1rem 0;
}

.trp-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.trp-field input,
.trp-field select {
  width: 100%;
  background: #0f1018;
  border: 1px solid #29314a;
  border-radius: 12px;
  color: var(--trp-text);
  font-size: 0.98rem;
  padding: 0.72rem 0.82rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.trp-field input:focus,
.trp-field select:focus {
  border-color: var(--trp-accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.trp-btn {
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0.76rem 1rem;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.trp-btn:hover {
  transform: translateY(-1px);
}

.trp-btn-primary,
.trp-btn-secondary {
  background: linear-gradient(120deg, var(--trp-primary), var(--trp-primary-2));
  color: #fff;
  box-shadow: 0 10px 26px rgba(22, 123, 255, 0.28);
}

.trp-btn-ghost {
  background: transparent;
  color: #dbeafe;
  border: 1px solid #3b4b79;
}

.trp-opciones {
  display: grid;
  gap: 0.72rem;
  margin-top: 1rem;
}

.trp-opcion {
  text-align: left;
  background: #10131d;
  border: 1px solid #2f3f68;
  color: var(--trp-text);
  padding: 0.95rem;
  border-radius: 12px;
}

.trp-opcion:hover {
  border-color: var(--trp-accent);
  background: #111b30;
}

.trp-progress-wrap {
  margin-bottom: 1rem;
}

.trp-progress-text {
  font-size: 0.9rem;
  color: #bfdbfe;
  margin-bottom: 0.35rem;
}

.trp-progress-bar {
  width: 100%;
  height: 8px;
  background: #101827;
  border-radius: 999px;
  overflow: hidden;
}

.trp-progress-bar span {
  display: block;
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, #167BFF, #38bdf8);
  transition: width 0.25s ease;
}

.trp-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.trp-note {
  font-size: 0.86rem;
  margin-top: 0.8rem;
}

/* Modal */
.trp-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.trp-modal.is-open {
  display: block;
}

.trp-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 10, 0.74);
  backdrop-filter: blur(4px);
}

.trp-modal-content {
  position: relative;
  max-width: 720px;
  width: calc(100% - 2rem);
  margin: 5vh auto;
  background: linear-gradient(165deg, #121624, #171d30);
  border: 1px solid #2e3a58;
  border-radius: 20px;
  padding: 1.25rem;
  color: var(--trp-text);
  max-height: 90vh;
  overflow: auto;
}

.trp-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #dbeafe;
  font-size: 1.4rem;
  cursor: pointer;
}

.trp-sugerencias {
  display: grid;
  gap: 0.85rem;
}

.trp-sugerencia-grupo {
  border: 1px solid #2b3858;
  background: #0d1424;
  border-radius: 14px;
  padding: 0.85rem;
}

.trp-sugerencia-grupo h5 {
  margin: 0 0 0.55rem;
  font-family: 'Montserrat', sans-serif;
  color: #dbeafe;
}

.trp-sugerencia-grupo ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #c4d1e6;
}

.trp-sugerencia-grupo li {
  margin: 0 0 0.45rem;
}

.trp-disclaimer {
  font-size: 0.84rem;
  margin-top: 0.95rem;
}

.trp-error {
  margin-top: 0.75rem;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  padding: 0.6rem 0.72rem;
  font-size: 0.88rem;
}

/* Ajustes adicionales para mejorar contraste */
.trp-modal-content h3,
.trp-modal-content h4,
.trp-modal-head p,
.trp-sugerencia-grupo h5,
.trp-sugerencia-grupo ul,
.trp-intro h2,
.trp-preguntas h3 {
  color: #ffffff !important;
}

.trp-sugerencia-grupo li {
  color: #e2e8f0 !important;
}

.trp-modal-head p {
  color: #cbd5e1 !important;
}

/* Responsive */
@media (max-width: 900px) {
  .trp-test { padding: 1rem; }
}

@media (max-width: 768px) {
  .trp-grid-datos {
    grid-template-columns: 1fr;
  }

  .trp-card,
  .trp-modal-content {
    padding: 1rem;
    border-radius: 16px;
  }

  .trp-intro h2 { font-size: 1.45rem; }
  .trp-preguntas h3 { font-size: 1.15rem; }
}

@media (max-width: 480px) {
  .trp-test {
    border-radius: 16px;
    padding: 0.8rem;
  }

  .trp-btn {
    width: 100%;
    justify-content: center;
  }

  .trp-actions {
    flex-direction: column;
  }

  .trp-modal-content {
    width: calc(100% - 1rem);
    margin: 3vh auto;
  }
}