@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #2b2d42;
  background-color: #f4f6f8;
  margin: 0;
  padding: 0;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
}

/* ==== CONTENEDORES ==== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.center-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

/* ==== TEXTO FORMATEADO ==== */
.formatted-text {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #333;
  padding: 0.5rem;
  white-space: pre-wrap;
}

/* ==== BOTONES ==== */
.btn-primary {
  background-color: #005377;
  border-color: #005377;
  color: #fff;
  transition: all 0.3s ease-in-out;
}

.btn-primary:hover {
  background-color: #004262;
  border-color: #003b57;
  color: #fff;
}

.btn-outline-primary {
  background-color: transparent;
  border: 1px solid #007bff;
  color: #007bff;
  transition: all 0.3s ease-in-out;
}

.btn-outline-primary:hover {
  background-color: #007bff;
  color: #fff;
}

.btn-accent {
  background-color: #ff884b;
  border-color: #ff884b;
  color: #fff;
}

.btn-accent:hover {
  background-color: #e6763e;
  border-color: #d66a36;
}

/* ==== ALERTAS PERSONALIZADAS ==== */
.alert {
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.alert-info {
  background-color: #e9f7fd;
  color: #0c5460;
  border: 1px solid #b8daff;
}

.alert-success {
  background-color: #e6f4ea;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ==== LINKS ==== */
a {
  color: #007bff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ==== ENCABEZADOS ==== */
h1 {
  color: #005377;
  font-family: "Montserrat", sans-serif;
  font-size: 1.7rem;
}
h2 {
  color: #005377;
  font-family: "Montserrat", sans-serif;
  font-size: 1.35rem;
}
h3 {
  color: #005377;
  font-family: "Montserrat", sans-serif;
  font-size: 1.1rem;
}
h4 {
  color: #005377;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
}

/* ==== SCROLL NAV ==== */
.nav-scroller {
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.5rem 0;
}

.btn-check:checked + .btn-outline-primary {
  background-color: #0d6efd;
  color: white;
  border-color: #0d6efd;
}

input[type="radio"].btn-check:checked + .btn-outline-primary {
  background-color: #0d6efd !important;
  color: white !important;
  border-color: #0d6efd !important;
}

/* ==== NEW CLASSES ==== */
.text-balance-container {
  min-width: -webkit-fill-available;
  min-width: -moz-available;
  min-width: fill-available;
  max-width: 90%;
  text-align: justify;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  position: relative;
  z-index: 2000;
  isolation: isolate;
}

.ai-logo-size {
  width: 90px;
  height: 200px;
}

.max-280 {
  max-width: 280px;
}

.centered-95 {
  max-width: 95%;
  margin: 0 auto;
}

.card-distribucion {
  width: 260px;
  min-height: 120px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dark-panel {
  width: 80%;
  height: 300px;
  border-radius: 21px 21px 0 0;
}

/* Added CSS from base.html embedded style block and additional styles */
.card-animada {
  opacity: 0;
  transform: scale(0.95);
  animation: fadeInScale 0.5s ease forwards;
}

.navbar-gradient {
  background: linear-gradient(to right, #ffffff, #6c757d, #212529);
}

.navbar {
  position: relative;
}

.footer-gradient {
  background: linear-gradient(to left, #ffffff, #6c757d, #212529);
}

.footer-gradient,
.footer-gradient h5,
.footer-gradient small,
.footer-gradient a {
  color: white !important;
}

.footer-gradient a:hover {
  color: #f8f9fa !important;
  text-decoration: underline;
}

.footer-gradient h5 {
  font-weight: 600;
  font-size: 1.1rem;
}

.section-box {
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.register-disabled-page {
  font-family: "Segoe UI", sans-serif;
  background-color: #f8f9fa;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  text-align: center;
}

.register-disabled-box {
  background-color: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 500px;
}

.register-disabled-box h1 {
  font-size: 24px;
  color: #333;
}

.register-disabled-box p {
  color: #555;
  margin-bottom: 20px;
}

.register-disabled-box .btn {
  display: inline-block;
  background-color: #007bff;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
}

.register-disabled-box .btn:hover {
  background-color: #0056b3;
}

/* New classes for profile.html */
.profile-container {
  background-color: #f8f9fa;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ==== PALETA DE COLORES OPOSIPRO ==== */
:root {
  --color-primario: #005377; /* Azul Inteligente */
  --color-secundario: #2e8b57; /* Verde Éxito */
  --color-acento: #ffc857; /* Amarillo Consciente */
  --color-fondo: #f9fafb; /* Gris Muy Claro */
  --color-contraste: #012a4a; /* Azul Marino Suave */
}

.profile-medal {
  width: 10%;
  height: 10%;
}

.profile-image {
  border-radius: 50%;
  border: 2px solid #007bff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  width: 100%;
  height: auto;
}

/* ==== DASHBOARD STYLES MOVED FROM dashboard.html ==== */
.modern-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modern-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

.card-title {
  font-weight: 600;
}

.card-text {
  font-size: 0.95rem;
}

.bg-body-tertiary {
  background-color: #f8f9fa !important;
}

.ribbon-inside {
  position: absolute;
  top: -100%;
  left: 35%;
  transform: translate(-50%, -50%) rotate(-45deg);
  background-color: rgba(220, 53, 69, 0.85);
  color: white;
  padding: 4px 40px;
  font-weight: bold;
  font-size: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: pulseRibbon 1.5s infinite ease-in-out;
  pointer-events: none;
  z-index: 1;
}

@keyframes pulseRibbon {
  0% {
    transform: rotate(-45deg) scale(1);
  }
  50% {
    transform: rotate(-45deg) scale(1.05);
  }
  100% {
    transform: rotate(-45deg) scale(1);
  }
}

/* ==== ESTILO TRUSTPILOT ==== */
#trustpilot-widget-container {
  margin-top: 40px;
  margin-bottom: 20px;
}

.trustpilot-widget {
  max-width: 500px;
  margin: 0 auto;
}

/* ==== ANIMACIÓN DE ENTRADA FADE-IN ==== */
.fade-in {
  opacity: 0;
  animation: fadeInAnimation 1.2s ease forwards;
}

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

/* ==== ANIMACIÓN DE ENTRADA SLIDE-IN-UP ==== */
.slide-in-up {
  opacity: 0;
  transform: translateY(50px);
  animation: slideInUpAnimation 1s ease forwards;
}

@keyframes slideInUpAnimation {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ==== ANIMACIÓN DE BOTÓN WHATSAPP ==== */
.whatsapp-chat-bounce {
  animation: bounceWhatsapp 2s infinite;
}

@keyframes bounceWhatsapp {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}
/* ==== ANIMACIONES DE SCROLL ==== */
.fade-in-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==== EFECTOS HOVER ADICIONALES EN BOTONES ==== */
.btn-primary:hover,
.btn-success:hover,
.btn-warning:hover {
  transform: scale(1.05);
  transition: all 0.3s ease-in-out;
}

/* ==== ESTILO DE BARRA DE PROGRESO ==== */
#nprogress {
  pointer-events: none;
}

#nprogress .bar {
  background: var(--color-primario);
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
}

/* ==== ESTILOS LIMPIOS PARA INDEX ==== */
.flex-wrap-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.list-style-none {
  list-style: none;
  padding-left: 0;
}

/* ==== BLOQUE RANKING HOME ==== */
.ranking-card {
  position: relative;
  z-index: 999 !important;
  max-width: 650px;
  margin: 2rem auto;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(245, 245, 245, 0.85)
  );
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  padding: 1.5rem;
}

.ranking-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ranking-card .list-group-item {
  border: none;
  font-size: 1rem;
  background: transparent;
  transition: all 0.2s ease;
}

.ranking-card .list-group-item:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

.ranking-card .btn {
  font-weight: 600;
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ranking-card .btn:hover {
  transform: scale(1.05);
}

/* Título y texto del ranking */
#ranking-section h4,
#ranking-section p {
  text-align: center;
  color: #003b57;
}

#ranking-section {
  position: relative;
  z-index: 999 !important;
}

/* Animación de entrada */
.ranking-card.fade-in {
  opacity: 0;
  transform: translateY(30px);
  animation: rankingFadeIn 0.9s ease-out forwards;
}

@keyframes rankingFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==== RESPONSIVE ==== */
@media (max-width: 767px) {
  .ranking-card {
    width: 95%;
    padding: 1rem;
  }

  .ranking-card .list-group-item {
    font-size: 0.95rem;
  }
}

/* ==== RESPONSIVE CORRECCIÓN FINAL: OCULTAR DECORACIONES ==== */
@media (max-width: 992px) {
  .product-device,
  .product-device-2 {
    display: none !important;
  }
  .product-device svg {
    display: none !important;
  }
}

/* ==== RESPONSIVE MÓVIL (≤767px) ==== */
@media (max-width: 767px) {
  .container,
  .centered-95 {
    padding: 1rem;
  }

  h1,
  h2,
  h3,
  h4 {
    font-size: 1.5rem;
  }

  p,
  .lead {
    font-size: 1rem;
  }

  .row.row-cols-1.row-cols-md-2 {
    display: block;
  }

  .col.text-bg-dark,
  .col.bg-body-tertiary {
    margin-bottom: 2rem;
  }

  .btn {
    width: 100%;
    font-size: 1rem;
    padding: 12px;
  }

  .alert-heading {
    font-size: 1.3rem;
  }

  .card-distribucion {
    width: 90%;
    margin: 0 auto 1rem;
  }
}

/* ==== RIBBON DIAGONAL PARA LA TARJETA DE SUSCRIPCIÓN ==== */
.ribbon-diagonal {
  position: absolute;
  top: 35px;
  left: -45px;
  transform: rotate(-45deg);
  background-color: var(--color-primario);
  color: white;
  padding: 6px 50px;
  font-size: 0.8rem;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 10;
  border-radius: 4px;
  animation: ribbonPulse 3s infinite ease-in-out;
}

/* Animación para hacer latir ligeramente la cinta */
@keyframes ribbonPulse {
  0%,
  100% {
    transform: rotate(-45deg) scale(1);
  }
  50% {
    transform: rotate(-45deg) scale(1.05);
  }
}
/* ==== ESTILO PARA CONTADOR DE DÍAS RESTANTES EN PRUEBA ==== */
.counter-dias-restantes {
  font-size: 2rem;
  font-weight: bold;
  color: var(--color-secundario);
  animation: pulseDays 2s infinite;
}

@keyframes pulseDays {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* ==== ESTILO PARA CONTADOR URGENTE CUANDO QUEDAN 3 DÍAS O MENOS ==== */
.contador-urgente {
  color: var(--color-acento);
  animation: blinkUrgent 1s infinite;
}

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

.card-promocional {
  max-width: 720px;
  margin: 2rem auto;
  animation: fadeInSlideUp 1s ease-in-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

.card-promocional-visitante {
  background: linear-gradient(135deg, #e3e3e3, #ffffff);
  border-left: 5px solid var(--color-primario);
  border-radius: 1rem;
}

@keyframes fadeInSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==== MENÚ HAMBURGUESA PERSONALIZADO ==== */
@media (max-width: 575px) {
  .navbar .navbar-nav {
    display: none;
  }

  .custom-hamburger {
    display: block;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1050;
    background-color: var(--color-primario);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 1.25rem;
  }

  .custom-mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    right: 15px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1049;
    width: 200px;
    padding: 1rem;
  }

  .custom-mobile-menu.show {
    display: block;
  }

  .custom-mobile-menu a {
    display: block;
    margin-bottom: 10px;
    color: var(--color-primario);
    font-weight: 500;
    text-decoration: none;
  }

  .custom-mobile-menu a:hover {
    text-decoration: underline;
  }

  .card.shadow-sm.p-4.mb-4 {
    margin-left: 10px !important;
    margin-right: 10px !important;
  }

  .d-flex.justify-content-center.mb-3 {
    margin-left: 10px;
    margin-right: 10px;
  }

  #groupContainer > .card.shadow-sm.p-4.mb-4 {
    margin-left: 10px !important;
    margin-right: 10px !important;
  }

  #groupContainer .group-card {
    margin-left: 10px !important;
    margin-right: 10px !important;
  }

  #fieldOptions {
    flex-direction: column !important;
    align-items: center;
  }

  #fieldOptions .field-card {
    margin: 0.5rem 0 !important;
    width: 90%;
  }

  #nivelContainer > .card.shadow-sm.p-4.mb-4 {
    margin-left: 10px !important;
    margin-right: 10px !important;
  }

  #nivelOptions {
    flex-direction: column !important;
    align-items: center;
  }

  #nivelOptions .nivel-card {
    margin: 0.5rem 0 !important;
    width: 90%;
  }

  .row.justify-content-center.mt-4.mb-3 {
    flex-wrap: nowrap;
    padding: 0 10px;
  }

  #clearSearch {
    width: 33.33% !important;
    margin-right: 10px;
  }

  #searchAskTitleGroup {
    width: 66.66% !important;
  }

  .table {
    margin-left: 10px;
    margin-right: 10px;
  }

  #paginationControls {
    margin-left: 10px;
    margin-right: 10px;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 0.5rem;
  }

  #paginationControls button {
    padding: 0.5rem 0.75rem;
    font-size: 0;
  }

  #paginationControls button#firstPage::before {
    content: "⏮";
    font-size: 1.25rem;
  }

  #paginationControls button#prevPage::before {
    content: "◀";
    font-size: 1.25rem;
  }

  #paginationControls button#nextPage::before {
    content: "▶";
    font-size: 1.25rem;
  }

  #paginationControls button#lastPage::before {
    content: "⏭";
    font-size: 1.25rem;
  }

  #paginationControls #pageInfo {
    display: none;
  }

  .d-flex.flex-column.flex-md-wrap.align-items-center.justify-content-center
    > .col-md-5.mb-3 {
    width: calc(100% - 20px) !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
  }

  .mt-4.d-flex.justify-content-center.gap-3.flex-wrap.align-items-center {
    flex-wrap: nowrap !important;
    margin-left: 10px;
    margin-right: 10px;
    gap: 0.5rem;
  }

  .mt-4.d-flex.justify-content-center.gap-3.flex-wrap.align-items-center
    button[name="anterior"] {
    font-size: 0;
    padding: 0.5rem 0.75rem;
  }
  .mt-4.d-flex.justify-content-center.gap-3.flex-wrap.align-items-center
    button[name="anterior"]::before {
    content: "⬅️";
    font-size: 1.25rem;
  }

  .mt-4.d-flex.justify-content-center.gap-3.flex-wrap.align-items-center
    button[name="siguiente"]::before {
    content: "➡️";
    font-size: 1.25rem;
  }

  .mt-4.d-flex.justify-content-center.gap-3.flex-wrap.align-items-center
    button[name="pause"]::before {
    content: "⏸️";
    font-size: 1.25rem;
  }
}

