/* Portal público de convocatorias — AURA. Capa visual propia, independiente de app.css (que
   es del wizard interno) — reusa solo el azul de marca. */

:root {
  --portal-accent: #2563eb;
  --portal-accent-dark: #1d4ed8;
  --portal-text: #111827;
  --portal-muted: #6b7280;
  --portal-border: #e5e7eb;
  --portal-bg: #ffffff;
  --portal-dark: #0f172a;
}

* {
  box-sizing: border-box;
}

/* SIN overflow-x en html/body — cualquier valor que no sea "visible" (hidden, clip, auto...)
   convierte a html/body en scroll/clip container, y eso rompe `position: sticky` de
   cualquier descendiente en todo el sitio (bug real detectado y confirmado con las tres
   variantes: .dash-sidebar-cta dejaba de pegarse al hacer scroll con cualquiera de las tres).
   El overflow horizontal se controla en el elemento puntual que lo cause, no acá. */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--portal-text);
  background: var(--portal-bg);
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}

/* ---- Nav ---- */
.portal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 30px;
  border-bottom: 1px solid var(--portal-border);
  position: relative;
}

.portal-logo {
  font-size: 18px;
  font-weight: 800;
}

.portal-logo span {
  color: var(--portal-accent);
}

.portal-nav-links {
  display: flex;
  gap: 30px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--portal-text);
}

.portal-nav-links a:hover,
.portal-nav-links a.active {
  color: var(--portal-accent);
}

.portal-nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13.5px;
}

.portal-btn-dark {
  background: var(--portal-text);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
}

.portal-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.portal-nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--portal-text);
  border-radius: 2px;
}

/* ---- Hero ---- */
.portal-hero {
  position: relative;
  text-align: center;
  padding: 70px 30px 50px;
  background: radial-gradient(ellipse at top, #eef4ff 0%, #ffffff 60%);
  overflow: hidden;
}

.portal-hero-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--portal-muted);
  background: #f3f4f6;
  border-radius: 999px;
  padding: 6px 16px;
  margin-bottom: 18px;
}

.portal-hero h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 14px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.portal-hero h1 span {
  color: var(--portal-accent);
}

.portal-hero p {
  color: var(--portal-muted);
  font-size: 14.5px;
  max-width: 520px;
  margin: 0 auto 34px;
}

.portal-hero-blob {
  width: 220px;
  height: 220px;
  /* margin-top da espacio para la foto (el doble de su tamaño original) — sin esto se monta
     sobre el título de arriba, ya que la imagen sobresale del círculo hacia arriba. */
  margin: 220px auto 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe 60%, #93c5fd);
  position: relative;
  overflow: visible;
}

/* La imagen se ve COMPLETA, sin recortar — pedido explícito del owner: el círculo queda
   solo como fondo decorativo detrás, la foto entera se sobrepone y sobresale de él. */
.portal-hero-photo {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  max-width: none;
  height: auto;
  display: block;
}

.portal-dot {
  position: absolute;
  border-radius: 50%;
  opacity: .85;
}

@media (max-width: 480px) {
  .portal-hero-blob {
    width: 190px;
    height: 190px;
    margin-top: 130px;
  }

  .portal-hero-photo {
    width: 520px;
    max-width: 92vw;
  }
}

/* ---- Panel de filtros ---- */
.portal-filtros {
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--portal-border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, .08);
  padding: 22px;
  text-align: left;
}

.portal-filtros-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 20px;
}

.portal-filtro-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.portal-filtro-field label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--portal-muted);
}

.portal-filtro-field input,
.portal-filtro-field select,
.portal-filtro-field textarea {
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13.5px;
  color: var(--portal-text);
  background: #fff;
  font-family: inherit;
  width: 100%;
}

.portal-filtro-field textarea {
  resize: vertical;
  min-height: 90px;
}

.portal-filtro-field input:focus,
.portal-filtro-field select:focus,
.portal-filtro-field textarea:focus {
  outline: none;
  border-color: var(--portal-accent);
}

