/* ==========================================================================
   Buscador Oficial de Ensayos Clínicos en España (REEC - AEMPS / Sanidad)
   fijate.com/tools/buscador-ensayos-clinicos-reec/
   ========================================================================== */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema claro por defecto */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-card-hover: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --accent-teal: #0d9488;
  --accent-teal-bg: #ccfbf1;
  --accent-blue: #0284c7;
  --accent-blue-bg: #e0f2fe;
  --accent-purple: #7c3aed;
  --accent-purple-bg: #ede9fe;
  --accent-amber: #d97706;
  --accent-amber-bg: #fef3c7;
  --accent-emerald: #059669;
  --accent-emerald-bg: #d1fae5;
  --accent-rose: #e11d48;
  --accent-rose-bg: #ffe4e6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] {
  --bg-page: #0b0f17;
  --bg-card: #131b2a;
  --bg-subtle: #1a2436;
  --bg-card-hover: #1e293b;
  --border-color: #233148;
  --border-focus: #38bdf8;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-teal: #2dd4bf;
  --accent-teal-bg: rgba(45, 212, 191, 0.12);
  --accent-blue: #38bdf8;
  --accent-blue-bg: rgba(56, 189, 248, 0.12);
  --accent-purple: #a78bfa;
  --accent-purple-bg: rgba(167, 139, 250, 0.12);
  --accent-amber: #fbbf24;
  --accent-amber-bg: rgba(251, 191, 36, 0.12);
  --accent-emerald: #34d399;
  --accent-emerald-bg: rgba(52, 211, 153, 0.12);
  --accent-rose: #fb7185;
  --accent-rose-bg: rgba(251, 113, 133, 0.12);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 20px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Contención canónica del layout
   ========================================================================== */
body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.main-wrapper.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Tipografías corporativas */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  margin-top: 0;
}

.text-mono {
  font-family: var(--font-mono);
}

/* ==========================================================================
   Hero y sección de bienvenida
   ========================================================================== */
.hero-reec {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hero-reec::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0d9488 0%, #0284c7 50%, #7c3aed 100%);
}

