/* MercaConstanza - portal de descarga.
   Identidad compartida con Desktop/Resources/Colors.xaml: verde de marca,
   acento amarillo, superficies crema y tarjetas blancas. */

:root {
  --accion: #0F7A43;
  --accion-hover: #14904F;
  --accion-borde: #0B5C33;
  --accion-tint: #EAF4EE;
  --oscuro: #0B3D25;
  --oscuro-2: #123121;
  --fondo: #EFECE4;
  --marfil: #FAF8F3;
  --borde: #D8D2C6;
  --texto: #1C2530;
  --texto-2: #3E4854;
  --texto-muted: #6B7480;
  --blanco: #FFFFFF;
  --acento: #F2C230;
  --rojo: #C0392B;
  --radio: 10px;
  --sombra: 0 1px 2px rgba(28, 37, 48, .06), 0 8px 24px rgba(28, 37, 48, .06);
  --sombra-fuerte: 0 24px 60px rgba(0, 0, 0, .45);
  --ancho: 1120px;
}

* { box-sizing: border-box; }

/* Varias clases declaran display:flex/grid, que le gana al atributo [hidden]
   y dejaria visibles bloques que el JS cree ocultos. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.125rem, 4.8vw, 3rem); }
h2 { font-size: clamp(1.45rem, 2.7vw, 1.9375rem); }
h3 { font-size: 1.0625rem; }
p { margin: 0 0 1rem; }
a { color: var(--accion-borde); }
img { max-width: 100%; height: auto; }

/* Sprite de iconos: fuera de pantalla, nunca display:none (romperia <use>). */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.wrap { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--blanco); color: var(--texto);
  padding: 12px 16px; z-index: 100; border-radius: 0 0 var(--radio) 0;
}
.skip-link:focus { left: 0; }