@media (min-width: 576px) {
  #customMobileMenu {
    display: none !important;
  }
}

@media (max-width: 770px) {
  td {
    text-align: center !important;
    padding: 0.5rem;
  }

  td > form,
  td > a.btn {
    display: block;
    width: calc(100% - 20px);
    min-width: 40px;
    padding: 0 !important;
    margin: 0.25rem 10px;
    text-align: center !important;
    justify-content: center;
    align-items: center;
  }

  td > form .btn,
  td > a.btn {
    width: 100%;
    padding: 0.4rem 0 !important;
    font-size: 0 !important;
    border-radius: 0.375rem;
  }

  td > form .btn.btn-danger::before {
    content: "🗑️";
    font-size: 1.2rem;
    display: inline-block;
  }

  td > a.btn.btn-warning::before {
    content: "⏯️";
    font-size: 1.2rem;
    display: inline-block;
  }
}

@media (max-width: 575px) {
  #respuesta-y-evaluacion .btn-group.d-flex.mt-2 {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }

  #respuesta-y-evaluacion .btn-group.d-flex.mt-2 .btn {
    flex: 1 1 calc(33.333% - 1rem);
    min-width: 100px;
    font-size: 0.85rem;
    padding: 0.5rem;
  }

  #respuesta-y-evaluacion + #mostrar-btn,
  #respuesta-y-evaluacion + #mostrar-btn + a {
    display: inline-block;
    width: 48%;
    margin: 0.5rem 1%;
    text-align: center;
    vertical-align: middle;
  }

  #respuesta-y-evaluacion + #mostrar-btn {
    text-align: center;
  }

  #respuesta-y-evaluacion + #mostrar-btn + a {
    text-align: center;
  }

  .position-absolute.top-0.start-0.translate-middle.badge.bg-primary {
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}

