/* ============================================
   Numerología App — Tema Místico Premium
   Fondo oscuro + acentos dorados
   ============================================ */

:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-card: #161638;
  --bg-input: #1a1a3e;
  --gold: #d4af37;
  --gold-light: #f0d060;
  --gold-dim: #8b7520;
  --text-primary: #e8e8f0;
  --text-secondary: #9090b0;
  --text-muted: #606080;
  --accent-purple: #6a3d9a;
  --accent-blue: #2d3a8c;
  --error: #e74c3c;
  --success: #2ecc71;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Partículas de fondo --- */
.particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--gold-dim);
  border-radius: 50%;
  animation: float linear infinite;
  opacity: 0.3;
}

@keyframes float {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* --- Layout --- */
.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* --- Header --- */
.header {
  text-align: center;
  padding: 40px 0 20px;
}

.header h1 {
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dim));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  letter-spacing: 2px;
}

.header .subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 8px;
  font-style: italic;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card h2 {
  color: var(--gold);
  font-size: 1.2rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Formulario --- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* --- Botones --- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  width: 100%;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #0a0a1a;
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

.btn-gold:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
}

.btn-outline:hover {
  background: rgba(212, 175, 55, 0.1);
}

/* --- Loader --- */
.loader {
  display: none;
  text-align: center;
  padding: 40px 0;
}

.loader.active { display: block; }

.loader-ring {
  width: 50px;
  height: 50px;
  border: 3px solid var(--bg-card);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

.loader p {
  color: var(--text-secondary);
  font-style: italic;
}

/* --- Resultados --- */
.resultado { display: none; }
.resultado.active { display: block; }

.numero-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color 0.3s;
}

.numero-card:hover {
  border-color: var(--gold-dim);
}

.numero-badge {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-light);
  border: 2px solid var(--gold-dim);
}

.numero-info h3 {
  color: var(--gold);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.numero-info .titulo {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.numero-info .desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* --- Pináculo Visual --- */
.pinaculo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.pinaculo-node {
  text-align: center;
  padding: 10px 4px;
  background: var(--bg-secondary);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.pinaculo-node:hover {
  border-color: var(--gold);
  background: var(--bg-input);
}

.pinaculo-node .pos {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.pinaculo-node .num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-light);
  margin: 4px 0;
}

.pinaculo-node .label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Categorías del pináculo por color */
.pinaculo-node.cat-superior { border-left: 3px solid var(--gold); }
.pinaculo-node.cat-realizacion { border-left: 3px solid #2ecc71; }
.pinaculo-node.cat-meta { border-left: 3px solid #3498db; }
.pinaculo-node.cat-inferior { border-left: 3px solid #9b59b6; }
.pinaculo-node.cat-otro { border-left: 3px solid #7f8c8d; }

/* --- Secciones colapsables --- */
.section-toggle {
  cursor: pointer;
  user-select: none;
}

.section-toggle::after {
  content: ' ▾';
  font-size: 0.8em;
}

.section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.section-content.open {
  max-height: 2000px;
}

/* --- Preview vs Full --- */
.paywall-banner {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(106,61,154,0.2), rgba(212,175,55,0.1));
  border: 1px dashed var(--gold-dim);
  border-radius: var(--radius);
  margin: 20px 0;
}

.paywall-banner h3 {
  color: var(--gold);
  margin-bottom: 8px;
}

.paywall-banner p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .header h1 { font-size: 1.6rem; }
  .form-row { grid-template-columns: 1fr; }
  .pinaculo-grid { grid-template-columns: repeat(3, 1fr); }
  .container { padding: 12px; }
  .card { padding: 18px; }
}

/* --- Animaciones de entrada --- */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

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

.stagger-1 { animation-delay: 0.1s; opacity: 0; }
.stagger-2 { animation-delay: 0.2s; opacity: 0; }
.stagger-3 { animation-delay: 0.3s; opacity: 0; }
.stagger-4 { animation-delay: 0.4s; opacity: 0; }
.stagger-5 { animation-delay: 0.5s; opacity: 0; }

/* --- Kabala section --- */
.kabala-card {
  background: linear-gradient(135deg, var(--bg-secondary), rgba(106,61,154,0.15));
  border: 1px solid rgba(106,61,154,0.3);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 12px;
}

.kabala-card h3 {
  color: #bb86fc;
  margin-bottom: 8px;
}

.kabala-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.kabala-detail div {
  padding: 8px 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
}

.kabala-detail .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.kabala-detail .value {
  color: var(--text-primary);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .kabala-detail { grid-template-columns: 1fr; }
}
