/* ==========================================================================
   The Mystica — sistema visual "Cartas nocturnas"
   Paleta: noche indigo + velo violeta + dorado de gilding + vino como acento
   Tipografia: Fraunces (display) + Inter (cuerpo) + IBM Plex Mono (etiquetas)
   Firma: la carta-mistica, un componente que se voltea en 3D para revelar
   la lectura, como si el usuario la sacara del mazo.
   ========================================================================== */

:root {
  --noche: #100d1b;
  --velo: #1c1830;
  --velo-alto: #262048;
  --luz: #ede7f6;
  --bruma: #9c90be;
  --bruma-tenue: #6d6390;
  --oro: #c9a227;
  --oro-claro: #e4c766;
  --vino: #7a3b49;
  --linea: rgba(201, 162, 39, 0.25);
  --sombra: rgba(6, 4, 16, 0.55);

  --fuente-display: "Fraunces", Georgia, serif;
  --fuente-cuerpo: "Inter", -apple-system, sans-serif;
  --fuente-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--noche);
  color: var(--luz);
  font-family: var(--fuente-cuerpo);
  line-height: 1.65;
  position: relative;
  min-height: 100vh;
}

/* Cielo estrellado de fondo, sutil y fijo, no compite con el contenido */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(237,231,246,.55), transparent),
    radial-gradient(1px 1px at 68% 8%, rgba(237,231,246,.4), transparent),
    radial-gradient(1.5px 1.5px at 34% 62%, rgba(201,162,39,.5), transparent),
    radial-gradient(1px 1px at 82% 44%, rgba(237,231,246,.35), transparent),
    radial-gradient(1px 1px at 6% 78%, rgba(201,162,39,.35), transparent),
    radial-gradient(1.5px 1.5px at 55% 88%, rgba(237,231,246,.45), transparent),
    radial-gradient(1px 1px at 92% 70%, rgba(237,231,246,.3), transparent);
  background-repeat: repeat;
  background-size: 380px 380px;
  animation: destello 7s ease-in-out infinite alternate;
}
@keyframes destello { from { opacity: .55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; opacity: .75; }
  html { scroll-behavior: auto; }
}

a { color: var(--oro-claro); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--oro);
  outline-offset: 3px;
}

/* ---------- Barra superior ---------- */
.barra-superior {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px 0;
  font-family: var(--fuente-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bruma);
}
.barra-superior a { color: var(--bruma); text-decoration: none; }
.barra-superior a:hover { color: var(--oro-claro); }

/* ---------- Hero ---------- */
.servicio-hero {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px 8px;
  text-align: center;
  animation: aparecer 0.7s ease-out both;
}
@keyframes aparecer {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .servicio-hero { animation: none; }
}

.eyebrow {
  display: inline-block;
  font-family: var(--fuente-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oro);
  margin-bottom: 14px;
}

.servicio-hero h1 {
  font-family: var(--fuente-display);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: var(--luz);
}