/* ==== CONTAINER-FLUID UNIVERSAL MARGINS ==== */
.container-fluid {
  margin-left: 10px;
  margin-right: 10px;
}

/* ==== NIVEL CARD ==== */
.nivel-card {
  border: 2px solid #dee2e6;
}

.learning-cards-container {
  max-width: 1200px;
  margin: 2rem auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  padding: 1rem;
}

.learning-card {
  background-color: rgba(255, 255, 255, 0.281);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  text-align: center;
  padding: 0.8rem 0.75rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.learning-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.learning-card h3 {
  font-size: 1rem;
  color: var(--color-primario);
  font-family: "Montserrat", sans-serif;
  margin-bottom: 1rem;
}

/* ==== Ajuste de imagen en la tarjeta de aprendizaje ==== */
.learning-card img {
  width: 100%;
  height: auto;
  max-height: 200px; /* Altura máxima, puedes ajustar esta medida */
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 0 0 12px 12px;
}

.learning-motivation {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 2rem;
  color: #000;
  font-family: "Montserrat", sans-serif;
}

/* Nueva regla para 2 tarjetas por fila en pantallas <=1200px */
@media (max-width: 1200px) {
  .learning-cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575px) {
  .learning-cards-container {
    grid-template-columns: 1fr !important;
    gap: 1rem;
    padding: 0.5rem;
  }

  .learning-card {
    padding: 1rem 0.75rem;
  }

  .learning-card h3 {
    font-size: 1.1rem;
  }

  .learning-motivation {
    font-size: 1.25rem;
  }
}

.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.4);
  z-index: 0;
  pointer-events: none;
}

