/* QRs Forever. Paleta (contraste medido): tinta #14213d / blanco 15.97; acento #0a7d55 / blanco 5.15,
   / #f4f7f5 4.77; texto secundario #4a5568 / blanco 7.53; aviso #7c2d12 / #fff7ed 8.83; bordes #5b6474. */
:root {
  --ink: #14213d; --muted: #4a5568; --accent: #0a7d55; --accent-dark: #086b49; --bg: #ffffff; --surface: #f4f7f5;
  --tint: #e8f3ee; --line: #5b6474; --soft-line: #d5ddd9; --warn-bg: #fff7ed; --warn: #7c2d12; --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* si no, .placeholder (display: grid) sigue visible con hidden */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 1.0625rem/1.6 var(--font); color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 1.6em 0 0.5em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.75rem); margin-top: 0.4em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p, ul, ol { margin: 0 0 1em; }
.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.narrow { width: min(100% - 2rem, 46rem); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 10; border-radius: 6px; }
.skip:focus { top: 1rem; color: #fff; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* cabecera */
.top { border-bottom: 1px solid var(--soft-line); background: var(--bg); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand img { width: 32px; height: 32px; }
.nav { display: flex; gap: 0.25rem 1rem; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.25rem; color: var(--ink); }
.nav a[aria-current="page"] { font-weight: 700; }
.nav .pro { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 1rem; text-decoration: none; font-weight: 700; }
.lang-short { display: none; }
.nav .pro:hover { background: var(--accent-dark); color: #fff; }

/* portada */
.hero { padding: 1.5rem 0 0.5rem; }
.hero p.lede { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }
.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0.75rem 0 1.25rem; list-style: none; }
.badges li { background: var(--tint); color: var(--ink); border-radius: 999px; padding: 0.3rem 0.85rem; font-size: 0.95rem; font-weight: 600; }

/* generador */
.gen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 23rem); gap: 1.5rem; align-items: start;
  background: var(--surface); border: 1px solid var(--soft-line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 2rem; }
.gen-form { min-width: 0; }
fieldset { border: 0; margin: 0 0 1rem; padding: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: 0.5rem; padding: 0; }
.types { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.types label { position: relative; }
.types input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.types span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; }
.types input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.types input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.field { margin-bottom: 0.9rem; }
.field label, .lbl { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.hint { display: block; color: var(--muted); font-size: 0.92rem; margin-top: 0.25rem; }
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="password"], select, textarea {
  width: 100%; min-height: 44px; padding: 0.55rem 0.75rem; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 8px; }
textarea { min-height: 6rem; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.check { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; font-weight: 600; }
.check input { width: 1.35rem; height: 1.35rem; margin: 0; accent-color: var(--ink); }
details.style { border-top: 1px solid var(--soft-line); padding-top: 0.75rem; margin-top: 0.5rem; }
details.style summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
details.style summary { list-style: none; gap: 0.6rem; }
details.style summary::-webkit-details-marker { display: none; }
details.style summary::before { content: ""; width: 0.55rem; height: 0.55rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); flex: none; }
details.style[open] summary::before { transform: rotate(45deg); }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
input[type="color"] { width: 100%; min-height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input[type="file"] { font: inherit; max-width: 100%; min-height: 44px; }
input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--ink); }
.out { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.preview { background: #fff; border: 1px solid var(--soft-line); border-radius: var(--radius); padding: 0.75rem; aspect-ratio: 1 / 1; display: grid; place-items: center; }
.preview img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.preview img.checker { background: repeating-conic-gradient(#e6e6e6 0 25%, #fff 0 50%) 50% / 20px 20px; }
.placeholder { color: var(--muted); text-align: center; padding: 1rem; border: 2px dashed var(--line); border-radius: 8px; width: 100%; height: 100%; display: grid; place-items: center; margin: 0; }
.status { margin: 0; color: var(--muted); font-size: 0.95rem; min-height: 1.5em; }
.warn { margin: 0; background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 0.6rem 0.8rem; font-size: 0.95rem; }
.dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.1rem; font: inherit; font-weight: 700;
  border-radius: 10px; border: 2px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.ghost { background: #fff; color: var(--accent); }
.btn.ghost:hover { background: var(--tint); color: var(--accent-dark); }
.btn:disabled { background: #fff; color: var(--muted); border-color: var(--soft-line); cursor: not-allowed; }
.small { font-size: 0.92rem; color: var(--muted); margin: 0; }
#logo-controls { margin-bottom: 1rem; }
#ecl-note { margin: -0.5rem 0 0.9rem; }
.noscript { background: var(--warn-bg); color: var(--warn); padding: 1rem; border-radius: 8px; }

/* anuncios: el lugar queda reservado solo cuando hay cuenta de AdSense configurada */
.ad-slot { margin: 0 0 2rem; min-height: 120px; text-align: center; }
.ad-slot .ad-label { display: block; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* contenido */
.content { padding-bottom: 2rem; }
.steps { padding-left: 1.3rem; }
.steps li { margin-bottom: 0.4rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; padding: 0; list-style: none; }
.cards li { border: 1px solid var(--soft-line); border-radius: var(--radius); padding: 1rem 1.1rem; background: #fff; }
.cards h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.cards p { margin: 0; color: var(--muted); }
.compare { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.98rem; }
.compare th, .compare td { border: 1px solid var(--soft-line); padding: 0.6rem 0.7rem; text-align: left; vertical-align: top; }
.compare thead th { background: var(--surface); }
.table-scroll { overflow-x: auto; }
.faq details { border-bottom: 1px solid var(--soft-line); }
.faq summary { cursor: pointer; font-weight: 700; padding: 0.75rem 0; min-height: 44px; }
.faq details p { margin-top: 0; }
.callout { background: var(--tint); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 1.5rem 0; }
.callout p:last-child { margin-bottom: 0; }

/* pro */
.price { font-size: 2.4rem; font-weight: 800; margin: 0; }
.price small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.wl { background: var(--surface); border: 1px solid var(--soft-line); border-radius: var(--radius); padding: 1.25rem; max-width: 34rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* pie */
.foot { background: var(--ink); color: #fff; margin-top: 3rem; padding: 2rem 0 2.5rem; font-size: 0.95rem; }
.foot a { color: #fff; }
.foot a:hover { color: #d9efe6; }
.foot .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.5rem; }
.foot h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li a { display: inline-flex; min-height: 44px; align-items: center; }
.foot .fine { margin-top: 1.5rem; color: #d7dce5; }

@media (max-width: 52rem) {
  .gen { grid-template-columns: 1fr; padding: 1rem; }
  .out { position: static; }
  .preview { max-width: 20rem; margin-inline: auto; width: 100%; }
}
@media (max-width: 30rem) {
  /* cabecera en una sola fila: las secciones están en el pie */
  .top .wrap { flex-wrap: nowrap; gap: 0.5rem; }
  .nav { flex-wrap: nowrap; gap: 0.5rem; }
  .nav .sec, .lang-long { display: none; }
  .lang-short { display: inline; font-weight: 700; }
  .nav a { padding: 0 0.5rem; }
  .nav .pro { padding: 0 0.9rem; }
  .brand { font-size: 1.05rem; }
  .hero { padding-top: 0.75rem; }
  .hero p.lede { font-size: 1.02rem; }
  .badges li { font-size: 0.85rem; padding: 0.2rem 0.7rem; }
  .grid2, .colors { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .top .wrap { padding: 0.25rem 0; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