.hero-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-teal-bg);
  color: var(--accent-teal);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.hero-badge-tag svg {
  flex-shrink: 0;
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.hero-description {
  font-size: 1.02rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.75rem;
  max-width: 900px;
}

/* Formulario de búsqueda principal */
.search-form-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon-left {
  position: absolute;
  left: 1.25rem;
  color: var(--text-dim);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input-main {
  width: 100%;
  box-sizing: border-box;
  padding: 0.95rem 3.5rem 0.95rem 3.25rem;
  font-size: 1.05rem;
  font-family: var(--font-main);
  color: var(--text-main);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  min-height: 48px;
}

.search-input-main:focus {
  background: var(--bg-card);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.search-clear-btn {
  position: absolute;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.search-clear-btn:hover {
  color: var(--text-main);
  background: rgba(148, 163, 184, 0.2);
}

/* Chips de patologías y búsqueda rápida */
.quick-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.quick-chips-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.chip-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chip-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  color: var(--accent-blue);
  transform: translateY(-1px);
}

.chip-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

/* ==========================================================================
   Panel de filtros avanzados
   ========================================================================== */
.filters-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.filters-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.filters-reset-btn {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.filters-reset-btn:hover {
  text-decoration: underline;
  background: var(--accent-blue-bg);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-select,
.filter-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--text-main);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.55rem 2.25rem 0.55rem 0.85rem;
  outline: none;
  min-height: 40px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.filter-input {
  padding-right: 0.85rem;
  background-image: none;
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.filter-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* ==========================================================================
   Barra de estado de resultados
   ========================================================================== */
.results-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.results-count-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
}

.results-count-number {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

.results-active-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-emerald);
  background: var(--accent-emerald-bg);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  animation: pulse-ring 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* ==========================================================================
   Tarjetas de ensayos clínicos
   ========================================================================== */
.trials-list-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.trial-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.trial-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.trial-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.trial-badges-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.badge-euct {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-main);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.badge-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-status.reclutando {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
}

.badge-status.no-iniciado {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

.badge-status.finalizado {
  background: var(--bg-subtle);
  color: var(--text-dim);
}

.badge-fase {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-fase.fase-1 {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

.badge-fase.fase-2 {
  background: var(--accent-purple-bg);
  color: var(--accent-purple);
}

.badge-fase.fase-3 {
  background: var(--accent-teal-bg);
  color: var(--accent-teal);
}

.badge-fase.fase-4 {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

.badge-category {
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.trial-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  margin: 0;
}

.trial-indication {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.trial-indication svg {
  color: var(--accent-rose);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.trial-drugs-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.trial-drugs-box svg {
  color: var(--accent-teal);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.trial-drugs-label {
  font-weight: 600;
  color: var(--text-main);
  margin-right: 0.35rem;
}

.trial-drugs-content {
  color: var(--text-muted);
}

/* Centros hospitalarios en la tarjeta */
.trial-hospitals-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.trial-hospitals-heading {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.trial-hospitals-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hospital-tag {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hospital-provincia {
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.75rem;
}

/* Acciones de la tarjeta */
.trial-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.btn-trial-primary {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-main);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.15s ease, transform 0.15s ease;
  min-height: 40px;
}

.btn-trial-primary:hover {
  background: #0274b3;
  transform: translateY(-1px);
}

.trial-secondary-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-trial-secondary {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-main);
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  text-decoration: none;
  min-height: 40px;
}

.btn-trial-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  color: var(--text-main);
}

/* Paginación */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
}

.btn-page {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-page:hover:not(:disabled) {
  border-color: var(--border-focus);
  color: var(--accent-blue);
}

.btn-page.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   Modal accesible de detalle del ensayo clínico
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(15px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-subtle);
}

.modal-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.modal-euct-tag {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.45rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin: 0;
}

.modal-section-title svg {
  color: var(--accent-blue);
}

.modal-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.modal-criteria-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.criteria-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.criteria-box.inclusion {
  border-left: 4px solid var(--accent-emerald);
}

.criteria-box.exclusion {
  border-left: 4px solid var(--accent-rose);
}

.criteria-heading {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.criteria-box.inclusion .criteria-heading {
  color: var(--accent-emerald);
}

.criteria-box.exclusion .criteria-heading {
  color: var(--accent-rose);
}

.criteria-content {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-muted);
  white-space: pre-line;
  word-break: break-word;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

/* Tabla de centros en el modal */
.hospitals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.hospitals-table th {
  text-align: left;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.hospitals-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: top;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   Acordeón educativo y FAQ
   ========================================================================== */
.faq-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 3rem;
  box-shadow: var(--shadow-sm);
}

.faq-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.faq-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-subtle);
}

.faq-trigger {
  width: 100%;
  box-sizing: border-box;
  background: none;
  border: none;
  padding: 1.1rem 1.25rem;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: background-color 0.15s ease;
  min-height: 48px;
}

.faq-trigger:hover {
  background: var(--bg-card-hover);
}

.faq-trigger svg {
  color: var(--text-dim);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-item.open .faq-trigger svg {
  transform: rotate(180deg);
  color: var(--accent-blue);
}

.faq-content {
  display: none;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.faq-item.open .faq-content {
  display: block;
}

.faq-content p {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.faq-content ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.faq-content li {
  margin-bottom: 0.4rem;
}

/* Toast de notificación accesible */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast-notice.show {
  opacity: 1;
  transform: translateY(0);
}

/* Estado de carga */
.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  gap: 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Responsividad móvil
   ========================================================================== */
@media (max-width: 768px) {
  .hero-reec {
    padding: 1.5rem 1.25rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .search-input-main {
    padding: 0.85rem 3rem 0.85rem 2.85rem;
    font-size: 0.95rem;
  }

  .search-icon-left {
    left: 1rem;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .trial-card {
    padding: 1.25rem;
  }

  .trial-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .trial-secondary-actions {
    width: 100%;
  }

  .btn-trial-secondary {
    flex: 1 1 0%;
    justify-content: center;
  }

  .modal-criteria-grid {
    grid-template-columns: 1fr;
  }

  .toast-notice {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    text-align: center;
    justify-content: center;
  }
}

/* Impresión pericial del ensayo */
@media print {
  .app-header,
  .tool-ad-sidebar,
  .tools-ad-banner-section,
  .fijate-footer,
  .search-form-box,
  .filters-panel,
  .quick-chips-wrapper,
  .trial-actions,
  .pagination-container,
  .faq-section {
    display: none !important;
  }

  .modal-overlay {
    position: static;
    background: none;
    backdrop-filter: none;
    opacity: 1;
    visibility: visible;
    padding: 0;
  }

  .modal-container {
    max-width: 100%;
    max-height: none;
    box-shadow: none;
    border: none;
  }

  .modal-close-btn,
  .modal-footer {
    display: none;
  }
}