.servicio-hero p {
  font-size: 16px;
  color: var(--bruma);
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- Contenedor general ---------- */
.servicio-contenedor {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---------- Carta mistica (elemento de firma: flip 3D) ---------- */
.carta-mistica {
  perspective: 1400px;
  min-height: 400px;
}

.carta-interior {
  position: relative;
  width: 100%;
  min-height: 400px;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}
.carta-mistica.volteada .carta-interior {
  transform: rotateY(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .carta-interior { transition: opacity 0.3s ease; }
  .carta-mistica.volteada .carta-interior { transform: none; }
  .carta-cara-frontal { position: relative !important; }
  .carta-mistica.volteada .carta-cara-frontal { display: none; }
  .carta-mistica:not(.volteada) .carta-cara-trasera { display: none; }
}

.carta-cara-frontal,
.carta-cara-trasera {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 18px;
  border: 1px solid var(--linea);
  background: linear-gradient(160deg, var(--velo), var(--velo-alto));
  box-shadow: 0 20px 50px var(--sombra);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.carta-cara-trasera {
  transform: rotateY(180deg);
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  overflow-y: auto;
  padding-top: 46px;
}

/* La cara que no se ve NUNCA debe poder interceptar clics: sin esto, la cara
   trasera (superpuesta y posterior en el DOM) se come el clic del boton. */
.carta-mistica:not(.volteada) .carta-cara-trasera { pointer-events: none; }
.carta-mistica:not(.volteada) .carta-cara-frontal { pointer-events: auto; }
.carta-mistica.volteada .carta-cara-frontal { pointer-events: none; }
.carta-mistica.volteada .carta-cara-trasera { pointer-events: auto; }

.emblema {
  width: 64px;
  height: 64px;
  margin-bottom: 22px;
  color: var(--oro);
}
.emblema svg { width: 100%; height: 100%; }

/* En la cara frontal el emblema se compacta: ahora comparte espacio con el campo */
.carta-cara-frontal .emblema {
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
}

/* Campo de consulta dentro de la carta: aqui el usuario escribe su pregunta real */
.input-carta {
  width: 100%;
  max-width: 340px;
  min-height: 74px;
  resize: vertical;
  text-align: left;
  margin-bottom: 16px;
  font-family: var(--fuente-cuerpo);
}

.carta-cara-frontal h2 {
  font-family: var(--fuente-display);
  font-weight: 500;
  font-size: 21px;
  margin: 0 0 10px;
  color: var(--luz);
}

.carta-cara-frontal p {
  color: var(--bruma);
  font-size: 13.5px;
  margin: 0 0 16px;
  max-width: 320px;
}

.carta-cara-trasera .eyebrow-carta {
  font-family: var(--fuente-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--oro);
  margin-bottom: 16px;
  display: block;
}

.texto-trial {
  color: var(--luz);
  font-size: 15px;
  line-height: 1.75;
  margin: 0;
}
.texto-trial p { margin: 0 0 14px; }
.texto-trial p:last-child { margin-bottom: 0; }

/* ---------- Botones ---------- */
.boton-mistico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--oro);
  color: #1b1508;
  border: none;
  border-radius: 999px;
  padding: 14px 30px;
  font-family: var(--fuente-cuerpo);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.boton-mistico:hover { background: var(--oro-claro); transform: translateY(-1px); }
.boton-mistico:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.boton-fantasma {
  background: transparent;
  color: var(--oro-claro);
  border: 1px solid var(--linea);
  border-radius: 999px;
  padding: 12px 26px;
  font-family: var(--fuente-cuerpo);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.boton-fantasma:hover { border-color: var(--oro); }

/* ---------- Tarjetas de pago / formulario / resultado ---------- */
.tarjeta-servicio {
  background: linear-gradient(160deg, var(--velo), var(--velo-alto));
  border: 1px solid var(--linea);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 20px 50px var(--sombra);
  animation: aparecer 0.5s ease-out both;
}
@media (prefers-reduced-motion: reduce) { .tarjeta-servicio { animation: none; } }

.tarjeta-servicio h2 {
  font-family: var(--fuente-display);
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--luz);
}

.tarjeta-servicio > p:not(.precio-destacado):not(.aviso-legal):not(.avisando-pago) {
  color: var(--bruma);
  font-size: 14px;
  margin: 0 0 20px;
}

.precio-destacado {
  font-family: var(--fuente-display);
  font-size: 44px;
  font-weight: 600;
  color: var(--oro);
  margin: 4px 0 22px;
}

.input-mistico {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--linea);
  border-radius: 10px;
  background: rgba(16, 13, 27, 0.5);
  color: var(--luz);
  font-family: var(--fuente-cuerpo);
  font-size: 14px;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.input-mistico::placeholder { color: var(--bruma-tenue); }
textarea.input-mistico { resize: vertical; min-height: 100px; }

.aviso-legal {
  font-size: 12px;
  color: var(--bruma-tenue);
  margin-top: 18px;
  text-align: center;
}

.avisando-pago {
  font-family: var(--fuente-mono);
  font-size: 13px;
  color: var(--oro);
  letter-spacing: 0.04em;
}

.mensaje-error {
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(224, 122, 122, 0.4);
  border-radius: 10px;
  background: rgba(122, 59, 73, 0.25);
  color: #f0c3c3;
  font-size: 13.5px;
  line-height: 1.5;
}

.acciones-resultado {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--linea);
  text-align: center;
}

.nota-enlace {
  font-size: 13px;
  color: var(--bruma);
  margin: 0 0 16px;
  line-height: 1.6;
}

/* ---------- Impresion / guardar como PDF ---------- */
@media print {
  body { background: #fff !important; color: #1a1a1a; }
  body::before { display: none !important; }
  .barra-superior,
  .bloque-trial,
  .bloque-pago,
  .bloque-formulario,
  .acciones-resultado,
  .pie-servicio { display: none !important; }
  .servicio-hero { padding: 0 0 12px; animation: none; }
  .servicio-hero h1 { color: #1a1a1a; font-size: 26px; }
  .servicio-hero p, .eyebrow { display: none; }
  .tarjeta-servicio {
    background: #fff;
    border: none;
    box-shadow: none;
    padding: 0;
  }
  .tarjeta-servicio h2 { color: #1a1a1a; }
  .texto-resultado { color: #1a1a1a; font-size: 12.5pt; line-height: 1.7; }
  .texto-resultado p:first-of-type::first-letter { color: #1a1a1a; }
}

.texto-resultado {
  color: var(--luz);
  font-size: 15.5px;
  line-height: 1.85;
}
.texto-resultado p { margin: 0 0 16px; }
.texto-resultado p:last-child { margin-bottom: 0; }
.texto-resultado p:first-of-type::first-letter {
  font-family: var(--fuente-display);
  font-size: 46px;
  float: left;
  line-height: 0.8;
  padding: 6px 8px 0 0;
  color: var(--oro);
}

/* ---------- Pie ---------- */
.pie-servicio {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 24px 48px;
  text-align: center;
  font-size: 12px;
  color: var(--bruma-tenue);
}

/* ---------- Hub de servicios (/services/) ---------- */
.rejilla-servicios {
  display: grid;
  gap: 20px;
}
@media (min-width: 560px) {
  .rejilla-servicios { grid-template-columns: 1fr 1fr; }
}
.tarjeta-enlace {
  display: block;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.tarjeta-enlace:hover { transform: translateY(-3px); }
.tarjeta-enlace .tarjeta-servicio { min-height: 100%; }
.tarjeta-enlace .emblema { width: 40px; height: 40px; margin-bottom: 16px; }

@media (max-width: 480px) {
  .servicio-hero h1 { font-size: 30px; }
  .carta-cara-frontal, .carta-cara-trasera { padding: 26px 20px; }
  .carta-mistica, .carta-interior { min-height: 420px; }
}
