/* =============================================================================
   FLU - SISTEMA NATIVO DE PÁGINAS LEGALES, CONFIANZA Y CENTRO DE AYUDA
   Integrado 100% con custom-styles.css, base-shell.css y el sistema de temas Flu
   ============================================================================= */

/* Variables y compatibilidad con el ecosistema Flu */
:root {
  --flu-legal-toc-top: 90px;
  --flu-legal-card-radius: 18px;
  --flu-legal-card-border: rgba(255, 255, 255, 0.1);
  --flu-legal-card-border-focus: rgba(var(--brand-color-dark-rgb, 187, 134, 252), 0.5);
  --flu-legal-toc-bg: var(--card-bg-dark, #2a2a2a);
  --flu-legal-toc-hover: rgba(255, 255, 255, 0.05);
  --flu-legal-active-pill: rgba(var(--brand-color-dark-rgb, 187, 134, 252), 0.15);
  --flu-legal-callout-bg: rgba(var(--brand-color-dark-rgb, 187, 134, 252), 0.08);
  --flu-legal-callout-border: rgba(var(--brand-color-dark-rgb, 187, 134, 252), 0.35);
  --flu-legal-code-bg: rgba(255, 255, 255, 0.08);
  --flu-legal-code-text: #ffffff;
}

body.light-mode {
  --flu-legal-card-border: rgba(0, 0, 0, 0.09);
  --flu-legal-card-border-focus: rgba(var(--brand-color-light-rgb, 225, 48, 108), 0.5);
  --flu-legal-toc-bg: var(--card-bg-light, #ffffff);
  --flu-legal-toc-hover: rgba(0, 0, 0, 0.035);
  --flu-legal-active-pill: rgba(var(--brand-color-light-rgb, 225, 48, 108), 0.1);
  --flu-legal-callout-bg: rgba(var(--brand-color-light-rgb, 225, 48, 108), 0.06);
  --flu-legal-callout-border: rgba(var(--brand-color-light-rgb, 225, 48, 108), 0.3);
  --flu-legal-code-bg: rgba(0, 0, 0, 0.06);
  --flu-legal-code-text: var(--text-light, #212529);
}

/* Encabezados y tipografía nativa */
.flu-page-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.flu-page-title {
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.flu-page-subtitle {
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 1.05rem;
  color: rgba(var(--text-dark-rgb, 255, 255, 255), 0.75);
  max-width: 680px;
  margin: 0 auto;
}

body.light-mode .flu-page-subtitle {
  color: rgba(var(--text-light-rgb, 33, 37, 41), 0.75);
}

.flu-page-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: "Nunito", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--flu-legal-active-pill);
  color: var(--brand-color-dark, #bb86fc);
  border: 1px solid var(--flu-legal-callout-border);
  margin-bottom: 12px;
}

body.light-mode .flu-page-badge {
  color: var(--brand-color-light, #E1306C);
}

/* Tarjeta principal nativa Flu */
.flu-card {
  background-color: var(--card-bg-dark, #2a2a2a);
  border: 1px solid var(--flu-legal-card-border);
  border-radius: var(--flu-legal-card-radius);
  box-shadow: var(--card-shadow-dark, 0 8px 24px rgba(0, 0, 0, 0.3));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.light-mode .flu-card {
  background-color: var(--card-bg-light, #ffffff);
  border-color: var(--flu-legal-card-border);
  box-shadow: var(--card-shadow-light, 0 8px 24px rgba(0, 0, 0, 0.06));
}

/* Sticky TOC Sidebar */
.col-lg-3:has(.flu-sticky-toc),
.flu-sticky-toc-col {
  align-self: stretch;
}

.flu-sticky-toc {
  position: -webkit-sticky;
  position: sticky;
  top: var(--flu-legal-toc-top, 90px);
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  z-index: 10;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

body.light-mode .flu-sticky-toc {
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.flu-sticky-toc::-webkit-scrollbar {
  width: 4px;
}

.flu-sticky-toc::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

body.light-mode .flu-sticky-toc::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

.flu-toc-card {
  padding: 1.25rem 1rem;
}

.flu-toc-heading {
  font-family: "Nunito", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(var(--text-dark-rgb, 255, 255, 255), 0.55);
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

body.light-mode .flu-toc-heading {
  color: rgba(var(--text-light-rgb, 33, 37, 41), 0.55);
}

.flu-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.flu-toc-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-family: "Nunito", sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(var(--text-dark-rgb, 255, 255, 255), 0.75);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.35;
}

body.light-mode .flu-toc-link {
  color: rgba(var(--text-light-rgb, 33, 37, 41), 0.75);
}

.flu-toc-link:hover {
  color: var(--text-dark, #ffffff);
  background-color: var(--flu-legal-toc-hover);
}

body.light-mode .flu-toc-link:hover {
  color: var(--text-light, #212529);
  background-color: var(--flu-legal-toc-hover);
}

.flu-toc-link.active {
  color: var(--brand-color-dark, #bb86fc);
  background-color: var(--flu-legal-active-pill);
  border-left-color: var(--brand-color-dark, #bb86fc);
  font-weight: 600;
}

body.light-mode .flu-toc-link.active {
  color: var(--brand-color-light, #E1306C);
  border-left-color: var(--brand-color-light, #E1306C);
}

/* Artículo de lectura legal */
.flu-article-header {
  border-bottom: 1px solid var(--flu-legal-card-border);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.flu-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: rgba(var(--text-dark-rgb, 255, 255, 255), 0.65);
  margin-top: 0.75rem;
}

body.light-mode .flu-article-meta {
  color: rgba(var(--text-light-rgb, 33, 37, 41), 0.65);
}

.flu-legal-section {
  scroll-margin-top: 100px;
  margin-bottom: 2.5rem;
}

.flu-legal-section h2 {
  font-family: "Nunito", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark, #ffffff);
  margin-bottom: 1rem;
  padding-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.light-mode .flu-legal-section h2 {
  color: var(--text-light, #212529);
}

.flu-legal-section h3 {
  font-family: "Nunito", sans-serif;
  font-size: 1.1rem;
  font-weight: 650;
  color: var(--brand-color-dark, #bb86fc);
  margin: 1.5rem 0 0.75rem;
}

body.light-mode .flu-legal-section h3 {
  color: var(--brand-color-light, #E1306C);
}

.flu-legal-section p,
.flu-legal-section li {
  font-family: "Nunito", sans-serif;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(var(--text-dark-rgb, 255, 255, 255), 0.88);
}

body.light-mode .flu-legal-section p,
body.light-mode .flu-legal-section li {
  color: rgba(var(--text-light-rgb, 33, 37, 41), 0.88);
}

.flu-legal-section ul,
.flu-legal-section ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.flu-legal-section li {
  margin-bottom: 0.5rem;
}

/* Callouts y Bloques de Advertencia */
.flu-callout {
  background: var(--flu-legal-callout-bg);
  border: 1px solid var(--flu-legal-callout-border);
  border-left: 4px solid var(--brand-color-dark, #bb86fc);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

body.light-mode .flu-callout {
  border-left-color: var(--brand-color-light, #E1306C);
}

.flu-callout strong {
  color: var(--brand-color-dark, #bb86fc);
}

body.light-mode .flu-callout strong {
  color: var(--brand-color-light, #E1306C);
}

.flu-callout-success {
  background: rgba(40, 167, 69, 0.08);
  border-color: rgba(40, 167, 69, 0.3);
  border-left-color: #28a745;
}

.flu-callout-success strong {
  color: #28a745;
}

.flu-callout-warning {
  background: rgba(255, 193, 7, 0.08);
  border-color: rgba(255, 193, 7, 0.3);
  border-left-color: #ffc107;
}

.flu-callout-warning strong {
  color: #ffc107;
}

/* Badges para elementos de interfaz */
.flu-ui-chip {
  display: inline-block;
  background: var(--flu-legal-code-bg);
  color: var(--flu-legal-code-text);
  font-family: "Nunito", monospace, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--flu-legal-card-border);
}

/* Bento Grid de Ayuda y Confianza */
.flu-bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1.25rem;
  margin: 2rem 0 3rem;
}

.flu-bento-card {
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.flu-bento-card:hover {
  transform: translateY(-3px);
  border-color: var(--flu-legal-card-border-focus);
}

.flu-bento-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--flu-legal-active-pill);
  color: var(--brand-color-dark, #bb86fc);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

body.light-mode .flu-bento-icon {
  color: var(--brand-color-light, #E1306C);
}

.flu-bento-title {
  font-family: "Nunito", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark, #ffffff);
  margin-bottom: 0.4rem;
}

body.light-mode .flu-bento-title {
  color: var(--text-light, #212529);
}

.flu-bento-desc {
  font-family: "Nunito", sans-serif;
  font-size: 0.88rem;
  color: rgba(var(--text-dark-rgb, 255, 255, 255), 0.7);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

body.light-mode .flu-bento-desc {
  color: rgba(var(--text-light-rgb, 33, 37, 41), 0.7);
}

.flu-bento-link {
  font-family: "Nunito", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-color-dark, #bb86fc);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body.light-mode .flu-bento-link {
  color: var(--brand-color-light, #E1306C);
}

/* Buscador de Ayuda */
.flu-search-box {
  max-width: 600px;
  margin: 1.75rem auto 0;
  position: relative;
}

.flu-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--card-bg-dark, #2a2a2a);
  border: 1px solid var(--flu-legal-card-border);
  border-radius: 999px;
  padding: 10px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

body.light-mode .flu-search-bar {
  background-color: var(--card-bg-light, #ffffff);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.flu-search-bar:focus-within {
  border-color: var(--brand-color-dark, #bb86fc);
  box-shadow: 0 0 0 0.25rem rgba(var(--brand-color-dark-rgb, 187, 134, 252), 0.25);
}

body.light-mode .flu-search-bar:focus-within {
  border-color: var(--brand-color-light, #E1306C);
  box-shadow: 0 0 0 0.25rem rgba(var(--brand-color-light-rgb, 225, 48, 108), 0.25);
}

.flu-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: "Nunito", sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark, #ffffff);
}

body.light-mode .flu-search-input {
  color: var(--text-light, #212529);
}

.flu-search-input::placeholder {
  color: rgba(var(--text-dark-rgb, 255, 255, 255), 0.5);
}

body.light-mode .flu-search-input::placeholder {
  color: rgba(var(--text-light-rgb, 33, 37, 41), 0.5);
}

/* Acordeón de preguntas frecuentes */
.flu-faq-category {
  margin-bottom: 3rem;
  scroll-margin-top: 100px;
}

.flu-faq-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--flu-legal-card-border);
}

.flu-faq-category-header h2 {
  font-family: "Nunito", sans-serif;
  font-size: 1.35rem;
  font-weight: 750;
  margin: 0;
  color: var(--text-dark, #ffffff);
}

body.light-mode .flu-faq-category-header h2 {
  color: var(--text-light, #212529);
}

.flu-faq-item {
  margin-bottom: 0.85rem;
  overflow: hidden;
}

.flu-faq-question {
  padding: 1.1rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: "Nunito", sans-serif;
  font-size: 0.96rem;
  font-weight: 650;
  color: var(--text-dark, #ffffff);
  user-select: none;
  gap: 1rem;
}

body.light-mode .flu-faq-question {
  color: var(--text-light, #212529);
}

.flu-faq-toggle-icon {
  font-size: 0.85rem;
  color: rgba(var(--text-dark-rgb, 255, 255, 255), 0.5);
  transition: transform 0.2s ease;
}

body.light-mode .flu-faq-toggle-icon {
  color: rgba(var(--text-light-rgb, 33, 37, 41), 0.5);
}

.flu-faq-item.is-open .flu-faq-toggle-icon {
  transform: rotate(180deg);
  color: var(--brand-color-dark, #bb86fc);
}

body.light-mode .flu-faq-item.is-open .flu-faq-toggle-icon {
  color: var(--brand-color-light, #E1306C);
}

.flu-faq-answer {
  display: none;
  padding: 0 1.35rem 1.35rem;
  font-family: "Nunito", sans-serif;
  font-size: 0.93rem;
  line-height: 1.65;
  color: rgba(var(--text-dark-rgb, 255, 255, 255), 0.82);
}

body.light-mode .flu-faq-answer {
  color: rgba(var(--text-light-rgb, 33, 37, 41), 0.82);
}

.flu-faq-item.is-open .flu-faq-answer {
  display: block;
}

/* Tarjeta de soporte / acción final */
.flu-action-card {
  padding: 1.75rem 2rem;
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .flu-action-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.flu-action-card h3 {
  font-family: "Nunito", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.flu-action-card p {
  font-family: "Nunito", sans-serif;
  font-size: 0.9rem;
  color: rgba(var(--text-dark-rgb, 255, 255, 255), 0.7);
  margin: 0;
}

body.light-mode .flu-action-card p {
  color: rgba(var(--text-light-rgb, 33, 37, 41), 0.7);
}
