/* ==========================================================================
   Buscador y recomendador de nombres de bebé - Fijate Tools
   Estilos corporativos, tema claro/oscuro, glassmorphism y diseño responsivo
   ========================================================================== */

:root {
  /* Paleta cromática corporativa y cálida para bebés / familia */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema claro por defecto */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-sub: #64748b;

  --accent-pink: #ec4899;
  --accent-blue: #0284c7;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;

  --primary-gradient: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #3b82f6 100%);
  --male-color: #0284c7;
  --male-bg: rgba(2, 132, 199, 0.1);
  --female-color: #db2777;
  --female-bg: rgba(219, 39, 119, 0.1);
  --unisex-color: #7c3aed;
  --unisex-bg: rgba(124, 58, 237, 0.1);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

[data-theme="dark"] {
  --bg-body: #090d16;
  --bg-card: #111827;
  --bg-card-subtle: #1f2937;
  --bg-input: #0b1120;
  --border-color: #283548;
  --border-hover: #374151;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;

  --male-color: #38bdf8;
  --male-bg: rgba(56, 189, 248, 0.15);
  --female-color: #f472b6;
  --female-bg: rgba(244, 114, 182, 0.15);
  --unisex-color: #a78bfa;
  --unisex-bg: rgba(167, 139, 250, 0.15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 28px rgba(0, 0, 0, 0.6);
}

/* Reglas de contención base según estándar Fijate */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Canvas de confeti flotante */
.confetti-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}

/* Layout y contenedor principal */
.tool-layout {
  max-width: 1200px;
  margin: 1.25rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
}

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

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Tarjeta Hero superior */
.baby-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem 1.25rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.baby-hero-card::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, rgba(59, 130, 246, 0.04) 70%, transparent 100%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.85rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-pink);
  box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.7);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(236, 72, 153, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); }
}

.hero-heading {
  font-family: var(--font-title);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-subtext {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 780px;
  margin-bottom: 1.5rem;
}

/* Pestañas de navegación superiores */
.tool-tabs-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 42px;
}

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

.tab-btn.active {
  background: var(--text-main);
  color: var(--bg-body);
  border-color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .tab-btn.active {
  background: #ffffff;
  color: #090d16;
  border-color: #ffffff;
}

.tab-badge-match, .tab-badge-fav {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(236, 72, 153, 0.2);
  color: var(--accent-pink);
  font-weight: 700;
}

.tab-btn.active .tab-badge-match,
.tab-btn.active .tab-badge-fav {
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
}

/* Contenido de pestañas */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tarjeta contenedora estándar */
.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

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

.card-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.card-header-block {
  margin-bottom: 1.25rem;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   SECCIÓN 1: EXPLORADOR Y FILTROS
   ========================================================================== */
.search-bar-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.search-input-wrapper {
  position: relative;
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-sub);
  pointer-events: none;
}

.search-field {
  width: 100%;
  height: 46px;
  padding: 0 2.5rem 0 2.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.98rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-field:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
}

.btn-clear-search {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-sub);
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}

.names-counter-chip {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 1rem;
  height: 46px;
  display: flex;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.names-counter-chip span {
  font-family: var(--font-mono);
  color: var(--accent-pink);
  font-weight: 700;
  margin-right: 0.35rem;
}

/* Botonera de género */
.gender-toggle-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.gender-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 44px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.gender-btn.active {
  background: var(--bg-input);
  color: var(--text-main);
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 1px var(--accent-pink);
}

.gender-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.gender-dot.male { background-color: var(--male-color); }
.gender-dot.female { background-color: var(--female-color); }
.gender-dot.unisex { background-color: var(--unisex-color); }

/* Filtros cuadrícula */
.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.form-select, .form-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:focus, .form-input:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
}

/* Cuadrícula de tarjetas de nombres */
.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.name-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.name-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.name-card-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.btn-fav-card {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-sub);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, transform 0.15s ease;
}

.btn-fav-card:hover {
  transform: scale(1.15);
  color: var(--accent-pink);
}

.btn-fav-card.is-fav {
  color: var(--accent-pink);
}

.name-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge-gender {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: lowercase;
}

.badge-gender.male {
  background: var(--male-bg);
  color: var(--male-color);
}

