.testriesgo-card {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
  position: relative;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Botón principal - UNIFICADO CON SISTEMA GAINOVO */
.testriesgo-btn {
  display: inline-block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid #ffffff;
  border-radius: 36px;
  background: linear-gradient(135deg, #0F52AA 0%, #0F52AA 100%);
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  box-shadow: 0 4px 15px rgba(15, 82, 170, 0.3);
}

.testriesgo-btn:hover {
  background: linear-gradient(135deg, #167BFF 0%, #167BFF 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 82, 170, 0.4);
  border-color: #ffffff;
}

.testriesgo-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(15, 82, 170, 0.3);
}

/* Resultado en tarjeta */
.testriesgo-resultado-tarjeta {
  margin-top: 1rem;
  text-align: left;
}

.testriesgo-resultado-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.testriesgo-resultado-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #0F52AA;
  font-weight: 600;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-info-icon {
  width: 20px;
  height: 20px;
  color: #6c757d;
  cursor: pointer;
  transition: color 0.3s ease;
}

.testriesgo-info-icon:hover {
  color: #0F52AA;
}

.testriesgo-perfil-mostrado {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

#testriesgoPerfilTarjeta {
  font-weight: 700;
  font-size: 1.1rem;
  color: #0F52AA;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-acciones-tarjeta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.testriesgo-reintentar-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #0F52AA;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.testriesgo-reintentar-btn:hover {
  color: #167BFF;
}

.testriesgo-btn-secundario.pequeño {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 20px;
  border: 2px solid #0F52AA;
  background: transparent;
  color: #0F52AA;
  font-weight: 600;
  transition: all 0.3s ease;
}

.testriesgo-btn-secundario.pequeño:hover {
  background: #0F52AA;
  color: #ffffff;
}

.testriesgo-rehacer-container {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e9ecef;
}

.testriesgo-rehacer-container .testriesgo-btn-secundario {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.9rem;
  border: 2px solid #0F52AA;
  background: transparent;
  color: #0F52AA;
  font-weight: 600;
  transition: all 0.3s ease;
}

.testriesgo-rehacer-container .testriesgo-btn-secundario:hover {
  background: #0F52AA;
  color: #ffffff;
}

/* Mensaje de login */
.testriesgo-login-message {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 0.5rem;
  color: #856404;
  font-size: 0.9rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-login-message p {
  margin: 0;
}

.testriesgo-login-required {
  padding: 1rem;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 0.5rem;
  color: #721c24;
  margin-bottom: 1rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-login-required a {
  color: #721c24;
  text-decoration: underline;
  font-weight: 600;
}

/* ==================== */
/* MODAL - ACTUALIZADO CON ESTILO GAINOVO */
/* ==================== */

.testriesgo-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.testriesgo-modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 0;
  border-radius: 16px;
  width: 90%;
  max-width: 700px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
  animation-name: animatetop;
  animation-duration: 0.3s;
  position: relative;
  overflow: hidden;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

@keyframes animatetop {
  from {top: -50px; opacity: 0}
  to {top: 0; opacity: 1}
}

/* ENCABEZADO DEL MODAL - ACTUALIZADO CON AZUL GAINOVO */
.testriesgo-modal-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, #0F52AA 0%, #167BFF 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.testriesgo-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  flex: 1;
  font-weight: 600;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #ffffff;
}

.testriesgo-info-icon-modal {
  width: 24px;
  height: 24px;
  color: white;
  cursor: pointer;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.testriesgo-info-icon-modal:hover {
  color: rgba(255, 255, 255, 0.8);
}

.testriesgo-close {
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: color 0.3s ease;
}

.testriesgo-close:hover {
  color: rgba(255, 255, 255, 0.8);
}

.testriesgo-modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-pregunta h3 {
  margin-top: 0;
  color: #0F52AA;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-opciones {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.testriesgo-opcion-btn {
  padding: 0.75rem 1rem;
  background-color: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: left;
  transition: all 0.2s ease;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-weight: 500;
}

.testriesgo-opcion-btn:hover {
  background-color: #e9ecef;
  border-color: #0F52AA;
  transform: translateY(-1px);
}

.testriesgo-progreso {
  text-align: center;
  color: #6c757d;
  font-size: 0.9rem;
  margin-top: 1rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

#testRiesgoResultado h3 {
  color: #0F52AA;
  margin-top: 0;
  font-weight: 600;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

#testRiesgoResultado p {
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-resultado-acciones {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.testriesgo-btn-secundario {
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid #0F52AA;
  border-radius: 36px;
  background: transparent;
  color: #0F52AA;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-btn-secundario:hover {
  background: #0F52AA;
  color: white;
  transform: translateY(-2px);
}

.testriesgo-modal-body ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-modal-body li {
  margin-bottom: 0.5rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-datos-iniciales label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  color: #333;
  font-weight: 500;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-datos-iniciales input,
.testriesgo-datos-iniciales select {
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border-radius: 6px;
  border: 2px solid #e9ecef;
  box-sizing: border-box;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  transition: border-color 0.3s ease;
}

.testriesgo-datos-iniciales input:focus,
.testriesgo-datos-iniciales select:focus {
  border-color: #0F52AA;
  outline: none;
}

/* Cartera lista */
.testriesgo-cartera-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.testriesgo-estrategia {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(0,0,0,0.04);
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-estrategia.habilitada {
  background: #fff;
  color: #222;
}

.testriesgo-estrategia.deshabilitada {
  background: #f3f4f6;
  color: #8a8f98;
  opacity: 0.9;
}

.testriesgo-estrategia .estrat-label {
  font-weight: 600;
  font-size: 0.95rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-estrategia .estrat-por {
  font-weight: 700;
  color: #0F52AA;
}

.estrat-note {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #6c757d;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Tarjeta interna para recomendados */
.testriesgo-estrategia-card {
  border: 1px solid rgba(15, 82, 170, 0.08);
  padding: 0.8rem;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.testriesgo-estrategia-card .estrat-head {
  display:flex;
  justify-content: space-between;
  align-items: center;
}

.testriesgo-estrategia-card .estrat-label {
  font-weight: 700;
  color: #0F52AA;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.estrat-small-desc {
  font-size: 0.9rem;
  color: #495057;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.estrat-reason {
  font-size: 0.9rem;
  color: #495057;
  font-style: italic;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.estrat-actions {
  margin-top: 0.5rem;
}

.estrategias-recomendadas-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Estilos para el perfil de inversor en página de perfil */
.perfil-inversor-completo {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.perfil-inversor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.perfil-inversor-header h2 {
  color: #0F52AA;
  margin: 0;
  font-weight: 600;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.perfil-info-basica {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.perfil-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.perfil-info-item strong {
  color: #6c757d;
  font-size: 0.9rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.perfil-tag {
  background: linear-gradient(135deg, #0F52AA 0%, #167BFF 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Bloques de cartera en perfil */
.bloque-cartera {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 12px;
  border: 2px solid #f0f0f0;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.bloque-cartera-modal {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.bloque-recomendados {
  border-color: #0F52AA;
  background: linear-gradient(135deg, #f8fbff 0%, #f0f7ff 100%);
}

.bloque-otros-aptos {
  border-color: #28a745;
  background: linear-gradient(135deg, #f8fff9 0%, #f0fff4 100%);
}

.bloque-no-compatibles {
  border-color: #dc3545;
  background: linear-gradient(135deg, #fff8f8 0%, #fff0f0 100%);
}

.bloque-cartera h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #333;
  font-weight: 600;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.descripcion-bloque {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Estados de estrategias mejorados */
.testriesgo-estrategia.recomendada {
  border-left: 4px solid #0F52AA;
  background: #fff;
}

.testriesgo-estrategia.apta {
  border-left: 4px solid #28a745;
  background: #fff;
}

.testriesgo-estrategia.no-compatible {
  border-left: 4px solid #dc3545;
  background: #f8f9fa;
}

/* Perfil no existe */
.perfil-no-existe {
  text-align: center;
  padding: 3rem 2rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 2px dashed #dee2e6;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.perfil-no-existe h3 {
  color: #0F52AA;
  margin-bottom: 1rem;
  font-weight: 600;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.perfil-no-existe p {
  color: #6c757d;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Responsive */
@media (max-width: 768px) {
  .testriesgo-modal-content {
    margin: 15% auto;
    width: 95%;
  }
  
  .perfil-inversor-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .perfil-info-basica {
    grid-template-columns: 1fr;
  }
  
  .perfil-inversor-completo {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .testriesgo-card {
    padding: 0;
    height: auto;
  }
  .testriesgo-btn {
    font-size: 0.9rem;
    padding: 0.65rem 1.25rem;
  }
  .testriesgo-modal-header h2 {
    font-size: 1.2rem;
  }
  .testriesgo-resultado-acciones {
    flex-direction: column;
  }
  .testriesgo-acciones-tarjeta {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* Para asegurar misma altura en todas las tarjetas */
@media (min-width: 481px) {
  .testriesgo-card {
    height: auto;
  }
}

/* pequeños helpers */
.testriesgo-empty {
  color: #6c757d;
  padding: 0.5rem 0;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Estrategias mencionables */
.testriesgo-estrategia.mencionable {
  border-left: 4px solid #38bdf8;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Mejoras visuales adicionales */
.testriesgo-estrategia-card.recomendado {
  border: 1px solid rgba(15, 82, 170, 0.15);
  box-shadow: 0 2px 8px rgba(15, 82, 170, 0.08);
}

.testriesgo-estrategia-card .estrat-por {
  color: #0F52AA;
  font-weight: 700;
  font-size: 1.1rem;
}