.main-content-wrapper {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 1rem;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.row .col,
.row .col .bg-body-tertiary,
.row .col .bg-dark {
  background-color: rgba(255, 255, 255, 0.2) !important;
}

/* ==== BADGE DE NIVEL PARA PREGUNTAS TEST ==== */
.badge-nivel {
  display: inline-block;
  vertical-align: middle;
  font-size: 0.95em;
  font-weight: 600;
  border-radius: 0.7em;
  padding: 0.23em 0.85em;
  margin-left: 0.2em;
  margin-right: 0.2em;
  line-height: 1;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  border: 1px solid transparent;
}

.badge-nivel-facil {
  color: #0c5228;
  background: #e7fae9;
  border-color: #b4e5bb;
}

.badge-nivel-intermedio {
  color: #295068;
  background: #e8f3fa;
  border-color: #b1d3e5;
}

.badge-nivel-avanzado {
  color: #856404;
  background: #fff8e1;
  border-color: #ffe4a1;
}

.badge-nivel-superior {
  color: #633963;
  background: #f3e8fa;
  border-color: #d3b1e5;
}

.feedback-elegante {
  background-color: #f5f8fc;
  border-left: 5px solid #0d6efd;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  color: #333;
  line-height: 1.6;
  padding: 16px;
  margin-bottom: 20px;
}

/* ==== UX BOTÓN: GENERAR OBJETIVOS DE APRENDIZAJE (Learning Center) ==== */
#generar-objetivos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* Evita el "salto" por hover cuando está cargando o deshabilitado */
#generar-objetivos-btn[aria-busy="true"],
#generar-objetivos-btn:disabled {
  transform: none !important;
}

#generar-objetivos-btn[aria-busy="true"]:hover,
#generar-objetivos-btn:disabled:hover {
  transform: none !important;
}

/* Ajuste fino del spinner dentro del botón */
#generar-objetivos-btn .spinner-border {
  vertical-align: middle;
}

/* Mantén el ancho estable para que no cambie al pasar a "Generando..." */
#label-objetivos-btn {
  white-space: nowrap;
}
.card-correcta {
  border: 1px solid #28a745; /* verde pastel */
  background-color: #d4edda; /* fondo verde claro */
}

.card-incorrecta {
  border: 1px solid #dc3545; /* rojo pastel */
  background-color: #f8d7da; /* fondo rojo claro */
}

.card-sin-responder {
  border: 1px solid #ffc107; /* ámbar */
  background-color: #fff3cd; /* fondo ámbar claro */
}


.estructura-detalle {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 2rem;
  margin: 2rem auto;
  max-width: 900px;
  line-height: 1.75;
  font-family: Georgia, serif;
  color: #2b2d42;
}

/* =====================================================
   FULL BLEED (documento_detalle)
   Hace que .estructura-detalle ocupe todo el ancho
   manteniendo un “borde” lateral elegante.
   Se activa SOLO cuando existe la clase .full-bleed.
   ===================================================== */

.estructura-detalle.full-bleed {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

  /* margen vertical y padding lateral como “borde” */
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  padding-left: clamp(1rem, 3vw, 3.25rem);
  padding-right: clamp(1rem, 3vw, 3.25rem);
}

