/**
 * Estilos canónicos para la Calculadora de fases lunares y afinidad de pareja
 * Fijate Tools - Suite de astrología y astronomía
 * Paleta corporativa: Midnight Slate (#0b0f17), destellos dorados y violetas lunares
 */

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

  /* Modo oscuro por defecto (Midnight Slate) */
  --bg-page: #0b0f17;
  --bg-card: #131b2a;
  --bg-card-subtle: #192438;
  --bg-input: #0f1622;
  --border-card: #202d44;
  --border-focus: #38bdf8;

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

  --accent-gold: #fbbf24;
  --accent-blue: #38bdf8;
  --accent-purple: #c084fc;
  --accent-pink: #f472b6;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(251, 191, 36, 0.25);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-card: #e2e8f0;
  --border-focus: #0284c7;

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

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 24px rgba(217, 119, 6, 0.2);
}

/* Reset y estructura básica */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Contenedor principal de herramienta y barra lateral publicitaria */
.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%;
}

/* Barra lateral publicitaria fija en pantallas muy grandes */
.tool-ad-sidebar {
  width: 300px;
  flex-shrink: 0;
}

/* Cabecera introductoria de la herramienta */
.lunar-hero-intro {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem 0;
}

.lunar-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(251, 191, 36, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lunar-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #ffffff 30%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .lunar-hero-title {
  background: linear-gradient(135deg, #0f172a 30%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lunar-hero-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0 auto;
}

/* Selector de pestañas de modo */
.lunar-mode-selector {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.btn-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-mode-tab:hover {
  color: var(--text-main);
  border-color: var(--accent-blue);
}

.btn-mode-tab.active {
  background: var(--bg-card-subtle);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.15);
}

/* Cuadrícula de formularios */
.lunar-forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.lunar-person-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.lunar-form-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-card);
}

.lunar-form-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.lunar-form-header-icon.person-a {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.lunar-form-header-icon.person-b {
  background: rgba(244, 114, 182, 0.15);
  color: var(--accent-pink);
  border: 1px solid rgba(244, 114, 182, 0.3);
}

.lunar-form-header-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-input, .form-select {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.form-row-time {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.form-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.form-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-blue);
}

/* Presets rápidos */
.lunar-presets-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.presets-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 0.5rem;
}

.btn-preset-scenario {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
}

.btn-preset-scenario:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Botón de cálculo principal */
.lunar-actions-bar {
  text-align: center;
  margin-bottom: 2.5rem;
}

.btn-primary-lunar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.9rem 2.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  transition: all 0.25s ease;
  min-height: 48px;
}

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

/* Área de resultados y visualizador interactivo */
.lunar-results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.lunar-visualizer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #0f172a 0%, #06090f 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  margin-bottom: 1.75rem;
  overflow: hidden;
  position: relative;
}

.lunar-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.25));
}

/* Controles de unión interactiva (Pareja) */
.couple-union-bar {
  width: 100%;
  max-width: 600px;
  margin-top: 1.25rem;
  text-align: center;
}

.couple-union-controls-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.slider-union {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  background: #1e293b;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.slider-union::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
  cursor: pointer;
  transition: transform 0.15s;
}

.slider-union::-webkit-slider-thumb:hover {
  transform: scale(1.18);
}

.union-val-indicator {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-gold);
  min-width: 48px;
  text-align: right;
}

.btn-union-animate {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 38px;
}

.btn-union-animate:hover {
  background: var(--accent-gold);
  color: #0f172a;
}

/* Insignia de puntuación de afinidad */
.compatibility-badge-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent-gold);
}

.lunar-score-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-gold);
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.lunar-phase-symbol {
  font-size: 2rem;
}

/* Diagnóstico vincular de pareja */
.couple-diagnosis-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}

.couple-archetype-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.couple-headline {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 1rem;
}

.couple-diagnosis-text {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 0.98rem;
}

.couple-columns-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.couple-subbox {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.couple-subbox-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.couple-subbox ul {
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.couple-subbox li {
  margin-bottom: 0.35rem;
}

.couple-advice-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.92rem;
  color: var(--text-main);
}

.couple-advice-box strong {
  color: var(--accent-blue);
}

/* Tarjetas individuales de resumen */
.lunar-summaries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

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

.lunar-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.lunar-avatar-box {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lunar-symbol-lg {
  font-size: 1.75rem;
}

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

.lunar-phase-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-blue);
}

.lunar-kpis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}

.lunar-kpi-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}

.lunar-kpi-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lunar-kpi-val {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.lunar-archetype-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  font-size: 0.88rem;
}

.lunar-archetype-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 0.2rem;
}

.lunar-archetype-motto {
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
}

.lunar-archetype-desc {
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.lunar-archetype-detail {
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.lunar-archetype-detail strong {
  color: var(--text-main);
}

/* Barra de botones de acción de informe y compartir */
.lunar-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
}

.btn-secondary-lunar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-card);
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

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

/* Guía de contenido SEO y explicativa */
.lunar-seo-guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 2rem;
}

.lunar-seo-guide-section h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.lunar-seo-guide-section h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-gold);
  margin: 1.4rem 0 0.5rem;
}

.lunar-seo-guide-section p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.96rem;
}

.lunar-seo-guide-section ul {
  padding-left: 1.4rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.lunar-seo-guide-section li {
  margin-bottom: 0.4rem;
}

/* Modales corporativos accesibles (sin window.alert) */
.lunar-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.lunar-modal-backdrop.active {
  display: flex;
}

.lunar-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  padding: 1.5rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.lunar-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 0.75rem;
}

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

.lunar-modal-body {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.lunar-modal-footer {
  text-align: right;
}

.btn-modal-close {
  background: var(--accent-gold);
  color: #0f172a;
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 38px;
}

/* Responsividad para móviles y tabletas */
@media (max-width: 768px) {
  .main-wrapper.tool-layout {
    padding: 0 0.75rem;
    margin: 1rem auto 2rem;
  }

  .lunar-hero-title {
    font-size: 1.7rem;
  }

  .lunar-mode-selector {
    flex-direction: column;
  }

  .btn-mode-tab {
    width: 100%;
    justify-content: center;
  }

  .lunar-forms-grid {
    grid-template-columns: 1fr;
  }

  .lunar-presets-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-preset-scenario {
    width: 100%;
    text-align: center;
  }

  .lunar-kpis-grid {
    grid-template-columns: 1fr;
  }

  .couple-columns-two {
    grid-template-columns: 1fr;
  }

  .lunar-export-actions {
    flex-direction: column;
  }

  .btn-secondary-lunar {
    width: 100%;
    justify-content: center;
  }

  .btn-primary-lunar {
    width: 100%;
  }
}