.portal-filtros-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.portal-search-btn {
  background: var(--portal-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 32px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.portal-search-btn:hover {
  background: var(--portal-accent-dark);
}

@media (max-width: 760px) {
  .portal-filtros-grid {
    grid-template-columns: 1fr;
  }

  .portal-hero-blob {
    margin-top: 150px;
  }

  .portal-hero-photo {
    width: 90vw;
    max-width: 520px;
  }
}

/* ---- Resultados: uno por línea ---- */
.portal-results {
  max-width: 980px;
  margin: 0 auto;
  padding: 50px 30px 80px;
}

.portal-results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-results-header h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}

.portal-results-count {
  color: var(--portal-muted);
  font-size: 13px;
}

.portal-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.portal-card {
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: box-shadow .15s ease, transform .15s ease;
}

.portal-card:hover {
  box-shadow: 0 8px 24px rgba(17, 24, 39, .08);
  transform: translateY(-2px);
}

.portal-card-avatar {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--portal-accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-card-main {
  flex: 1 1 auto;
  min-width: 0;
}

.portal-card-entidad {
  font-size: 12px;
  color: var(--portal-muted);
  font-weight: 600;
}

.portal-card-titulo {
  font-size: 15px;
  font-weight: 700;
  margin: 2px 0 8px;
}

.portal-card-desc {
  font-size: 12.5px;
  color: var(--portal-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.portal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.portal-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--portal-accent);
  background: #eff6ff;
  border-radius: 999px;
  padding: 4px 11px;
  white-space: nowrap;
}

.portal-card-side {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.portal-card-codigo {
  font-size: 11px;
  color: var(--portal-muted);
  white-space: nowrap;
}

.portal-card-link {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: var(--portal-accent);
  padding: 8px 18px;
  border-radius: 999px;
  white-space: nowrap;
}

.portal-card-link:hover {
  background: var(--portal-accent-dark);
}

@media (max-width: 640px) {
  .portal-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-card-side {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: space-between;
  }
}

.portal-empty {
  text-align: center;
  color: var(--portal-muted);
  font-size: 13.5px;
  padding: 60px 10px;
}

/* ---- Páginas simples (placeholder) ---- */
.portal-page-simple {
  max-width: 100%;
  margin: 0 auto;
  padding: 30px;
  text-align: justify;
}

.portal-page-simple h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 16px;
}

.portal-page-simple p {
  color: var(--portal-muted);
  font-size: 14px;
  line-height: 1.7;
}

/* ---- Documentos legales versionados (Términos, Condiciones de servicio, Tratamiento de
   datos) — mismo contenedor .portal-page-simple, con la etiqueta de versión + fecha y el
   contenido HTML del documento publicado (ver legal_documentos, LegalDocumentRepository). */
.portal-legal-meta {
  align-items: center;
  gap: 8px;
  color: #999;
  font-size: 12px;
  font-weight: 600;
  margin-top: -10px;
  margin-bottom: 28px;
}

.portal-legal-content h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--portal-text);
  margin: 34px 0 10px;
}

.portal-legal-content h2:first-child {
  margin-top: 0;
}

.portal-legal-content p {
  color: var(--portal-muted);
  font-size: 14px;
  line-height: 1.75;
  margin: 0 0 14px;
}

.portal-legal-content strong {
  color: var(--portal-text);
}

.portal-legal-not-found {
  color: var(--portal-muted);
  font-size: 14px;
  padding: 30px 0;
}

/* ---- Preguntas frecuentes (menú acordeón) — <details>/<summary> nativos, sin JS: cada
   pregunta se expande/colapsa sola, sin necesidad de listeners ni de romper la ausencia de
   jQuery en las páginas simples del portal. Sección propia (no .portal-page-simple): pedido
   explícito del owner — cada item debe ocupar el 100% del ancho disponible, no la columna de
   lectura angosta (760px) que sí quiere el texto legal de Términos/Condiciones/Tratamiento. */
.portal-faq-section {
  padding: 20px 4px 60px;
}

.portal-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.portal-faq-item {
  border: 1px solid var(--portal-border);
  border-radius: 10px;
  padding: 4px 18px;
  background: #fff;
}

.portal-faq-question {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--portal-text);
}

.portal-faq-question::-webkit-details-marker {
  display: none;
}

.portal-faq-question .portal-faq-chevron {
  flex-shrink: 0;
  transition: transform .15s ease;
  color: var(--portal-accent);
}

.portal-faq-item[open] .portal-faq-chevron {
  transform: rotate(180deg);
}

.portal-faq-answer {
  color: var(--portal-muted);
  font-size: 13.5px;
  line-height: 1.7;
  padding: 0 0 18px;
}

/* ---- Footer ---- */
.portal-footer {
  background: var(--portal-dark);
  color: #cbd5e1;
  padding: 50px 30px 20px;
  margin-top: 40px;
}

.portal-footer-top {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.portal-footer-brand p {
  font-size: 13px;
  color: #94a3b8;
  margin: 10px 0 0;
  max-width: 220px;
}

.portal-footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-footer-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.portal-footer-col a {
  font-size: 13px;
  color: #cbd5e1;
}

.portal-footer-col a:hover {
  color: #fff;
}

.portal-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: #04220f;
  font-weight: 700;
  font-size: 12.5px;
  padding: 9px 16px;
  border-radius: 6px;
  width: fit-content;
}

.portal-whatsapp-btn:hover {
  background: #1fb855;
}

.portal-footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 18px;
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 760px) {
  .portal-footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .portal-footer-top {
    grid-template-columns: 1fr;
  }
}

/* ---- Nav responsive ---- */
@media (max-width: 860px) {
  .portal-nav-toggle {
    display: flex;
  }

  .portal-nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--portal-border);
    flex-direction: column;
    gap: 0;
    display: none;
    z-index: 20;
  }

  .portal-nav-links.open {
    display: flex;
  }

  .portal-nav-links a {
    padding: 14px 30px;
    border-top: 1px solid var(--portal-border);
  }

  .portal-hero h1 {
    font-size: 30px;
  }
}

@media (max-width: 480px) {
  .portal-nav-actions .portal-btn-dark {
    padding: 9px 16px;
    font-size: 12px;
  }

  /* padding izq/der se mantiene en 30px en todos los tamaños — pedido explícito del owner,
     solo se reduce el vertical en pantallas chicas. */
  .portal-hero {
    padding: 50px 30px 40px;
  }

  .portal-results {
    padding: 40px 30px 60px;
  }

  .portal-filtros {
    padding: 16px;
  }
}