/* ==========================================================================
   Buscador de prefijos telefónicos y tarificación especial - Estilos oficiales
   ========================================================================== */

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

  /* Colores tema claro */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eff6ff;

  --color-safe: #10b981;
  --color-safe-bg: rgba(16, 185, 129, 0.1);
  --color-safe-border: rgba(16, 185, 129, 0.3);

  --color-info: #0284c7;
  --color-info-bg: rgba(2, 132, 199, 0.1);
  --color-info-border: rgba(2, 132, 199, 0.3);

  --color-warning: #d97706;
  --color-warning-bg: rgba(217, 119, 6, 0.1);
  --color-warning-border: rgba(217, 119, 6, 0.3);

  --color-danger: #dc2626;
  --color-danger-bg: rgba(220, 38, 38, 0.1);
  --color-danger-border: rgba(220, 38, 38, 0.3);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* Modo oscuro canónico */
[data-theme="dark"] {
  --bg-body: #0b0f17;
  --bg-card: #151d2c;
  --bg-card-subtle: #1c2638;
  --bg-input: #101622;
  --border-color: #263346;
  --border-focus: #60a5fa;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --color-primary: #3b82f6;
  --color-primary-hover: #60a5fa;
  --color-primary-light: rgba(59, 130, 246, 0.15);

  --color-safe: #34d399;
  --color-safe-bg: rgba(52, 211, 153, 0.15);
  --color-safe-border: rgba(52, 211, 153, 0.35);

  --color-info: #38bdf8;
  --color-info-bg: rgba(56, 189, 248, 0.15);
  --color-info-border: rgba(56, 189, 248, 0.35);

  --color-warning: #fbbf24;
  --color-warning-bg: rgba(251, 191, 36, 0.15);
  --color-warning-border: rgba(251, 191, 36, 0.35);

  --color-danger: #f87171;
  --color-danger-bg: rgba(248, 113, 113, 0.15);
  --color-danger-border: rgba(248, 113, 113, 0.35);
}

/* Contención global y layout de acuerdo a las reglas canónicas */
body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.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%;
}

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

/* ==========================================================================
   NAVEGACIÓN POR PESTAÑAS
   ========================================================================== */
.tool-nav-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  min-height: 44px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-subtle);
}

.nav-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: var(--bg-card);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ==========================================================================
   CAJA PRINCIPAL DE BÚSQUEDA Y DECODIFICADOR
   ========================================================================== */
.search-hero-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.search-hero-header {
  margin-bottom: 1.25rem;
}

.search-hero-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--text-main);
}

.search-hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

.phone-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.phone-input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.phone-input {
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 3.5rem 0.75rem 3.25rem;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.phone-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-clear-input {
  position: absolute;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  min-height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-subtle);
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-input:hover {
  background: var(--border-color);
  color: var(--text-main);
}

/* Presets rápidos */
.preset-pills-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preset-pills-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preset-pills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  min-height: 40px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.preset-pill:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.preset-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

/* ==========================================================================
   TARJETA DE RESULTADO DECODIFICADO
   ========================================================================== */
.result-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.result-card.status-safe {
  border-color: var(--color-safe-border);
  background: linear-gradient(to bottom, var(--color-safe-bg), var(--bg-card) 60px);
}

.result-card.status-info {
  border-color: var(--color-info-border);
  background: linear-gradient(to bottom, var(--color-info-bg), var(--bg-card) 60px);
}

.result-card.status-warning {
  border-color: var(--color-warning-border);
  background: linear-gradient(to bottom, var(--color-warning-bg), var(--bg-card) 60px);
}

.result-card.status-danger {
  border-color: var(--color-danger-border);
  background: linear-gradient(to bottom, var(--color-danger-bg), var(--bg-card) 60px);
}

.result-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.result-icon-box {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.status-safe .result-icon-box {
  background: var(--color-safe-bg);
  border-color: var(--color-safe-border);
  color: var(--color-safe);
}

.status-info .result-icon-box {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
  color: var(--color-info);
}

.status-warning .result-icon-box {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning);
}

.status-danger .result-icon-box {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger);
}

.result-header-text {
  flex: 1 1 0%;
  min-width: 0;
}

.result-badge-row {
  margin-bottom: 0.35rem;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-safe {
  background: var(--color-safe-bg);
  color: var(--color-safe);
  border: 1px solid var(--color-safe-border);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--color-info-border);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.result-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--text-main);
}

.result-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

/* Grid de tarifas y costes */
.cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.cost-card-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.cost-card-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Bloques de información y advertencia legal */
.info-block {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
}

.info-block-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-block-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

.info-block-legal {
  border-left: 4px solid var(--color-primary);
}

.info-block-recommendation {
  border-left: 4px solid var(--color-safe);
}

.status-danger .info-block-recommendation {
  border-left-color: var(--color-danger);
}

.status-warning .info-block-recommendation {
  border-left-color: var(--color-warning);
}

