/* ============================================================================
   styles.css — ISHTARMOL · Landing "Coming Soon" temática academia mágica
   ----------------------------------------------------------------------------
   Estilos mobile-first (base = móvil, mejoras por media queries).
   Sistema de temas con CSS custom properties:
     [data-theme="dark"] (por defecto) y [data-theme="light"].
   El selector de tema vive en <html data-theme="..."> y se persiste en
   localStorage desde js/script.js.
   Estética: pergamino, dorado, vino tinto, cielo estrellado y castillos.
   ==========================================================================*/

/* ----------------------------------------------------------------------------
   1. Variables del tema
   -------------------------------------------------------------------------- */
:root,
[data-theme="dark"] {
  /* Paleta oscura: noche, oro y vino tinto (academia mágica) */
  --bg: #0b0e1a;
  --surface: #141a2e;
  --surface-2: #1b2238;
  --text: #efe6d0;          /* pergamino */
  --muted: #b3a98f;         /* gris dorado envejecido */
  --accent: #d4af37;        /* oro */
  --accent-2: #9b1b30;      /* vino tinto */
  --on-accent: #1a1405;
  --star: rgba(255, 255, 255, 0.75);
  --border: rgba(212, 175, 55, 0.28);
  --glow: rgba(212, 175, 55, 0.45);
  --glow-soft: rgba(212, 175, 55, 0.12);
  --shadow: 0 0 22px var(--glow-soft);
}

[data-theme="light"] {
  /* Paleta clara: pergamino antiguo con acentos oro/vino de contraste AA */
  --bg: #f4ecda;
  --surface: #fffdf6;
  --surface-2: #f7f0de;
  --text: #241d12;          /* tinta */
  --muted: #5f5541;
  --accent: #8a6a15;        /* oro oscuro para contraste */
  --accent-2: #7c142a;
  --on-accent: #fffdf6;
  --star: rgba(120, 96, 40, 0.35);
  --border: rgba(138, 106, 21, 0.32);
  --glow: rgba(138, 106, 21, 0.3);
  --glow-soft: rgba(138, 106, 21, 0.12);
  --shadow: 0 0 18px var(--glow-soft);
}

/* ----------------------------------------------------------------------------
   2. Reset y base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* Transición suave al cambiar de tema */
body,
.site-header,
.signal,
.form input,
.form textarea,
.form select,
.btn,
.brand-mark {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

body {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: 1.125rem; /* 18px: base cómoda en móvil */
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  /* Resplandor superior sutil (luz de velas) */
  background-image: radial-gradient(
    ellipse 90% 45% at 50% -8%,
    var(--glow-soft),
    transparent 70%
  );
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* Ocultar campo honeypot (anti-bot) de humanos y de lectores de pantalla */
.honeypot {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Enlace "saltar al contenido" (accesibilidad) */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-family: "Cinzel", serif;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ----------------------------------------------------------------------------
   3. Decoración de fondo: cielo estrellado + motas doradas
   -------------------------------------------------------------------------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* Cielo estrellado: capas repetidas de puntos con desenfoque radial */
.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 30px 40px, var(--star), transparent 60%),
    radial-gradient(1.2px 1.2px at 160px 90px, var(--star), transparent 60%),
    radial-gradient(1.6px 1.6px at 260px 30px, var(--star), transparent 60%),
    radial-gradient(1.2px 1.2px at 90px 220px, var(--star), transparent 60%),
    radial-gradient(1.8px 1.8px at 320px 270px, var(--star), transparent 60%),
    radial-gradient(1.2px 1.2px at 210px 330px, var(--star), transparent 60%);
  background-size: 380px 380px;
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, black 30%, transparent 88%);
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, black 30%, transparent 88%);
  opacity: 0.85;
}

/* Motas doradas flotantes (partículas mágicas) */
.motes {
  position: absolute;
  inset: 0;
}

.motes span {
  position: absolute;
  bottom: -10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--glow);
  opacity: 0;
  animation: float-up 16s linear infinite;
}

.motes span:nth-child(1)  { left: 8%;  animation-delay: 0s;   animation-duration: 18s; }
.motes span:nth-child(2)  { left: 18%; animation-delay: 3s;   animation-duration: 14s; }
.motes span:nth-child(3)  { left: 29%; animation-delay: 6s;   animation-duration: 20s; }
.motes span:nth-child(4)  { left: 41%; animation-delay: 2s;   animation-duration: 16s; }
.motes span:nth-child(5)  { left: 52%; animation-delay: 9s;   animation-duration: 22s; }
.motes span:nth-child(6)  { left: 63%; animation-delay: 4s;   animation-duration: 15s; }
.motes span:nth-child(7)  { left: 72%; animation-delay: 11s;  animation-duration: 19s; }
.motes span:nth-child(8)  { left: 81%; animation-delay: 1s;   animation-duration: 17s; }
.motes span:nth-child(9)  { left: 90%; animation-delay: 7s;   animation-duration: 21s; }
.motes span:nth-child(10) { left: 96%; animation-delay: 13s;  animation-duration: 16s; }

@keyframes float-up {
  0%   { transform: translateY(0) scale(0.8); opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-100vh) scale(1.1); opacity: 0; }
}

/* ----------------------------------------------------------------------------
   4. Cabecera
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 5vw, 2.5rem);
  background-color: var(--bg); /* fallback: navegadores sin color-mix() */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--glow));
}

.brand-text {
  font-family: "Cinzel", serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.16em;
}

/* "MOL" con acento vino tinto: firma visual de la marca */
.brand-text span {
  color: var(--accent-2);
}

/* Botón selector de tema */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--accent-2);
  box-shadow: var(--shadow);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
}

