/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #faf9f6;
  --bg-alt: #f1efe9;
  --card: #ffffff;
  --text: #1b1a1f;
  --text-soft: #5b5866;
  --border: #e4e1d9;
  --accent: #7c5cff;
  --accent-ink: #ffffff;
  --accent-soft: #efeaff;
  --warn: #b8590a;
  --warn-bg: #fff3e6;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --ok: #1a8a5f;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --sans-alt: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 1px 2px rgba(20,16,32,.04), 0 8px 24px rgba(20,16,32,.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141018;
    --bg-alt: #1a1620;
    --card: #1e1a26;
    --text: #f3f1f7;
    --text-soft: #a9a4b6;
    --border: #322c3c;
    --accent: #9c85ff;
    --accent-ink: #14101c;
    --accent-soft: #2a2338;
    --warn-bg: #3a2a12;
    --danger-bg: #3a1f1c;
    --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans-alt);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.1; letter-spacing: -0.02em; font-family: var(--sans); }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.is-hidden { display: none !important; }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--accent); color: var(--accent-ink);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.container { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 1.25rem; }

/* =============================================================
   3. Header / footer
   ============================================================= */
.site-header { padding-block: 1.1rem; border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: .5rem; font-family: var(--sans); font-weight: 800; font-size: 1.05rem; color: var(--text); }
.logo svg { color: var(--accent); }
.header-nav { display: none; gap: 1.6rem; font-weight: 600; font-size: .92rem; color: var(--text-soft); }
.header-nav a { transition: color .2s var(--ease-out); }
.header-nav a:hover { color: var(--text); }
@media (min-width: 720px) { .header-nav { display: flex; } }

.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding-block: 1.6rem; color: var(--text-soft); font-size: .88rem; }
.footer-row { display: flex; flex-direction: column; gap: .8rem; align-items: flex-start; }
@media (min-width: 720px) { .footer-row { flex-direction: row; justify-content: space-between; align-items: center; } }
.footer-links { display: flex; gap: 1.2rem; }
.footer-links a:hover { color: var(--text); }

/* =============================================================
   4. Hero
   ============================================================= */
.hero { padding-block: 2.2rem 1.4rem; text-align: center; }
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); max-width: 22ch; margin-inline: auto; }
.hero-sub { margin-top: .7rem; color: var(--text-soft); font-size: 1.02rem; max-width: 46ch; margin-inline: auto; }

/* =============================================================
   5. Tool card
   ============================================================= */
.tool-section { padding-block: .5rem 1.6rem; }
.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.1rem;
}
@media (min-width: 720px) { .tool-card { padding: 1.6rem; } }

.tool-grid { display: grid; gap: 1.6rem; grid-template-columns: 1fr; }
@media (min-width: 960px) { .tool-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }

.ctrl-block { margin-bottom: 1.1rem; }
.ctrl-block.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.field-label { display: block; font-size: .82rem; font-weight: 700; color: var(--text-soft); margin-bottom: .35rem; }
.field-input {
  width: 100%; padding: .68rem .8rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: .95rem; font-family: inherit;
  transition: border-color .15s var(--ease-out);
}
.field-input:focus { border-color: var(--accent); }
select.field-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-soft) 50%), linear-gradient(135deg, var(--text-soft) 50%, transparent 50%); background-position: calc(100% - 18px) center, calc(100% - 13px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }

.checkbox-row { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; font-size: .9rem; color: var(--text-soft); }

.ctrl-tabs { display: flex; gap: .4rem; margin-bottom: .9rem; background: var(--bg-alt); padding: .3rem; border-radius: var(--radius-sm); }
.ctrl-tab { flex: 1; padding: .5rem .6rem; border-radius: 8px; font-weight: 700; font-size: .86rem; color: var(--text-soft); transition: all .15s var(--ease-out); }
.ctrl-tab.is-active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.style-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
@media (min-width: 480px) { .style-grid { grid-template-columns: repeat(4, 1fr); } }
.style-opt { padding: .55rem .4rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .82rem; font-weight: 600; text-align: center; transition: all .15s var(--ease-out); }
.style-opt.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.style-opt:hover { border-color: var(--accent); }

.color-input { width: 100%; height: 42px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 3px; background: var(--bg); cursor: pointer; }