.badge-gender.female {
  background: var(--female-bg);
  color: var(--female-color);
}

.badge-gender.unisex {
  background: var(--unisex-bg);
  color: var(--unisex-color);
}

.badge-origin {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-card-subtle);
  color: var(--text-muted);
}

.name-card-meaning {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.name-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.76rem;
  color: var(--text-sub);
}

.load-more-wrapper {
  text-align: center;
  margin-top: 1.5rem;
}

/* ==========================================================================
   SECCIÓN 2: MODO MATCH EN PAREJA (TINDER DE NOMBRES)
   ========================================================================== */
.match-intro-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.voter-switcher {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

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

.voter-buttons {
  display: flex;
  gap: 0.4rem;
  background: var(--bg-card-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.btn-voter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
  min-height: 38px;
}

.btn-voter.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.voter-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-pink);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-voter:nth-child(2) .voter-avatar {
  background: var(--accent-blue);
}

.btn-text-edit {
  background: none;
  border: none;
  font-size: 0.82rem;
  color: var(--accent-pink);
  text-decoration: underline;
  cursor: pointer;
  padding: 0.25rem;
}

.match-gender-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.label-mini {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
}

.btn-group-mini {
  display: inline-flex;
  gap: 0.35rem;
}

.btn-mini {
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  min-height: 36px;
}

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

/* Escenario de tarjeta swipe */
.swipe-stage {
  max-width: 440px;
  margin: 0 auto 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.swipe-card-wrapper {
  width: 100%;
  min-height: 340px;
  position: relative;
  perspective: 1000px;
}

.swipe-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.75rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  user-select: none;
  touch-action: pan-y;
  transition: transform 0.25s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.swipe-card-gender-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.swipe-card-name {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.swipe-card-origin {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-pink);
  margin-bottom: 1.25rem;
}

.swipe-card-meaning-box {
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

.swipe-card-meaning {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.45;
}

.swipe-card-meta-row {
  display: flex;
  justify-content: space-around;
  width: 100%;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.swipe-card-meta-item strong {
  color: var(--text-main);
}

/* Botonera de votación */
.swipe-actions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  width: 100%;
}

.btn-action-vote {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-action-vote:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.btn-action-vote:active {
  transform: scale(0.95);
}

.vote-no {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.vote-no:hover {
  background: rgba(239, 68, 68, 0.1);
}

.vote-star {
  width: 52px;
  height: 52px;
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}
.vote-star:hover {
  background: rgba(245, 158, 11, 0.1);
}

.vote-yes {
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}
.vote-yes:hover {
  background: rgba(16, 185, 129, 0.1);
}

/* Caja de coincidencias / Matches */
.matches-results-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.matches-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.match-badge-sparkle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.matches-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.match-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.match-name-text {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.match-tag-heart {
  color: var(--accent-pink);
  font-size: 1rem;
}

.empty-matches-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ==========================================================================
   SECCIÓN 3: PROBADOR DE APELLIDOS
   ========================================================================== */
.surname-test-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
}

.autocomplete-item {
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.autocomplete-item:hover {
  background: var(--bg-card-subtle);
  color: var(--accent-pink);
}

/* Tarjeta gráfica aesthetic de recién nacido */
.baby-id-card-preview {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.06) 0%, rgba(59, 130, 246, 0.06) 100%), var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-md);
}

.baby-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-tagline {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-pink);
}

.card-year-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--bg-card-subtle);
  color: var(--text-muted);
}

.baby-card-body {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-bottom: 1.75rem;
}

.baby-monogram-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 1.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
  box-shadow: 0 8px 16px rgba(236, 72, 153, 0.25);
  flex-shrink: 0;
}

.baby-fullname-display {
  display: flex;
  flex-direction: column;
}

.baby-first-name {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.baby-surnames {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

.baby-card-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.footer-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-sub);
  text-transform: uppercase;
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.stat-value.highlight {
  color: var(--accent-emerald);
}

/* Análisis acústico */
.harmony-analysis-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.analysis-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--text-main);
}

