/*
  BuzonNomina — sitio comercial
  Estilo: neomorfismo suave + "spatial UI" (paneles flotantes, profundidad,
  degradados). Sin dependencias externas: fuentes de sistema, sin CDN.
*/

:root {
  --navy: #1d2662;
  --navy-deep: #141a49;
  --blue: #2d8bba;
  --blue-mid: #2f5f98;
  --blue-light: #88b9dd;

  --bg: #f8fafc;          /* snow mist */
  --bg-alt: #eaf2fa;      /* lavado azul muy suave para alternar secciones */
  --surface: #f8fafc;
  --text: #1b2233;
  --text-muted: #5a6378;
  --heading: var(--blue-mid);
  --border-soft: rgba(29, 38, 98, 0.08);

  --shadow-light: #ffffff;
  --shadow-dark: #ccd3e0;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;

  --container-w: 1180px;
  --header-h: 84px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12162a;
    --bg-alt: #171c34;
    --surface: #161b34;
    --text: #eef1f7;
    --text-muted: #a6adc6;
    --heading: var(--blue-light);
    --border-soft: rgba(255, 255, 255, 0.08);
    --shadow-light: #232a4a;
    --shadow-dark: #05070f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* El atributo [hidden] debe ganar siempre, aunque una clase (p. ej. .btn)
   declare su propio display para ese mismo elemento. */
[hidden] { display: none !important; }

h1, h2, h3, h4 { color: var(--heading); }

a { color: var(--blue-mid); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding-inline: 1.25rem;
}

/* ---------- Reveal al hacer scroll ----------
   Visible por defecto (sin JS, o si el observer no llega a disparar, el
   contenido nunca queda oculto). JS "arma" el estado inicial sólo si puede
   garantizar que lo va a revelar. */

.reveal.js-armed {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Header / navegación espacial ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--heading);
  text-decoration: none;
}
.brand img { height: 36px; width: auto; }

.nav-toggle {
  display: none;
  border: none;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--blue-mid); }

.nav-cta { display: flex; align-items: center; gap: 0.75rem; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  box-shadow: 0 10px 24px -8px rgba(29, 38, 98, 0.55);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 28px -8px rgba(29, 38, 98, 0.65); transform: translateY(-1px); }

.btn-ghost {
  color: var(--text);
  background: var(--surface);
  box-shadow: 6px 6px 14px var(--shadow-dark), -6px -6px 14px var(--shadow-light);
}
.btn-ghost:hover { box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light); }

.btn-block { width: 100%; }

/* ---------- Consentimiento de analítica ---------- */

.cookie-preferences {
  appearance: none;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.consent-banner {
  position: fixed;
  z-index: 200;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  max-width: 760px;
  margin: 0 auto;
  padding: 1.25rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: 12px 12px 28px var(--shadow-dark), -8px -8px 20px var(--shadow-light);
}

.consent-banner__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.consent-banner h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.consent-banner p { margin: 0 0 0.5rem; color: var(--text-muted); }
.consent-banner__actions { display: flex; flex: 0 0 auto; gap: 0.75rem; }

@media (max-width: 620px) {
  .consent-banner { right: 0.75rem; bottom: 0.75rem; left: 0.75rem; }
  .consent-banner__content { align-items: stretch; flex-direction: column; }
  .consent-banner__actions { width: 100%; }
  .consent-banner__actions .btn { flex: 1; padding-inline: 0.75rem; }
}

/* ---------- Hero espacial ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 6rem;
  isolation: isolate;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  z-index: -1;
  animation: drift 22s ease-in-out infinite alternate;
}
.hero::before {
  width: 520px; height: 520px;
  background: radial-gradient(circle at 30% 30%, var(--blue-light), transparent 72%);
  top: -200px; right: -140px;
  opacity: 0.35;
}
.hero::after {
  width: 420px; height: 420px;
  background: radial-gradient(circle at 70% 70%, var(--blue-mid), transparent 72%);
  bottom: -240px; left: -160px;
  opacity: 0.18;
  animation-delay: -8s;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-24px, 18px) scale(1.06); }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-inner {
  max-width: 620px;
}

.hero-media img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  animation: floaty 6s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; max-width: 420px; margin: 0 auto; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue-mid);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  line-height: 1.15;
  margin: 0 0 1.1rem;
  color: var(--heading);
}
.hero-title strong { color: var(--blue); }

.hero-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hero-disclaimer {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 60ch;
}

/* ---------- Secciones genéricas ---------- */

.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg-alt); }

.section-head { max-width: 680px; margin: 0 auto 3rem; text-align: center; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 0.75rem; }
.section-lead { color: var(--text-muted); margin: 0; }

/* Panel neomórfico base */
.panel,
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: 10px 10px 22px var(--shadow-dark), -10px -10px 22px var(--shadow-light);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* ---------- Qué es / qué no es ---------- */

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.about-card { padding: 2rem; }
.about-card h3 { margin-top: 0; }
.about-card ul { margin: 0; padding-left: 1.2rem; color: var(--text-muted); }
.about-card li { margin-bottom: 0.5rem; }
.about-card.limits { border: 1px solid var(--border-soft); }