:where(a, button, summary, details, video):focus-visible {
  outline: 3px solid var(--accion);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Animaciones de entrada: discretas y a prueba de fallos. El contenido solo se
   oculta si el JS confirmo que puede volver a mostrarlo (clase en <html>) -
   sin JS, o si algo falla antes del observer, todo queda visible. */
.con-animaciones .reveal { opacity: 0; transform: translateY(12px); }
.con-animaciones .reveal.visible {
  opacity: 1; transform: none;
  transition: opacity .5s ease, transform .5s ease;
}

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--oscuro);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.header-inner { display: flex; align-items: center; gap: 16px; min-height: 62px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--blanco); text-decoration: none;
  font-weight: 650; font-size: 1.0625rem; letter-spacing: -.01em;
  margin-right: auto;
}
.brand img { border-radius: 7px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: #EAF4EE; text-decoration: none;
  padding: 10px 12px; border-radius: 8px; font-size: .9375rem;
  transition: color .15s ease, background-color .15s ease;
}
.nav a:hover { color: var(--blanco); background: rgba(255, 255, 255, .07); }
.nav a.btn { margin-left: 8px; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px; margin-left: auto;
  background: transparent; border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle-bar { display: block; width: 18px; height: 2px; background: var(--blanco); }

/* ---------- botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: 1px solid transparent; border-radius: 9px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  padding: 12px 20px;
  transition: background-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.btn-primary {
  background: var(--accion); color: var(--blanco);
  box-shadow: 0 6px 16px rgba(15, 122, 67, .28);
}
.btn-primary:hover { background: var(--accion-borde); transform: translateY(-1px); }
.btn-primary:active { background: var(--accion-borde); transform: none; }
/* Acento amarillo sobre superficies verdes oscuras, como en el AppShell. */
.hero .btn-primary, .nav .btn-primary, .cta-final .btn-primary {
  background: var(--acento); color: var(--oscuro-2);
  box-shadow: 0 6px 16px rgba(242, 194, 48, .16);
}
.hero .btn-primary:hover, .nav .btn-primary:hover, .cta-final .btn-primary:hover {
  background: var(--acento); filter: brightness(.95);
}
.hero .btn-primary:active, .nav .btn-primary:active, .cta-final .btn-primary:active {
  background: var(--acento); filter: brightness(.9);
}
.hero :focus-visible, .site-header :focus-visible, .cta-final :focus-visible, .site-footer :focus-visible {
  outline-color: var(--acento);
}
.btn-ghost { background: var(--blanco); color: var(--texto-2); border-color: var(--borde); }
.btn-ghost:hover { background: var(--marfil); }
.btn-sm { padding: 8px 14px; font-size: .9375rem; box-shadow: none; }
.btn-lg { padding: 15px 28px; font-size: 1.0625rem; }

/* ---------- hero ---------- */

.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--oscuro) 0%, var(--oscuro-2) 100%);
  color: var(--blanco);
  padding: clamp(44px, 6.5vw, 80px) 0;
}
/* Halo verde de marca detras del visual. */
.hero::after {
  content: ""; position: absolute; z-index: 0;
  width: 620px; height: 620px; right: -180px; top: -220px;
  background: radial-gradient(circle, rgba(15, 122, 67, .28) 0%, rgba(15, 122, 67, 0) 68%);
  pointer-events: none;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; gap: clamp(28px, 4vw, 56px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  align-items: center;
}
.hero-grid.sin-captura { grid-template-columns: minmax(0, 1fr); max-width: 760px; }

.eyebrow {
  margin: 0 0 .75rem; font-size: .8125rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--acento);
}
.hero h1 { color: var(--blanco); }
.hero-sub {
  font-size: clamp(1.0625rem, 2vw, 1.3125rem);
  color: #EAF4EE; margin-bottom: .875rem; font-weight: 500;
}
.hero-text { color: #EAF4EE; max-width: 52ch; margin-bottom: 1.75rem; }
.hero-cta { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.hero-meta {
  margin: 0; color: #EAF4EE; font-size: .9375rem;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.version-chip {
  display: inline-flex; align-items: center;
  background: rgba(15, 122, 67, .22);
  border: 1px solid rgba(143, 191, 164, .4);
  color: #EAF4EE;
  border-radius: 999px; padding: 3px 11px;
  font-size: .8125rem; font-weight: 600;
}

.hero-shot { margin: 0; min-width: 0; }

/* Marco tipo ventana de aplicacion: sirve tanto para la composicion con el
   icono como para la captura real cuando exista. */
.app-frame {
  border-radius: 14px; overflow: hidden;
  background: #123121;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: var(--sombra-fuerte);
}
.app-frame-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; background: rgba(255, 255, 255, .06);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.app-frame-bar span {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
}
.app-frame-body {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: clamp(34px, 5vw, 56px) 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(15, 122, 67, .22) 0%, rgba(15, 122, 67, 0) 60%),
    linear-gradient(180deg, #0B3D25 0%, #123121 100%);
  text-align: center;
}
.app-frame-body.con-captura { padding: 0; display: block; }
.app-frame-body.con-captura img { display: block; width: 100%; }

.hero-icon { width: clamp(96px, 12vw, 128px); height: auto; }
.hero-icon-name {
  margin: 10px 0 0; color: var(--blanco);
  font-size: 1.125rem; font-weight: 650; letter-spacing: -.01em;
}
.hero-icon-sub { margin: 0; color: #8FBFA4; font-size: .875rem; }

/* ---------- secciones ---------- */

.section { padding: clamp(44px, 5.5vw, 68px) 0; }
.section-alt { background: var(--marfil); }
.section-lead { color: var(--texto-2); max-width: 62ch; margin-bottom: 1.75rem; }

/* ---------- video demo ---------- */

.video-card {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--borde); background: #123121;
  box-shadow: var(--sombra);
}
.video-card video { display: block; width: 100%; height: auto; }

/* ---------- galeria ---------- */

.shots {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.shots figure { margin: 0; }
.shots img {
  display: block; width: 100%; border-radius: var(--radio);
  border: 1px solid var(--borde); background: var(--blanco);
  box-shadow: var(--sombra);
}
.shots figcaption {
  margin-top: 8px; font-size: .875rem; font-weight: 600; color: var(--texto-2);
}

/* ---------- cards de funciones ---------- */

.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.card {
  background: var(--blanco); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 18px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.card:hover {
  border-color: #BFDCCB;
  box-shadow: 0 8px 22px rgba(28, 37, 48, .08);
  transform: translateY(-3px);
}
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin-bottom: 12px;
  border-radius: 10px; background: var(--accion-tint); color: var(--accion-hover);
}
.card-icon svg, .req-icon svg, .download-badge svg, .verified svg, .alert-icon svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.card h3 { margin-bottom: 4px; }
.card p { margin: 0; color: var(--texto-muted); font-size: .9375rem; }

/* ---------- card de descarga ---------- */

.download-card {
  background: var(--blanco); border: 1px solid var(--borde);
  border-radius: 14px; padding: 20px 22px 22px;
  box-shadow: var(--sombra);
}
.download-badge {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 0 0 14px; padding: 5px 11px;
  border-radius: 999px; background: var(--accion-tint); color: var(--accion-borde);
  font-size: .8125rem; font-weight: 650;
}
.download-main {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 18px 24px;
}
.download-facts { display: flex; flex-wrap: wrap; gap: 26px; margin: 0; }
.fact dt {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--texto-muted); margin-bottom: 1px;
}
.fact dd { margin: 0; font-size: 1.125rem; font-weight: 650; }
[data-loading] { color: var(--texto-muted); font-weight: 500; }

.download-trust {
  margin: 14px 0 0; font-size: .875rem; color: var(--texto-muted);
}

.status {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 0; padding: 10px 13px;
  border-radius: 8px; font-size: .9375rem;
  background: var(--accion-tint); color: var(--accion-borde);
}
.status-error { background: #FBF0EE; color: var(--rojo); }

.details { margin-top: 14px; border-top: 1px solid var(--borde); padding-top: 12px; }
.details summary { cursor: pointer; padding: 2px 0; }
.verified {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .9375rem; color: var(--accion-borde);
}
.verified svg { color: var(--accion); }
.details-body { padding-top: 12px; }
.details-note { font-size: .875rem; color: var(--texto-muted); }
.details-note-muted code {
  background: var(--fondo); padding: 2px 6px; border-radius: 4px;
  color: var(--texto-2);
  font-size: .8125rem; word-break: break-all;
}
.hash-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.hash {
  flex: 1 1 300px; min-width: 0;
  background: var(--fondo); border: 1px solid var(--borde);
  border-radius: 8px; padding: 9px 12px;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: .8125rem; word-break: break-all; color: var(--texto-2);
}

.release-notes {
  margin-top: 18px; padding: 18px;
  background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio);
}
.release-notes h3 { margin-bottom: 6px; }
.release-notes p { margin: 0; color: var(--texto-muted); }

/* ---------- pasos de instalacion ---------- */

.steps {
  list-style: none; counter-reset: paso; margin: 0 0 22px; padding: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.step {
  position: relative; counter-increment: paso;
  background: var(--marfil); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 16px 18px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.step:hover { border-color: #BFDCCB; box-shadow: 0 6px 16px rgba(28, 37, 48, .06); }
.step::before {
  content: counter(paso);
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-bottom: 10px;
  border-radius: 50%;
  background: var(--accion); color: var(--blanco);
  font-size: .8125rem; font-weight: 700;
  box-shadow: 0 0 0 4px var(--accion-tint);
}
.step h3 { font-size: 1rem; margin-bottom: 2px; }
.step p { margin: 0; color: var(--texto-2); font-size: .9375rem; }

/* Ultimo paso: cierra la secuencia en vez de quedar como card huerfana. */
.step-final { background: var(--accion-tint); border-color: #BFDCCB; }
.step-final::before { background: var(--accion); box-shadow: 0 0 0 4px rgba(255, 255, 255, .7); }

/* ---------- alerta smartscreen (temporal) ---------- */

.alert-note {
  border: 1px solid #BFDCCB; border-left: 4px solid var(--accion);
  border-radius: var(--radio); background: #EAF4EE; padding: 14px 16px;
}
.alert-note summary {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; color: var(--texto);
}
.alert-note summary strong { display: block; font-size: .9375rem; }
.alert-hint { display: block; font-size: .8125rem; color: var(--texto-2); }
.alert-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accion-tint); color: var(--accion-hover);
}
.alert-body { padding: 12px 0 0 46px; }
.alert-body p { color: var(--texto-2); font-size: .9375rem; }
.alert-steps {
  margin: 0 0 .75rem; padding-left: 20px;
  color: var(--texto-2); font-size: .9375rem;
}
.alert-steps li { margin-bottom: 5px; }
.alert-foot { margin: 0; font-size: .875rem; color: var(--texto-muted); }

/* ---------- requisitos ---------- */

.reqs {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.reqs li {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--blanco); border: 1px solid var(--borde);
  border-radius: 8px; padding: 12px 14px; color: var(--texto-2);
  font-size: .9375rem;
}
.req-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--accion-tint); color: var(--accion-hover);
}

/* ---------- cta final ---------- */

.cta-final {
  position: relative; overflow: hidden;
  background: var(--oscuro); color: var(--blanco);
  padding: clamp(34px, 4.5vw, 56px) 0;
}
.cta-final::after {
  content: ""; position: absolute; z-index: 0;
  width: 520px; height: 520px; left: -140px; bottom: -320px;
  background: radial-gradient(circle, rgba(15, 122, 67, .25) 0%, rgba(15, 122, 67, 0) 68%);
  pointer-events: none;
}
.cta-inner {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 20px 32px;
}
.cta-final h2 { color: var(--blanco); margin-bottom: .25em; }
.cta-final p { margin: 0; color: #EAF4EE; }

/* ---------- footer ---------- */

.site-footer { background: var(--oscuro-2); color: #EAF4EE; padding: 36px 0 28px; }
.footer-inner {
  display: grid; gap: 24px 40px;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  align-items: start;
}
.footer-col { min-width: 0; }
.footer-brand {
  display: flex; align-items: center; gap: 9px;
  color: var(--blanco); font-weight: 650; margin: 0 0 8px;
}
.footer-brand img { border-radius: 6px; }
.footer-title { color: var(--blanco); font-weight: 600; font-size: .9375rem; margin: 0 0 8px; }
.footer-muted { color: #8FBFA4; font-size: .9375rem; margin: 0; max-width: 46ch; }
.footer-version { margin-top: 6px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 5px; }
.site-footer a { color: var(--acento); }
.footer-copy {
  grid-column: 1 / -1;
  margin: 0; color: #8FBFA4; font-size: .875rem;
  padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1);
}

/* ---------- responsive ---------- */

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-shot { order: 2; }
  .hero::after { display: none; }
}

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--oscuro); padding: 12px 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px; }
  .nav a.btn { margin: 6px 0 0; justify-content: center; }
  .site-header { position: relative; }

  .btn-lg { width: 100%; }
  .hero-cta { align-self: stretch; width: 100%; }
  .download-main { flex-direction: column; align-items: stretch; }
  .download-facts { gap: 16px; }
  .download-main .btn { width: 100%; }
  .cta-inner .btn { width: 100%; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .alert-body { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.visible { opacity: 1; transform: none; transition: none; }
  .card, .step, .btn, .nav a { transition: none; }
  .card:hover, .btn-primary:hover { transform: none; }
}