/* En tema oscuro se muestra el sol (para pasar a claro) y viceversa */
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }

/* ----------------------------------------------------------------------------
   5. Layout principal
   -------------------------------------------------------------------------- */
.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) clamp(1rem, 5vw, 2.5rem) 4rem;
}

/* ----------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  text-align: center;
  padding: clamp(2.5rem, 8vh, 4.5rem) 0 clamp(6rem, 16vh, 9rem);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1.3rem;
  font-family: "Cinzel", serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid var(--border);
  padding: 0.45rem 1rem;
  border-radius: 4px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.hero h1 {
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: clamp(2.3rem, 10vw, 5rem);
  letter-spacing: 0.06em;
  line-height: 1.08;
  color: var(--text);
  text-shadow: 0 0 28px var(--glow), 0 0 4px var(--glow-soft);
  animation: halo 5s ease-in-out infinite;
}

/* Halo dorado pulsante (elegante, sin glitch) */
@keyframes halo {
  0%, 100% { text-shadow: 0 0 22px var(--glow), 0 0 4px var(--glow-soft); }
  50%      { text-shadow: 0 0 38px var(--glow), 0 0 8px var(--glow-soft); }
}

/* Filigrana decorativa bajo el título */
.filigree {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin: 1.4rem auto 0;
  width: min(320px, 70%);
  color: var(--accent);
}

.filigree .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

.filigree .star {
  font-size: 0.9rem;
  color: var(--accent);
}

.tagline {
  max-width: 44rem;
  margin: 1.4rem auto 0;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 500;
  color: var(--muted);
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
  font-family: "Cinzel", serif;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
}

/* Punto pulsante (vela encendida) */
.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--glow);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.72); }
}

/* Skyline de castillo al pie del hero */
.skyline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: clamp(90px, 16vw, 170px);
  color: var(--accent);
  opacity: 0.16;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 60%);
  mask-image: linear-gradient(to bottom, transparent, black 60%);
  pointer-events: none;
}

[data-theme="light"] .skyline {
  opacity: 0.22;
}

/* ----------------------------------------------------------------------------
   7. Sección formulario
   -------------------------------------------------------------------------- */
.signal {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  /* Esquinas cortadas: sugerencia de sello / pergamino */
  clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
  box-shadow: var(--shadow);
}

.signal-header {
  padding: 1.8rem 1.6rem 0.7rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.signal-header h2 {
  font-family: "Cinzel", serif;
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.signal-header p {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.form {
  padding: 1.6rem;
  display: grid;
  gap: 1.15rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  font: inherit;
  font-size: 1.1rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
}

/* Placeholder con el color de texto secundario del tema */
.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px var(--glow-soft);
  outline: none;
}

/* Checkbox de Términos y Condiciones */
.terms {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
}

.terms input {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.terms a {
  /* Subrayado sutil para mejor legibilidad sin romper la estética */
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Botón principal (sello dorado) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.95rem 1.4rem;
  font-family: "Cinzel", serif;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  color: var(--on-accent);
  background: var(--accent);
  border: none;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  cursor: pointer;
  box-shadow: 0 0 22px var(--glow-soft);
}

.btn:hover {
  background: var(--accent-2);
  color: #f7ead0;
  box-shadow: 0 0 26px var(--glow);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Spinner de carga */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid color-mix(in srgb, var(--on-accent) 35%, transparent);
  border-top-color: var(--on-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Mensajes de estado del formulario */
.form-status {
  min-height: 1.4em;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
}

.form-status.ok {
  color: var(--accent);
}

.form-status.error {
  color: var(--accent-2);
}

/* ----------------------------------------------------------------------------
   8. Pie de página
   -------------------------------------------------------------------------- */
.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 5vw, 2.5rem) 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 1rem;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-nav a {
  text-decoration: none;
  color: var(--muted);
}

.footer-nav a:hover {
  color: var(--accent);
}

/* ----------------------------------------------------------------------------
   9. Páginas legales (terminos.html / error.html)
   -------------------------------------------------------------------------- */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 5vw, 2.5rem) 4rem;
}

.legal h1 {
  font-family: "Cinzel", serif;
  font-weight: 800;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.legal .meta {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.legal h2 {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  margin: 2rem 0 0.5rem;
}

.legal p,
.legal li {
  color: var(--muted);
}

.legal ol {
  list-style-position: inside;
}

/* ----------------------------------------------------------------------------
   10. Responsive: tablet (>=760px) y escritorio (>=980px)
   -------------------------------------------------------------------------- */

/* ≥ 760px: más aire en el formulario y el hero */
@media (min-width: 760px) {
  .form {
    padding: 2rem;
    gap: 1.3rem;
  }

  .hero {
    padding: clamp(3rem, 9vh, 5rem) 0 clamp(6.5rem, 16vh, 10rem);
  }
}

/* ≥ 980px: dos columnas — hero a la izquierda, formulario a la derecha */
@media (min-width: 980px) {
  .main {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: clamp(2rem, 6vw, 4.5rem);
  }

  .hero {
    text-align: left;
    padding: 1rem 0 2rem;
  }

  .filigree {
    margin-left: 0;
  }

  .tagline {
    margin-left: 0;
  }

  .skyline {
    height: 150px;
  }

  .signal {
    margin: 0;
  }

  .site-footer {
    padding-top: 2rem;
  }
}

/* ----------------------------------------------------------------------------
   11. Accesibilidad: reducción de movimiento
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .motes span,
  .pulse-dot {
    animation: none;
  }

  .motes span {
    opacity: 0.5;
  }

  .hero h1 {
    animation: none;
  }
}