.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.metric-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.metric-icon-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.metric-icon-badge.good {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.metric-icon-badge.warn {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

/* ==========================================================================
   SECCIÓN 4: RULETA MÁGICA
   ========================================================================== */
.text-center {
  text-align: center;
}

.wheel-filters-bar {
  display: inline-flex;
  gap: 1.25rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  margin-bottom: 2rem;
  align-items: center;
}

.form-group-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-select-sm {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  height: 34px;
}

.wheel-stage {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 1.75rem;
}

.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid var(--accent-pink);
  z-index: 20;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.wheel-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 8px solid var(--bg-card-subtle);
  background: conic-gradient(
    #ec4899 0deg 45deg,
    #8b5cf6 45deg 90deg,
    #3b82f6 90deg 135deg,
    #06b6d4 135deg 180deg,
    #10b981 180deg 225deg,
    #f59e0b 225deg 270deg,
    #ef4444 270deg 315deg,
    #d946ef 315deg 360deg
  );
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 4s cubic-bezier(0.15, 0.9, 0.2, 1);
}

.wheel-center-hub {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 2.25rem;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-full);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(236, 72, 153, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 48px;
}

.btn-primary-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(236, 72, 153, 0.45);
}

.btn-primary-large:active {
  transform: translateY(1px);
}

.wheel-result-card {
  max-width: 500px;
  margin: 2rem auto 0;
  background: var(--bg-card);
  border: 2px solid var(--accent-pink);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* ==========================================================================
   SECCIÓN 5: FAVORITOS
   ========================================================================== */
.fav-actions-right {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-secondary-sm, .btn-whatsapp-sm, .btn-danger-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 38px;
}

.btn-secondary-sm {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-whatsapp-sm {
  background: #25d366;
  border: none;
  color: #ffffff;
}

.btn-danger-sm {
  background: none;
  border: 1px solid var(--border-color);
  color: #ef4444;
}

.favs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* FAQ y SEO */
.faq-seo-section {
  margin-top: 1rem;
}

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

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

.faq-question {
  font-family: var(--font-title);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.faq-answer {
  padding-top: 0.65rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   MODALES CANÓNICOS (SIN WINDOW.ALERT)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 10000;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalSlideUp 0.25s ease forwards;
}

.modal-card-sm {
  max-width: 400px;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-sub);
  cursor: pointer;
  padding: 0.25rem;
}

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

.modal-title {
  font-family: var(--font-title);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.15;
  margin-top: 0.25rem;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badge-gender-modal {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(236, 72, 153, 0.1);
  color: var(--accent-pink);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 70vh;
  overflow-y: auto;
}

.detail-heading {
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.detail-text {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.45;
}

.detail-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.detail-item {
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.item-label {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.item-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.item-val.highlight {
  color: var(--accent-pink);
  font-weight: 700;
}

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

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent-pink);
  border: 1px solid var(--accent-pink);
  color: #ffffff;
}

.btn-primary:hover {
  background: #db2777;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

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

.btn-share-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  background: #25d366;
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  min-height: 40px;
}

/* ==========================================================================
   RESPONSIVIDAD Y CONTROLES MÓVILES TÁCTILES
   ========================================================================== */
@media (max-width: 900px) {
  .filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .surname-test-form {
    grid-template-columns: 1fr;
  }
  .baby-card-footer {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (max-width: 640px) {
  .tool-layout {
    padding: 0 0.75rem;
    margin: 1rem auto 2.5rem;
  }
  .baby-hero-card {
    padding: 1.25rem 1rem;
  }
  .hero-heading {
    font-size: 1.45rem;
  }
  .card-main {
    padding: 1.15rem;
  }
  .search-bar-row {
    flex-direction: column;
    align-items: stretch;
  }
  .names-counter-chip {
    justify-content: center;
  }
  .gender-toggle-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters-grid {
    grid-template-columns: 1fr;
  }
  .names-grid {
    grid-template-columns: 1fr;
  }
  .baby-card-body {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  .swipe-actions-bar {
    gap: 1rem;
  }
  .btn-action-vote {
    width: 56px;
    height: 56px;
  }
  .wheel-stage {
    width: 240px;
    height: 240px;
  }
  .modal-footer {
    flex-direction: column;
  }
  .btn-primary, .btn-secondary {
    width: 100%;
  }
  .detail-grid-two {
    grid-template-columns: 1fr;
  }
}