@media (max-width: 768px) {
  .estructura-detalle.full-bleed {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.estructura-detalle h1,
.estructura-detalle h2,
.estructura-detalle h3 {
  color: var(--color-primario);
  font-family: "Montserrat", sans-serif;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.estructura-detalle h1 {
  font-size: 1.7rem;
  border-bottom: 2px solid var(--color-primario);
  padding-bottom: 0.5rem;
}

.estructura-detalle h2 {
  font-size: 1.35rem;
  border-left: 4px solid var(--color-acento);
  padding-left: 0.75rem;
}

.estructura-detalle h3 {
  font-size: 1.1rem;
  color: var(--color-secundario);
}

.estructura-detalle p {
  margin-bottom: 1rem;
  text-align: justify;
}

.estructura-detalle ul {
  list-style: disc;
  margin: 1rem 0 1rem 2rem;
}

.estructura-detalle ol {
  list-style: decimal;
  margin: 1rem 0 1rem 2rem;
}

.estructura-detalle li {
  margin-bottom: 0.5rem;
}

.estructura-detalle blockquote {
  border-left: 4px solid var(--color-contraste);
  background-color: #f9fafb;
  padding: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #444;
}

.estructura-detalle strong {
  color: var(--color-primario);
}

.estructura-detalle em {
  color: var(--color-secundario);
}

/* =====================================================
   RENDER XML (RAG) - ESTRUCTURA PRO
   Usa atributos data-level y data-kind para indentar,
   resaltar títulos y renderizar listas de forma elegante.
   ===================================================== */

.estructura-detalle .xml-content {
  --indent-step: 1.15rem;
  --indent-max: 7;
}

/* Línea base (normalmente será un <p>) */
.estructura-detalle .xml-line {
  margin: 0.25rem 0 0.75rem;
  padding: 0.15rem 0.25rem;
  border-radius: 8px;
}

/* Respeta saltos de línea dentro del texto, sin depender de tabs */
.estructura-detalle .xml-line {
  white-space: pre-wrap;
}

/* Jerarquía por nivel (ajusta si necesitas más profundidad) */
.estructura-detalle .xml-line[data-level="1"] { padding-left: calc(var(--indent-step) * 0); }
.estructura-detalle .xml-line[data-level="2"] { padding-left: calc(var(--indent-step) * 1); }
.estructura-detalle .xml-line[data-level="3"] { padding-left: calc(var(--indent-step) * 2); }
.estructura-detalle .xml-line[data-level="4"] { padding-left: calc(var(--indent-step) * 3); }
.estructura-detalle .xml-line[data-level="5"] { padding-left: calc(var(--indent-step) * 4); }
.estructura-detalle .xml-line[data-level="6"] { padding-left: calc(var(--indent-step) * 5); }
.estructura-detalle .xml-line[data-level="7"] { padding-left: calc(var(--indent-step) * 6); }
.estructura-detalle .xml-line[data-level="8"] { padding-left: calc(var(--indent-step) * 7); }

/* Marcadores visuales suaves por nivel (mejora lectura sin recargar) */
.estructura-detalle .xml-line[data-level="2"],
.estructura-detalle .xml-line[data-level="3"] {
  background: rgba(0, 83, 119, 0.035);
}

.estructura-detalle .xml-line[data-level="4"],
.estructura-detalle .xml-line[data-level="5"] {
  background: rgba(46, 139, 87, 0.03);
}

/* Tipos de línea por “kind” (título/párrafo/lista/bloque) */
.estructura-detalle .xml-line[data-kind="h"] {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  color: var(--color-primario);
  margin-top: 1rem;
  margin-bottom: 0.6rem;
  background: rgba(0, 83, 119, 0.06);
  border-left: 4px solid var(--color-primario);
}

.estructura-detalle .xml-line[data-kind="subh"] {
  font-family: "Montserrat", sans-serif;
  font-weight: 650;
  color: var(--color-contraste);
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--color-acento);
  background: rgba(255, 200, 87, 0.16);
}

.estructura-detalle .xml-line[data-kind="p"] {
  font-family: Georgia, serif;
}

/* Lista: para items sueltos (li) sin necesidad de <ul>/<ol> reales */
.estructura-detalle .xml-line[data-kind="li"] {
  position: relative;
  padding-left: calc(var(--indent-step) * 0.6);
}

.estructura-detalle .xml-line[data-kind="li"]::before {
  content: "•";
  position: absolute;
  left: 0.25rem;
  top: 0.1rem;
  font-weight: 900;
  color: var(--color-primario);
}

/* Citas / notas */
.estructura-detalle .xml-line[data-kind="quote"] {
  border-left: 4px solid var(--color-contraste);
  background: #f9fafb;
  padding: 0.9rem 1rem;
  margin-top: 1rem;
  font-style: italic;
  color: #444;
}

/* Código o artículos (cuando quieras monospace) */
.estructura-detalle .xml-line[data-kind="code"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  background: rgba(1, 42, 74, 0.06);
  border: 1px solid rgba(1, 42, 74, 0.12);
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
  .estructura-detalle {
    padding: 1rem;
    font-size: 1rem;
  }

  .estructura-detalle h1 {
    font-size: 1.6rem;
  }

  .estructura-detalle h2 {
    font-size: 1.3rem;
  }

  .estructura-detalle h3 {
    font-size: 1.1rem;
  }
}

/* ==== ESTILO EXAMEN REALIZADO ==== */
.exam-finished-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90vh;
  background: linear-gradient(180deg, #f9fafc 0%, #eef3fa 100%);
  text-align: center;
}

.exam-finished-card {
  background-color: #ffffff;
  padding: 3rem 4rem;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  max-width: 700px;
  width: 90%;
  animation: fadeInScale 1.2s ease;
}

.exam-finished-card h2 {
  color: var(--color-primario);
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.exam-finished-card .subtext {
  color: #555;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.exam-finished-card .motivational-text {
  color: var(--color-secundario);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.exam-finished-img {
  width: 200px;
  max-width: 70%;
  animation: pulse 2s infinite ease-in-out;
}

.image-container {
  margin: 1.5rem 0;
}

.button-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.countdown {
  font-weight: 600;
  color: var(--color-acento);
  margin-top: 1.5rem;
  font-size: 1.1rem;
  animation: blink 1.2s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .exam-finished-card {
    padding: 2rem;
  }
  .exam-finished-card h2 {
    font-size: 1.7rem;
  }
  .exam-finished-img {
    width: 140px;
  }
  .button-group {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ==== ESTILOS PARA INTRO ==== */
.intro-container {
  position: relative;
  z-index: 999;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
  background: linear-gradient(180deg, #f9fafc 0%, #eef3fa 100%);
  text-align: center;
  padding: 2rem;
}

.intro-container img {
  width: 200px;
  max-width: 70%;
  animation: pulse 2s infinite ease-in-out;
  margin-bottom: 2rem;
}

.intro-container h1 {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1.3;
  color: var(--color-primario);
  margin-bottom: 0.5rem;
}

.intro-container h1 span {
  display: block;
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--color-secundario);
  margin-top: 0.25rem;
}

.intro-container p {
  font-size: 0.95rem;
  color: #555;
  max-width: 700px;
  margin: 0 auto 1.5rem;
}

.intro-container .motivational-text {
  color: var(--color-secundario);
  font-weight: 600;
  margin-bottom: 2rem;
}

.intro-container .countdown {
  font-weight: 600;
  color: var(--color-acento);
  font-size: 1.1rem;
  animation: blink 1.2s ease-in-out infinite alternate;
}

@media (max-width: 768px) {
  .intro-container h1 {
    font-size: 1.8rem;
  }

  .intro-container h1 span {
    font-size: 1.3rem;
  }

  .intro-container p {
    font-size: 1rem;
  }

  .intro-container img {
    width: 150px;
  }
}

/* ==== ESTILO TEMPORIZADOR DE EXAMEN ==== */
.exam-timer {
  font-size: 1.3rem;
  font-weight: bold;
  color: #1a73e8;
  text-align: right;
  margin-bottom: 1rem;
}

.exam-timer #time-left {
  font-weight: bold;
  color: #0d6efd;
}

/* ==== MODAL SELECCIÓN DE RANKING (ranking_examen.html) ==== */
#modalSeleccionRanking .modal-content {
  border-radius: 14px;
  border: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  background: linear-gradient(180deg, #ffffff 0%, #f9fafc 100%);
  animation: fadeInModal 0.4s ease-in-out;
}

#modalSeleccionRanking .modal-header {
  background-color: var(--color-primario);
  color: #fff;
  border-bottom: none;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  padding: 1rem 1.5rem;
  text-align: center;
}

#modalSeleccionRanking .modal-title {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
}

#modalSeleccionRanking .modal-body {
  padding: 1.5rem;
  text-align: center;
}

#modalSeleccionRanking .modal-body p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1.25rem;
}

#modalSeleccionRanking select.form-select {
  border-radius: 8px;
  border: 1px solid #ccc;
  padding: 0.75rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

#modalSeleccionRanking select.form-select:focus {
  border-color: var(--color-primario);
  box-shadow: 0 0 5px rgba(0, 83, 119, 0.3);
  outline: none;
}

