/**
 * Calculadora de numerología completa - Hoja de estilos canónica
 * Estética geométrica sagrada, mandalas cósmicos y tonos dorados/púrpuras.
 */

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

  /* Paleta cósmica oscura */
  --bg-page: #080c16;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-mandala: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 70%, #080c16 100%);
  --border-color: rgba(148, 163, 184, 0.16);
  --border-glow: rgba(251, 191, 36, 0.35);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-bright: #ffffff;

  /* Acentos numerológicos */
  --num-gold: #fbbf24;
  --num-gold-glow: rgba(251, 191, 36, 0.5);
  --num-cyan: #38bdf8;
  --num-purple: #a855f7;
  --num-purple-glow: rgba(168, 85, 247, 0.5);
  --num-emerald: #10b981;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-mandala: radial-gradient(circle at center, #f5f3ff 0%, #e2e8f0 70%, #cbd5e1 100%);
  --border-color: rgba(51, 65, 85, 0.16);
  --border-glow: rgba(217, 119, 6, 0.3);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-bright: #020617;

  --num-gold: #d97706;
  --num-gold-glow: rgba(217, 119, 6, 0.3);
  --num-cyan: #0284c7;
  --num-purple: #7e22ce;
  --num-purple-glow: rgba(126, 34, 206, 0.25);
  --num-emerald: #059669;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-bright);
}

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

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

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

/* Tarjeta de introducción */
.tool-intro-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.tool-intro-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--num-gold), var(--num-purple), var(--num-cyan));
}

.tool-intro-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.tool-intro-title {
  font-size: 1.65rem;
  color: var(--text-bright);
}

.tool-intro-subtitle {
  font-size: 0.95rem;
  color: var(--num-gold);
  font-family: var(--font-heading);
  font-weight: 600;
  display: block;
  margin-top: 0.2rem;
}

.tool-intro-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 850px;
}

/* FORMULARIO DE CONSULTA NUMEROLÓGICA */
.calculator-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.form-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-label {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.input-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: normal;
}

.text-input {
  width: 100%;
  height: 44px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
}

.text-input:focus {
  outline: none;
  border-color: var(--num-gold);
  box-shadow: 0 0 10px var(--num-gold-glow);
}

/* Selector compacto de fecha natal en 3 columnas */
.date-triplet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.select-compact {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 0.5rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.select-compact:focus {
  outline: none;
  border-color: var(--num-gold);
}

/* Botones de acción del formulario */
.form-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
}

.btn-primary-calc {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.8rem 2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 46px;
}

.btn-primary-calc:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.55);
}

.btn-secondary-tool {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
}

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

/* MANDALA NUMEROLÓGICO INTERACTIVO */
.mandala-card {
  background: var(--bg-mandala);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.6);
}

.mandala-header {
  text-align: center;
  margin-bottom: 1.5rem;
  z-index: 2;
}

.mandala-title {
  font-size: 1.4rem;
  color: var(--text-bright);
}

.mandala-subtitle {
  font-size: 0.88rem;
  color: var(--num-gold);
}

.mandala-svg-box {
  width: 100%;
  max-width: 480px;
  height: 380px;
  position: relative;
  z-index: 2;
}

.mandala-node-circle {
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.mandala-node-circle:hover {
  filter: drop-shadow(0 0 12px var(--num-gold-glow));
}

/* TARJETAS DE NÚMEROS NUCLEARES (CORE NUMBERS) */
.core-numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.core-number-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}

.core-number-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.core-number-card.highlight-card {
  border-color: var(--num-gold);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.15);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.number-big-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--num-gold);
  color: var(--num-gold);
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--num-gold-glow);
  cursor: pointer;
}

.number-big-badge.master-badge {
  border-color: var(--num-purple);
  color: var(--num-purple);
  box-shadow: 0 0 16px var(--num-purple-glow);
}

.card-titles {
  flex: 1;
  margin-left: 1rem;
}

.card-tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--num-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.card-title-text {
  font-size: 1.15rem;
  color: var(--text-bright);
}

.card-archetype-text {
  font-size: 0.85rem;
  color: var(--num-gold);
  font-weight: 600;
}

.card-desc-text {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.5;
}

.card-keywords-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.keyword-pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
}

.card-advice-box {
  background: rgba(0, 0, 0, 0.18);
  border-left: 3px solid var(--num-gold);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-main);
}

[data-theme="light"] .card-advice-box {
  background: rgba(0, 0, 0, 0.04);
}

/* PINÁCULOS Y DESAFÍOS DE VIDA */
.pinnacles-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.pinnacles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.cycle-step-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cycle-number-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.15);
  color: var(--num-gold);
  border: 1px solid var(--num-gold);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.3rem;
}

.cycle-number-circle.challenge-circle {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border-color: #f43f5e;
}

.cycle-step-title {
  font-size: 0.92rem;
  color: var(--text-bright);
}

.cycle-step-age {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--num-cyan);
}

.cycle-step-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* COMPARADOR DE AFINIDAD NUMEROLÓGICA */
.affinity-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.affinity-inputs-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 1rem 0;
}

.affinity-result-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
}

.affinity-score-badge {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--num-gold);
}

/* ENCICLOPEDIA NUMEROLÓGICA */
.encyclopedia-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.encyclopedia-search-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.encyclopedia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.num-glossary-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.num-glossary-card:hover {
  transform: translateY(-3px);
  border-color: var(--num-gold);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.num-glyph {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--num-gold);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.num-glossary-card.master-card .num-glyph {
  color: var(--num-purple);
}

.num-glossary-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-bright);
}

/* GUÍA Y FAQ */
.guide-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

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

.faq-summary {
  padding: 0.85rem 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text-bright);
  user-select: none;
}

.faq-content {
  padding: 0 1rem 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* MODALES NATIVOS CANÓNICOS (CERO ALERT) */
.fijate-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.fijate-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.fijate-modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.fijate-modal-overlay.open .fijate-modal-box {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: var(--text-bright);
  background: var(--bg-surface-elevated);
}

/* Toast de notificación */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--num-gold);
  color: #080c16;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.6rem 1.4rem;
  border-radius: 30px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

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

/* RESPONSIVE DESIGN CONFORME A REGLAS DE FIJATE */
@media (max-width: 900px) {
  .tool-with-sidebar {
    flex-direction: column;
  }
  .tool-ad-sidebar {
    display: none !important;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tool-layout {
    padding: 0 0.75rem;
    margin: 1rem auto 2.5rem;
  }

  .tool-intro-card, .calculator-form-card, .mandala-card {
    padding: 1.15rem;
  }

  .tool-intro-title {
    font-size: 1.4rem;
  }

  .btn-primary-calc {
    width: 100%;
    min-height: 44px;
  }

  .form-actions-bar {
    flex-direction: column;
    width: 100%;
  }

  .btn-secondary-tool {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  .mandala-svg-box {
    height: 300px;
  }

  .core-numbers-grid {
    grid-template-columns: 1fr;
  }
}