/* Botones de acción en la tarjeta */
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  min-height: 44px;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  min-height: 44px;
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* Estado vacío */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: var(--text-dim);
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text-main);
}

.empty-state-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* ==========================================================================
   SIMULADOR DE FACTURA TELEFÓNICA
   ========================================================================== */
.simulator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.sim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

@media (max-width: 860px) {
  .sim-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.65rem 2.5rem 0.65rem 1rem;
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' 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") no-repeat right 1rem center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

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

.form-select:focus {
  border-color: var(--border-focus);
}

.radio-group-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.radio-card-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  min-height: 44px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-card-label:has(input:checked) {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

.radio-card-label input {
  margin: 0;
}

.slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-val-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.range-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border-color);
  outline: none;
  cursor: pointer;
  accent-color: var(--color-primary);
}

/* Panel de cálculo del simulador */
.sim-calc-panel {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sim-total-hero {
  text-align: center;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.sim-total-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.sim-total-number {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-danger);
  line-height: 1.1;
}

.sim-lines-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.sim-line-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.sim-line-item strong {
  font-family: var(--font-mono);
  color: var(--text-main);
}

.sim-saving-card {
  background: var(--color-safe-bg);
  border: 1px solid var(--color-safe-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
  margin-bottom: 1rem;
}

.sim-saving-label {
  font-size: 0.8rem;
  color: var(--color-safe);
  font-weight: 600;
  text-transform: uppercase;
}

.sim-saving-number {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-safe);
}

/* ==========================================================================
   TABLAS RESPONSIVAS (PROVINCIAS E INTERNACIONAL)
   ========================================================================== */
.table-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.table-search-input {
  flex: 1 1 250px;
  min-height: 44px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
}

.table-search-input:focus {
  border-color: var(--border-focus);
}

.table-container {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.data-table th {
  background: var(--bg-card-subtle);
  padding: 0.85rem 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

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

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg-card-subtle);
}

.code-pill {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin: 0.1rem;
}

.btn-table-action {
  padding: 0.35rem 0.75rem;
  min-height: 36px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-table-action:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.status-pill {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-pill-safe {
  background: var(--color-safe-bg);
  color: var(--color-safe);
}

.status-pill-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.status-pill-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.country-flag {
  font-size: 1.2rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.empty-table-cell {
  text-align: center;
  padding: 2rem !important;
  color: var(--text-muted);
}

/* ==========================================================================
   GUÍA DE TARIFICACIÓN ESPECIAL
   ========================================================================== */
.guide-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.guide-number-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.2s ease;
}

.guide-number-card:hover {
  transform: translateY(-2px);
}

.guide-number-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.guide-badge-free {
  background: var(--color-safe-bg);
  color: var(--color-safe);
  border: 1px solid var(--color-safe-border);
}

.guide-badge-shared {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.guide-badge-expensive {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.guide-badge-ultra {
  background: rgba(220, 38, 38, 0.2);
  color: #ef4444;
  border: 2px solid #ef4444;
}

.guide-number-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text-main);
}

.guide-number-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.guide-meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.guide-meta-list li {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.guide-meta-list li strong {
  color: var(--text-main);
}

/* ==========================================================================
   MODALES ACCESIBLES (SIN ALERT)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

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

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

.btn-modal-close {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-close:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
}

.claim-textarea {
  width: 100%;
  height: 300px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  box-sizing: border-box;
  resize: vertical;
}

/* Toast flotante accesible */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.3s ease;
}

[data-theme="dark"] .toast-notification {
  background: #1e293b;
  border: 1px solid #334155;
}

.toast-notification.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   SECCIONES SEO Y CONTENIDO DIDÁCTICO
   ========================================================================== */
.seo-content-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.seo-content-section h2 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text-main);
}

.seo-content-section h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--text-main);
}

.seo-content-section p {
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 1rem;
}

.seo-content-section ul, .seo-content-section ol {
  color: var(--text-muted);
  line-height: 1.65;
  padding-left: 1.5rem;
  margin: 0 0 1.25rem;
}

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

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

.faq-question {
  width: 100%;
  padding: 1rem 1.25rem;
  text-align: left;
  background: transparent;
  border: none;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-answer {
  padding: 0 1.25rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   ADAPTABILIDAD RESPONSIVE MÓVIL
   ========================================================================== */
@media (max-width: 768px) {
  .tool-layout {
    margin: 1rem auto 2rem;
    padding: 0 0.75rem;
  }

  .search-hero-box, .result-card, .simulator-card, .seo-content-section {
    padding: 1.25rem;
  }

  .phone-input {
    font-size: 1.1rem;
    padding-left: 2.75rem;
  }

  .result-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .result-title {
    font-size: 1.2rem;
  }

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

  .result-actions {
    flex-direction: column;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
  }

  .table-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-search-input {
    width: 100%;
  }

  .radio-group-cards {
    grid-template-columns: 1fr;
  }
}