#modalSeleccionRanking .modal-footer {
  border-top: none;
  padding: 1rem 1.5rem;
  justify-content: center;
}

#modalSeleccionRanking .btn-primary {
  background-color: var(--color-primario);
  border-color: var(--color-primario);
  font-weight: 600;
  border-radius: 8px;
  padding: 0.6rem 1.5rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#modalSeleccionRanking .btn-primary:hover {
  background-color: #003b57;
  transform: scale(1.05);
}

/* Animación modal */
@keyframes fadeInModal {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==== RESPONSIVE ==== */
@media (max-width: 575px) {
  #modalSeleccionRanking .modal-content {
    margin: 1rem;
  }

  #modalSeleccionRanking .modal-title {
    font-size: 1.2rem;
  }

  #modalSeleccionRanking .modal-body p {
    font-size: 0.95rem;
  }
}
/* ==== INDEX.HTML SPECIFIC STYLES ==== */

/* Tarjeta de ranking en portada */
.bloque-ranking-card {
  background-color: rgba(128, 128, 128, 0.3);
  border: none !important;
  border-radius: 1rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* Destacado de estadísticas del sistema */
.system-stats-highlight {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

.system-stats-highlight:hover {
  transform: scale(1.01);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
}

/* ==== WIDGET COMPITE (CORRECCIÓN DE FONDO TRANSLÚCIDO) ==== */
.ranking-competition-card {
  background: none; /* Elimina fondo blanco translúcido */
  border-radius: 1.25rem;
  box-shadow: none;
  max-width: 680px;
  margin: 0 auto 2rem auto;
  position: relative;
  z-index: 2;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  transition: all 0.3s ease;
}

/* ==== AJUSTE DE FONDO LEGIBLE PARA WIDGET COMPITE ==== */
.ranking-competition-card .ranking-inner {
  background: rgba(255, 255, 255, 0.85); /* Blanco casi translúcido */
  border-radius: 1.25rem;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 1.75rem 2rem;
  color: #111; /* mejora contraste de texto */
}

/* Hover solo sobre el contenido interno */
.ranking-competition-card .ranking-inner:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* Mantiene altura uniforme con widget Oposiciones */
.ranking-competition-card,
.widget-oposiciones {
  min-height: 480px;
}

.ranking-competition-card h4 {
  font-size: 1.45rem;
  line-height: 1.3;
  font-weight: 700;
  color: #003b57;
  margin-bottom: 1.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Contenedor de lista */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.2rem;
}

/* Fila individual del ranking */
.ranking-item {
  display: grid;
  grid-template-columns: 40px 1fr 80px 90px;
  align-items: center;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease-in-out;
}

.ranking-item:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.rank-position {
  font-size: 1.4rem;
  font-weight: bold;
}

.rank-name {
  font-weight: 600;
  font-size: 0.96rem;
  color: #1a1a1a;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-score {
  font-weight: 700;
  font-size: 0.95rem;
  color: #003b57;
  text-align: right;
}

.rank-time {
  font-size: 0.9rem;
  color: #444;
  text-align: right;
  font-weight: 500;
}

/* Colores por posición */
.ranking-item.gold {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.25), rgba(255, 215, 0, 0.15));
}
.ranking-item.silver {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.25), rgba(192, 192, 192, 0.15));
}
.ranking-item.bronze {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.25), rgba(205, 127, 50, 0.15));
}

/* Animación de aparición */
.ranking-item {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.45s ease forwards;
}
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Botones del widget */
.ranking-competition-card .btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.55rem 1.4rem;
  font-size: 0.95rem;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
  .ranking-competition-card {
    max-width: 95%;
    padding: 1.25rem;
  }

  .ranking-competition-card h4 {
    white-space: normal;
    font-size: 1.2rem;
  }

  .ranking-item {
    grid-template-columns: 32px 1fr 60px;
    padding: 0.4rem 0.6rem;
  }

  .rank-position {
    font-size: 1.1rem;
  }

  .rank-name {
    font-size: 0.9rem;
  }

  .rank-score,
  .rank-time {
    font-size: 0.85rem;
  }
}
/* ==== OPACIDAD REDUCIDA SOLO EN EL FONDO DEL BLOQUE TRUSTPILOT ==== */
.opiniones-container {
  background-color: rgba(255, 255, 255, 0.65); /* Blanco translúcido */
  -webkit-backdrop-filter: blur(4px); /* Soporta Safari/iOS */
  backdrop-filter: blur(4px); /* Suaviza el fondo detrás */
  border-radius: 10px;
  padding: 2rem;
  transition: background-color 0.3s ease-in-out;
}