.center-row { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: .35rem; }
.emoji-opt { font-size: 1.2rem; width: 38px; height: 38px; border: 1.5px solid var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; transition: all .15s var(--ease-out); }
.emoji-opt:hover, .emoji-opt.is-active { border-color: var(--accent); background: var(--accent-soft); }
.center-actions { display: flex; gap: .5rem; margin-left: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .78rem 1.3rem; border-radius: 999px; font-weight: 700; font-size: .92rem; transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), opacity .15s var(--ease-out); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(124,92,255,.35); }
.btn-secondary { background: var(--bg-alt); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; border: 1.5px solid var(--border); color: var(--text-soft); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-sm { padding: .5rem .9rem; font-size: .82rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.privacy-note { font-size: .82rem; color: var(--text-soft); margin-top: .4rem; }
.limits-note { font-size: .78rem; color: var(--text-soft); margin-top: 1.2rem; text-align: center; }
.btn-reset { display: block; margin: .6rem auto 0; font-size: .85rem; font-weight: 700; color: var(--accent); }
.btn-reset:hover { text-decoration: underline; }

/* --- preview column --- */
.preview-tabs { display: flex; gap: .4rem; margin-bottom: .9rem; background: var(--bg-alt); padding: .3rem; border-radius: var(--radius-sm); }
.preview-tab { flex: 1; padding: .55rem .6rem; border-radius: 8px; font-weight: 700; font-size: .86rem; color: var(--text-soft); transition: all .15s var(--ease-out); }
.preview-tab.is-active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.qr-stage { display: flex; align-items: center; justify-content: center; background: var(--bg-alt); border-radius: var(--radius-sm); padding: 1.2rem; min-height: 260px; }
.qr-canvas-wrap { display: flex; align-items: center; justify-content: center; }
.qr-canvas-wrap canvas, .qr-canvas-wrap svg { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 2px 14px rgba(0,0,0,.1); }

.three-stage { position: relative; background: var(--bg-alt); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 1rem; }
.three-viewport { width: 100%; height: 300px; touch-action: none; }
.three-viewport canvas { width: 100% !important; height: 100% !important; }
.three-hint { position: absolute; bottom: .6rem; left: 50%; transform: translateX(-50%); font-size: .74rem; color: var(--text-soft); background: var(--card); padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border); pointer-events: none; }
.three-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1.5rem; font-size: .88rem; color: var(--text-soft); }

.download-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

.print-warnings { margin-top: .8rem; display: flex; flex-direction: column; gap: .4rem; }
.pw-item { font-size: .82rem; padding: .5rem .7rem; border-radius: var(--radius-sm); display: flex; gap: .5rem; align-items: flex-start; }
.pw-ok { background: var(--accent-soft); color: var(--text-soft); }
.pw-warn { background: var(--warn-bg); color: var(--warn); }
.pw-danger { background: var(--danger-bg); color: var(--danger); }

/* =============================================================
   6. Ad slots
   ============================================================= */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, var(--bg-alt), var(--bg-alt) 10px, var(--card) 10px, var(--card) 20px);
  border: 1.5px dashed var(--border);
  color: var(--text-soft);
  font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
/* PEGA AQUÍ TU CÓDIGO DE ADSENSE (dentro de cada .ad-slot) */
.ad-leaderboard { max-width: 1080px; margin: 1.6rem auto; min-height: 90px; border-radius: var(--radius-sm); }
.ad-incontent { max-width: 728px; margin: 1.6rem auto; min-height: 100px; border-radius: var(--radius-sm); }

.ad-popup { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; max-width: 420px; width: 90vw; box-shadow: var(--shadow-card); background: var(--card); color: var(--text); }
.ad-popup::backdrop { background: rgba(10,8,16,.55); }
.ad-popup-close { position: absolute; top: .6rem; right: .8rem; font-size: 1.4rem; line-height: 1; color: var(--text-soft); }
.ad-popup-slot { min-height: 250px; width: 100%; border-radius: var(--radius-sm); margin-block: .6rem; }
.ad-popup-btn { width: 100%; }

.ad-corner { position: fixed; bottom: 1rem; right: 1rem; z-index: 500; width: 260px; }
.ad-corner-slot { min-height: 90px; border-radius: var(--radius-sm); box-shadow: var(--shadow-card); }
.ad-corner-close { position: absolute; top: -.5rem; right: -.5rem; width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: var(--bg); font-size: 1rem; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-card); }
@media (max-width: 539px) { .ad-corner { width: calc(100vw - 2rem); right: 1rem; left: 1rem; } }

/* =============================================================
   7. Content sections
   ============================================================= */
.section { padding-block: 2.2rem; }
.section h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 1.2rem; text-align: center; }

.steps-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: .8rem; }
.step-card h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.step-card p { color: var(--text-soft); font-size: .92rem; }

.seo-copy { max-width: 760px; }
.seo-copy p { color: var(--text-soft); margin-bottom: 1rem; }
.seo-copy strong { color: var(--text); }

.usecase-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 540px) { .usecase-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .usecase-grid { grid-template-columns: repeat(3, 1fr); } }
.usecase-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.usecase-emoji { font-size: 1.6rem; margin-bottom: .6rem; }
.usecase-card h3 { font-size: 1rem; margin-bottom: .35rem; }
.usecase-card p { color: var(--text-soft); font-size: .88rem; }

.faq-list { max-width: 760px; margin-inline: auto; display: flex; flex-direction: column; gap: .6rem; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .2rem .3rem; }
.faq-item summary { cursor: pointer; padding: .9rem 1rem; font-weight: 700; font-size: .96rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.2rem; color: var(--accent); flex-shrink: 0; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { padding: 0 1rem 1rem; color: var(--text-soft); font-size: .9rem; }

/* =============================================================
   8. Legal pages
   ============================================================= */
.legal-page { max-width: 760px; margin-inline: auto; padding-block: 2.5rem; }
.legal-page h1 { font-size: 1.7rem; margin-bottom: 1rem; }
.legal-page h2 { font-size: 1.15rem; margin-top: 1.6rem; margin-bottom: .5rem; }
.legal-page p, .legal-page li { color: var(--text-soft); margin-bottom: .7rem; }
.legal-page .todo { background: var(--warn-bg); color: var(--warn); padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .85rem; margin-bottom: 1rem; }

/* =============================================================
   9. Responsive niceties
   ============================================================= */
@media (min-width: 1280px) {
  .container { padding-inline: 0; }
}