/* ---------- Perfiles / beneficios ---------- */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}
.profile-card {
  padding: 1.75rem;
}
.profile-card:hover { transform: translateY(-4px); box-shadow: 14px 14px 26px var(--shadow-dark), -14px -14px 26px var(--shadow-light); }
.profile-card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.6rem;
}
.profile-card h3 { margin: 0 0 0.6rem; font-size: 1.1rem; }
.profile-card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Cómo funciona ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.step { padding: 1.5rem; position: relative; overflow: hidden; }
.step:hover { transform: translateY(-4px); box-shadow: 14px 14px 26px var(--shadow-dark), -14px -14px 26px var(--shadow-light); }
.step-media {
  margin: -1.5rem -1.5rem 1.25rem;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-alt);
}
.step-media img { width: 100%; height: 100%; object-fit: cover; }
.step .num {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff;
  font-weight: 700;
  margin-bottom: 1rem;
}
.step h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.step p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Funciones ---------- */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.feature-card { padding: 1.75rem; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 14px 14px 26px var(--shadow-dark), -14px -14px 26px var(--shadow-light); }
.feature-media {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
  background: var(--bg-alt);
}
.feature-media img { width: 100%; height: 100%; object-fit: cover; }
.feature-card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* ---------- FAQ (nativo, sin JS) ---------- */

.faq-list { display: grid; gap: 1rem; max-width: 820px; margin: 0 auto; }
.faq-item {
  padding: 0;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
  color: var(--blue-mid);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .faq-answer {
  padding: 0 1.5rem 1.5rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Contacto: stepper ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 2rem;
  align-items: start;
}

.contact-info {
  padding: 2.25rem;
  background: linear-gradient(160deg, var(--navy), var(--navy-deep));
  color: #fff;
  border-radius: var(--radius-md);
}
.contact-info h3 { color: #fff; margin-top: 0; }
.contact-info p { color: rgba(255,255,255,0.82); }
.contact-info .item {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 0.9rem; font-size: 0.95rem;
}
.contact-info .item a { color: #fff; }
.contact-info .pending {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  margin-top: 1.5rem;
}

.contact-form { padding: 2.25rem; }

.stepper-progress {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.75rem;
}
.stepper-progress-text { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.stepper-progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-alt);
  box-shadow: inset 2px 2px 4px var(--shadow-dark);
  overflow: hidden;
}
.stepper-progress-bar span {
  display: block;
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--blue), var(--navy));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.form-step legend {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--heading);
  padding: 0;
  margin-bottom: 1.25rem;
}
.form-step { border: none; padding: 0; margin: 0 0 1.5rem; }

.option-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}
.option-card { position: relative; }
.option-card input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.option-card label {
  display: block;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 6px 6px 14px var(--shadow-dark), -6px -6px 14px var(--shadow-light);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  transition: box-shadow 0.15s ease, color 0.15s ease;
}
.option-card input:checked + label {
  color: var(--blue-mid);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}
.option-card input:focus-visible + label { outline: 3px solid var(--blue); outline-offset: 2px; }

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.form-group .required { color: var(--blue); }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--bg-alt);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  color: var(--text);
  font: inherit;
}
.form-group textarea { resize: vertical; min-height: 110px; }
.form-hint { font-size: 0.82rem; color: var(--text-muted); margin: 0.4rem 0 0; }
.form-check {
  display: flex; align-items: flex-start; gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.form-check input { margin-top: 0.25rem; }
.field-errors { color: #c0304a; font-size: 0.82rem; margin: 0.3rem 0 0; }
.honeypot-field { position: absolute; left: -9999px; }

.stepper-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
}
.stepper-nav .btn-next,
.stepper-nav .btn-submit { margin-left: auto; }

/* ---------- Mensajes / alertas ---------- */

.alerts { display: grid; gap: 0.75rem; margin-bottom: 1.5rem; }
.alert {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}
.alert-success { background: #dff3e6; color: #1c6b3d; }
.alert-error { background: #fbe2e6; color: #9c1f3a; }

/* ---------- WhatsApp flotante ---------- */

.whatsapp-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 58px; height: 58px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #25D366;
  color: #fff;
  box-shadow: 0 12px 24px -8px rgba(0,0,0,0.35);
  z-index: 200;
  transition: transform 0.15s ease;
}
.whatsapp-float:hover { transform: scale(1.06); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg-alt);
  color: var(--text);
  padding: 3.5rem 0 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-soft);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; color: var(--heading); font-weight: 700; margin-bottom: 0.75rem; }
.footer-brand img { height: 32px; }

.social-bar { display: flex; gap: 0.8rem; margin-top: 1.1rem; flex-wrap: wrap; }
.social-bar a {
  width: 76px; height: 76px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.social-bar a:hover { transform: translateY(-2px); box-shadow: 6px 6px 14px var(--shadow-dark), -6px -6px 14px var(--shadow-light); }
.social-bar svg { width: 36px; height: 36px; fill: #161c50; }
.site-footer h4 { color: var(--heading); font-size: 0.95rem; margin: 0 0 1rem; }
.site-footer p { font-size: 0.9rem; color: var(--text-muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.6rem; }
.site-footer a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.site-footer a:hover { color: var(--blue-mid); }
.footer-legal {
  border-top: 1px solid var(--border-soft);
  padding-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem;
}

/* ---------- Página de privacidad ---------- */

.legal-doc { padding: 3rem 0 5rem; }
.legal-doc .panel { padding: 2.5rem; max-width: 860px; margin: 0 auto; }
.legal-doc h1 { margin-top: 0; }
.legal-doc h2 { font-size: 1.15rem; margin-top: 2rem; color: var(--heading); }
.legal-doc p, .legal-doc li { color: var(--text-muted); }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .about-grid,
  .contact-grid,
  .footer-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; flex-direction: column; }
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bg);
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-soft);
    gap: 1rem;
  }
  .steps { grid-template-columns: 1fr; }
  .whatsapp-float { right: 1rem; bottom: 1rem; width: 52px; height: 52px; }
}

#contacto { scroll-margin-top: calc(var(--header-h) + 12px); }
#inicio, #beneficios, #como-funciona, #funciones, #faq {
  scroll-margin-top: calc(var(--header-h) + 12px);
}