.opiniones-container:hover {
  background-color: rgba(255, 255, 255, 0.85);
}

/* ==== WIDGET OPOSICIONES (VERSIÓN FINAL UX/UI) ==== */
.widget-oposiciones {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.85);
  height: 100%;
  min-height: 480px; /* Igual que el widget Compite */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-top: 0;
}

.widget-oposiciones:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ==== AJUSTE DE PROPORCIÓN DEL VIDEO (3X ANCHO) ==== */
.widget-oposiciones .widget-video {
  flex: 2.8; /* reducido un 10% respecto a la versión anterior */
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
}

.widget-oposiciones .video-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.widget-oposiciones .overlay-text {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: rgba(0, 83, 119, 0.5);
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  line-height: 1.4;
}

.widget-oposiciones .overlay-text h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.widget-oposiciones .overlay-text p {
  font-size: 1.1rem;
  margin: 0;
}

/* Ajuste para mantener la misma altura visual que el widget Compite */
.widget-oposiciones,
.widget-oposiciones .widget-video {
  min-height: 480px;
  height: 100%;
}

/* ==== CUADRÍCULA DE OPOSICIONES ==== */
.widget-oposiciones .widget-grid {
  flex: 1.2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: stretch;
}

.widget-oposiciones .grid-item {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  white-space: nowrap;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0.4);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Colores corporativos equilibrados */
.item-bomberos {
  background-color: #004c70;
  color: #fff;
}
.item-policia {
  background-color: #6a4ff5;
  color: #fff;
}
.item-justicia {
  background-color: #ffcc4d;
  color: #222;
}
.item-sanidad {
  background-color: #ff6b6b;
  color: #222;
}

.widget-oposiciones .grid-item:hover {
  filter: brightness(1.1);
  transform: scale(1.03);
}

/* ==== RESPONSIVE ==== */
@media (max-width: 992px) {
  .widget-oposiciones {
    flex-direction: column;
    height: auto;
  }

  .widget-oposiciones .widget-video {
    height: 250px;
  }

  .widget-oposiciones .overlay-text {
    font-size: 1rem;
    padding: 0.75rem;
  }

  .widget-oposiciones .grid-item {
    font-size: 1rem;
  }
}
/* ==== CENTRADO HORIZONTAL DEL BLOQUE DE WIDGETS ==== */
.home-widgets-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start; /* No centra el contenido interno */
  justify-content: center; /* Centra el bloque de widgets en horizontal */
  gap: clamp(1.5rem, 4vw, 5rem); /* Separación fluida entre ambos widgets */
  width: 100%;
  max-width: 1600px;
  margin: 0 auto; /* Centra el bloque respecto al viewport */
  padding-left: 30px; /* margen izquierdo total */
  padding-right: 30px; /* margen derecho total */
}

/* Asegura que el contenido de cada widget no se centre por herencia */
.home-widgets-container .widget-oposiciones,
.home-widgets-container .ranking-competition-card {
  align-items: stretch;
  flex: 1;
  min-height: 480px;
  height: auto;
}

/* Ajuste responsive: apila manteniendo centrado del bloque, sin cambiar contenidos internos */
@media (max-width: 992px) {
  .home-widgets-container {
    flex-direction: column;
    align-items: center;
    padding-left: 16px;
    padding-right: 16px;
    gap: 1.5rem;
  }

  .home-widgets-container .widget-oposiciones,
  .home-widgets-container .ranking-competition-card {
    margin: 0;
    width: 90%;
  }
}
/* ==== CORRECCIÓN RENDERIZADO DEL VIDEO AL REDIMENSIONAR ==== */
/* (Regla duplicada eliminada, ver definición principal arriba) */

/* Fuerza el video a mantenerse visible y recalcular al cambiar el tamaño */
.widget-oposiciones .video-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transition: opacity 0.3s ease;
}

/* Evita el fondo blanco o gris cuando el video se colapsa */
.widget-oposiciones .widget-video:empty {
  background-color: transparent !important;
}

/* Recalcula al volver a layout horizontal */
@media (min-width: 993px) {
  .widget-oposiciones {
    flex-direction: row !important;
  }
  .widget-oposiciones .widget-video {
    height: auto !important;
    min-height: 480px !important;
  }
}
/* ==== ESTILOS PREMIUM PARA FORMULARIOS DE ADMINISTRACIÓN (REGISTRAR OPOSICIÓN) ==== */

.form-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primario);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-family: "Montserrat", sans-serif;
  letter-spacing: 0.3px;
}

.form-divider {
  height: 2px;
  background: linear-gradient(to right, var(--color-primario), transparent);
  border: none;
  margin: 2rem 0 1.5rem;
  opacity: 0.4;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.form-field {
  background: #ffffff;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
}

.form-field:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid #d1d9e6;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--color-primario);
  outline: none;
  box-shadow: 0 0 6px rgba(0, 83, 119, 0.3);
}

.form-label-premium {
  font-weight: 600;
  color: var(--color-contraste);
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  display: block;
  letter-spacing: 0.2px;
  font-family: "Montserrat", sans-serif;
}

.btn-primary-premium {
  background: var(--color-primario);
  border-color: var(--color-primario);
  padding: 0.75rem 1.8rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
}

.btn-primary-premium:hover {
  background: #003b57;
  border-color: #00324a;
  transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 768px) {
  .form-grid-3,
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}
/* ==== TARJETAS PREMIUM DE OPOSICIONES ==== */

.op-card-premium {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.op-card-premium:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
}

.op-card-image-wrapper {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #f3f6f8;
  display: flex;
  justify-content: center;
  align-items: center;
}

.op-card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  transition: transform 0.3s ease;
}

.op-card-premium:hover .op-card-image {
  transform: scale(1.05);
}

.op-card-content {
  padding: 1.2rem 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.op-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primario);
  font-family: "Montserrat", sans-serif;
  margin-bottom: 0.5rem;
  text-align: center;
}

.op-card-description {
  font-size: 0.9rem;
  color: #555;
  text-align: center;
  margin-bottom: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

.op-card-btn {
  margin-top: auto;
  align-self: center;
  width: 100%;
  text-align: center;
  border-radius: 10px;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.exam-card-premium {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.exam-card-premium:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
}

.exam-card-header {
  background: linear-gradient(135deg, var(--color-primario), #003b57);
  color: #ffffff;
  padding: 1rem 1.25rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.4px;
  text-align: center;
}

.exam-card-body {
  padding: 1.2rem 1.4rem;
  flex: 1;
}

.exam-card-description {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 1rem;
  text-align: center;
  line-height: 1.45;
}

.exam-meta-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.exam-meta-item {
  background: #f7f9fb;
  border-radius: 10px;
  padding: 0.75rem;
  border: 1px solid #e1e7ef;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-contraste);
  font-family: "Montserrat", sans-serif;
}

.exam-status-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.exam-status-active {
  background: #d4edda;
  color: #155724;
  border: 1px solid #b7dfb9;
}

.exam-status-closed {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #e3b5ba;
}

.exam-status-upcoming {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffe7a8;
}

.exam-card-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.exam-btn {
  padding: 0.55rem 1.3rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.exam-btn-edit {
  background-color: var(--color-primario);
  color: white;
  border: 1px solid var(--color-primario);
}

.exam-btn-edit:hover {
  background-color: #003b57;
  transform: translateY(-3px);
}

.exam-btn-view {
  background-color: #ffc857;
  border: 1px solid #e2b44e;
  color: #222;
}

.exam-btn-view:hover {
  background-color: #e2b44e;
  transform: translateY(-3px);
}

.exam-btn-danger {
  background-color: #dc3545;
  border: 1px solid #c82333;
  color: white;
}

.exam-btn-danger:hover {
  background-color: #bd2130;
  transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 768px) {
  .exam-meta-box {
    grid-template-columns: 1fr;
  }
  .exam-card-premium {
    margin-bottom: 1rem;
  }
}
.btn-oposipro {
  background-color: #4b3fa4;
  color: #fff;
  border: none;
}

.btn-oposipro:hover {
  background-color: #372e7d;
  color: #fff;
}

.btn-oposipro-outline {
  background-color: transparent;
  border: 2px solid #4b3fa4;
  color: #4b3fa4;
}

.btn-oposipro-outline:hover {
  background-color: #4b3fa4;
  color: white;
}
/* ============================================
   CARD PREMIUM OPOSIPRO
   Diseño coherente con tus páginas de planes,
   cintas diagonales, sombras suaves, borde limpio,
   animación sutil y tipografía Montserrat.
=============================================== */

.card-premium {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(0, 83, 119, 0.18); /* azul premium muy suave */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 2rem 2.2rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

/* Hover suave estilo premium */
.card-premium:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* Título Premium */
.card-premium-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--color-primario);
  margin-bottom: 1rem;
  text-align: center;
}

/* Subtítulo */
.card-premium-subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: #555;
  margin-top: -0.4rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Contenido interno */
.card-premium-content {
  font-size: 0.95rem;
  font-family: "Inter", sans-serif;
  color: #333;
  line-height: 1.55;
}

/* Etiquetas de formulario premium */
.card-premium label {
  font-weight: 600;
  color: var(--color-contraste);
  margin-bottom: 0.35rem;
  display: block;
  font-family: "Montserrat", sans-serif;
}

/* Inputs premium */
.card-premium input,
.card-premium select,
.card-premium textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #d1d9e6;
  transition: all 0.25s ease;
  font-size: 0.95rem;
}

.card-premium input:focus,
.card-premium select:focus,
.card-premium textarea:focus {
  border-color: var(--color-primario);
  outline: none;
  box-shadow: 0 0 5px rgba(0, 83, 119, 0.25);
}

/* Botón Premium */
.card-premium .btn-premium {
  width: 100%;
  padding: 0.85rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  background: var(--color-primario);
  color: #fff;
  letter-spacing: 0.3px;
  font-family: "Montserrat", sans-serif;
  transition: background 0.25s ease, transform 0.2s ease;
  margin-top: 1.5rem;
}

.card-premium .btn-premium:hover {
  background: #003b57;
  transform: translateY(-3px);
}

/* Cinta diagonal opcional (Premium Extra) */
.card-premium-ribbon {
  position: absolute;
  top: 20px;
  left: -36px;
  transform: rotate(-45deg);
  background: var(--color-acento);
  color: #111;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 45px;
  border-radius: 4px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}
.quiz-background {
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
  padding-top: 20px;
  padding-bottom: 20px;
}

.quiz-overlay {
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  background: rgba(255, 255, 255, 0.5);
  min-height: 100%;
  width: 100%;
  padding-top: 0.1px;
  padding-bottom: 0.1px;
}

/* Resalta visualmente que la Agenda está activa */
.learning-card-agenda {
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.learning-card-agenda:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.3);
}

/* Tooltip sencillo usando title ya existe, pero puedes hacer algo más custom: */
.learning-card-agenda::after {
  content: "Agenda de estudio";
  position: absolute;
  left: 50%;
  bottom: -1.8rem;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.learning-card-agenda:hover::after {
  opacity: 1;
}
/* --- Modal descripción oposición (temario_listado) --- */
#opDescModal .op-desc-modal-dialog {
  max-width: 900px; /* el ancho ya te encaja; ajustable */
}

#opDescModal .op-desc-modal-content {
  border-radius: 14px;
}

/* Más “rectangular”: altura garantizada aunque el texto sea corto */
#opDescModal .op-desc-modal-body {
  min-height: 45vh;
  max-height: 70vh;
  overflow-y: auto;
  padding: 20px 22px;
}

/* Evitar scroll horizontal y que parezca consola */
#opDescModal .op-desc-modal-pre {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.55;
}