/* =============================================================
   1. Tokens — misma paleta que la portada ¡saax
   ============================================================= */
:root {
  color-scheme: dark;
  --ink: #05070f;
  --panel: rgba(17, 23, 41, .62);
  --panel-hi: rgba(28, 36, 61, .72);
  --field: rgba(255, 255, 255, .04);
  --line: rgba(150, 175, 255, .14);
  --line-hi: rgba(170, 195, 255, .30);
  --text: #e9eefb;
  --muted: #8b98b8;
  --soft: #a9c7ff;
  --cyan: #1fd9c4;
  --cobalt: #2d5bff;
  --ember: #ff3d6b;
  --danger: #ff8aa5;
  --danger-soft: rgba(255, 61, 107, .12);
  --warn: #ffd27a;
  --warn-soft: rgba(255, 196, 80, .10);

  --sans: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --display: "Bricolage Grotesque", "Schibsted Grotesk", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 20px;
  --radius-sm: 14px;
  --gutter: 20px;
  --blur: blur(12px);
  --ease-out: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; line-height: 1.08; letter-spacing: -0.02em; }
fieldset { border: 0; padding: 0; min-width: 0; }
option { background: #0d1324; color: var(--text); }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 10px;
}

/* =============================================================
   3. Fondo aurora (igual que la portada)
   ============================================================= */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; display: block; border-radius: 50%; filter: blur(70px); opacity: .72; }
.a1 { width: 620px; height: 620px; top: -200px; left: -180px;
  background: radial-gradient(circle at 50% 50%, var(--cobalt), transparent 68%);
  animation: drift1 24s ease-in-out infinite alternate; }
.a2 { width: 540px; height: 540px; top: 8%; right: -220px;
  background: radial-gradient(circle at 50% 50%, var(--cyan), transparent 66%);
  opacity: .55; animation: drift2 29s ease-in-out infinite alternate; }
.a3 { width: 700px; height: 700px; bottom: -320px; left: 50%; margin-left: -350px;
  background: radial-gradient(circle at 50% 50%, var(--ember), transparent 66%);
  opacity: .5; animation: drift3 33s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate3d(120px, 90px, 0) scale(1.15); } }
@keyframes drift2 { to { transform: translate3d(-140px, 140px, 0) scale(1.1); } }
@keyframes drift3 { to { transform: translate3d(90px, -120px, 0) scale(1.18); } }
.veil { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, transparent 26%, rgba(5, 7, 15, .42) 72%, rgba(5, 7, 15, .8) 100%); }
.site-header, main, .site-footer { position: relative; z-index: 2; }

/* =============================================================
   4. Utilities
   ============================================================= */
.container { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 99;
  padding: .6rem 1rem; background: var(--panel-hi); color: var(--text);
  border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

/* =============================================================
   5. Header / intro
   ============================================================= */
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 800;
  font-size: 1.1rem; letter-spacing: -.01em; text-decoration: none; color: var(--cyan); }
.brand { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.brand-name { color: var(--text); font-size: 1.2rem; }
.byline { font-family: var(--mono); font-weight: 500; font-size: 9.5px; letter-spacing: .06em; color: var(--muted); }
.header-nav { display: flex; align-items: center; gap: 20px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .16em; text-transform: uppercase; }
.header-nav a { text-decoration: none; color: var(--muted); transition: color .18s ease; }
.header-nav a:hover { color: var(--text); }
.header-nav .home {
  text-transform: none; letter-spacing: .04em;
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
}
.header-nav .home:hover { border-color: var(--line-hi); background: var(--panel-hi); }

.intro { padding: 22px 0 18px; text-align: center; }
.eyebrow-top { font-family: var(--mono); font-size: 12px; letter-spacing: .12em;
  color: var(--soft); margin-bottom: 12px; }
h1 { font-size: clamp(30px, 8.4vw, 56px); font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(180deg, #fff 35%, rgba(233, 238, 251, .6));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { color: var(--muted); margin: 10px auto 0; max-width: 40ch; font-size: clamp(15px, 2.4vw, 17px); }

/* =============================================================
   6. Tool card
   ============================================================= */
.tool-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "content" "preview" "design";
  gap: 18px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 30px 70px -36px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.tool-content { grid-area: content; min-width: 0; }
.tool-preview { grid-area: preview; min-width: 0; }
.tool-design  { grid-area: design; min-width: 0; display: grid; gap: 18px; align-content: start; }

.tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  padding: 4px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-bottom: 14px;
}
.tab {
  padding: 9px 4px; border-radius: 10px; font-weight: 600; font-size: .9rem;
  color: var(--muted); transition: background .18s ease, color .18s ease;
}
.tab:hover { color: var(--text); }
.tab[aria-pressed="true"] { background: rgba(255, 255, 255, .10); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }

.field { display: grid; gap: 7px; min-width: 0; }
.field-label, .group legend, .size-pick span {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.field-grid { display: grid; gap: 12px; }
.optional { text-transform: none; letter-spacing: .02em; }

input[type="url"], input[type="text"], input[type="tel"], textarea, select {
  width: 100%; min-width: 0;
  padding: 12px 14px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea { resize: vertical; min-height: 88px; }
input:hover, textarea:hover, select:hover { border-color: var(--line-hi); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: rgba(31, 217, 196, .6); background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 3px rgba(31, 217, 196, .15);
}
input:disabled { opacity: .45; }
::placeholder { color: var(--muted); opacity: .7; }

/* Vista previa: el QR siempre sobre su marco claro para que se lea */
.qr-frame {
  position: relative;
  width: min(100%, 240px);
  margin-inline: auto;
  aspect-ratio: 1;
  border-radius: 16px;
  background: #fff;
  padding: 3px;
  overflow: hidden;
  box-shadow: 0 22px 50px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08);
}
.qr-canvas { width: 100%; height: 100%; border-radius: 13px; overflow: hidden;
  transition: opacity .2s ease, filter .2s ease; }
.qr-canvas canvas, .qr-canvas svg { width: 100% !important; height: 100% !important; }
.qr-hint {
  position: absolute; inset: 0; display: none; place-items: center;
  padding: 18%; text-align: center; font-weight: 600; font-size: .95rem; line-height: 1.3;
  color: #0b1020;
}
.tool-card[data-state="idle"] .qr-canvas,
.tool-card[data-state="error"] .qr-canvas { opacity: .1; filter: blur(1px); }
.tool-card[data-state="idle"] .qr-hint { display: grid; }

.tool-error, .tool-warn {
  display: none; margin-top: 12px; padding: 10px 13px;
  border-radius: 12px; font-size: .86rem; font-weight: 500; line-height: 1.45;
}
.tool-error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(255, 110, 145, .26); }
.tool-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(255, 196, 80, .22); }
.tool-error.is-visible, .tool-warn.is-visible { display: block; }

.actions { display: grid; gap: 8px; margin-top: 14px; }
.actions-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-weight: 600; text-align: center;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, opacity .2s;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary {
  color: #03141a; font-size: 15px; padding-block: 14px;
  background: linear-gradient(100deg, #7df2e4, var(--cyan) 50%, #3fa0ff);
  box-shadow: 0 16px 34px -16px rgba(31, 217, 196, .85);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 22px 44px -18px rgba(31, 217, 196, 1); }
.btn-ghost {
  font-size: .88rem; color: var(--text);
  background: rgba(255, 255, 255, .045); border: 1px solid var(--line);
}
.btn-ghost:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--line-hi); background: rgba(255, 255, 255, .08); }

.size-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.size-pick select { width: auto; padding: 8px 10px; font-size: .86rem; }

.group legend { margin-bottom: 10px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 7px 15px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, .045); font-weight: 500; font-size: .9rem; cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.chip:hover { transform: translateY(-2px); border-color: var(--line-hi); }
.chip[aria-pressed="true"] { background: rgba(31, 217, 196, .14); border-color: rgba(31, 217, 196, .55); color: #fff; }
.chip-emoji { padding-inline: 0; width: 44px; font-size: 1.15rem; }
.chip-upload { border-style: dashed; }
.chip-upload:focus-within { outline: 2px solid var(--cyan); outline-offset: 3px; }
.chip-upload.is-active { border-style: solid; background: rgba(31, 217, 196, .14); border-color: rgba(31, 217, 196, .55); }
.chip-remove { color: var(--danger); }

.colors { display: flex; flex-wrap: wrap; gap: 10px; }
.color {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 15px 5px 5px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .045); font-weight: 500; font-size: .9rem; cursor: pointer;
  transition: border-color .16s ease;
}
.color:hover { border-color: var(--line-hi); }
.color input[type="color"] {
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer; appearance: none; -webkit-appearance: none;
}
.color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line-hi); border-radius: 50%; }
.color input[type="color"]::-moz-color-swatch { border: 1px solid var(--line-hi); border-radius: 50%; }

.privacy-badge {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 16px auto 0; max-width: 760px; font-size: .86rem; color: var(--muted); line-height: 1.55;
}
.privacy-badge svg { flex: none; margin-top: 2px; color: var(--cyan); }
.privacy-badge strong { color: var(--text); font-weight: 600; }

.ad-slot {
  display: grid; place-items: center;
  min-height: 100px; margin: 28px 0;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
}

/* =============================================================
   7. Content sections
   ============================================================= */
.section { padding: 44px 0; }
h2 { font-size: clamp(24px, 4.6vw, 34px); font-weight: 800; margin-bottom: 18px; letter-spacing: -.025em; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }

.steps { list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li {
  padding: 20px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.steps svg { color: var(--cyan); margin-bottom: 12px; }
.steps p { color: var(--muted); margin-top: 6px; font-size: .94rem; }

.prose { max-width: 760px; }
.section-alt .prose {
  padding: 28px 22px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.prose p, .prose ul { color: var(--muted); margin-bottom: 14px; }
.prose h2:not(:first-child) { margin-top: 34px; }
.prose h3 { margin: 24px 0 6px; color: var(--text); }
.prose ul { padding-left: 20px; display: grid; gap: 8px; }
.prose strong { color: var(--text); font-weight: 600; }

.faq { display: grid; gap: 10px; }
.faq details {
  border-radius: var(--radius-sm); padding: 0 18px;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: border-color .18s ease, background .18s ease;
}
.faq details:hover, .faq details[open] { border-color: var(--line-hi); background: var(--panel-hi); }
.faq summary {
  cursor: pointer; padding: 15px 0; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-size: 1.15rem; line-height: 1; color: var(--muted); flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding-bottom: 16px; }

.site-footer { padding: 26px 0 calc(32px + env(safe-area-inset-bottom)); color: var(--muted);
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; }
.footer-row { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
  border-top: 1px solid var(--line); padding-top: 22px; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-row a { text-decoration: none; }
.footer-row a:hover { color: var(--text); }

.legal { padding: 32px var(--gutter) 48px; }
.legal h1 { margin-bottom: 18px; }
.legal .todo {
  padding: 10px 13px; border-radius: 12px;
  background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(255, 196, 80, .22);
  font-weight: 500; font-size: .9rem;
}

/* =============================================================
   8. Entrada suave (misma que la portada)
   ============================================================= */
.rise { animation: rise .6s var(--ease-out) both; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .14s; } .d3 { animation-delay: .23s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* =============================================================
   9. Responsive (mobile-first)
   ============================================================= */
@media (max-width: 539px) {
  .header-nav .hide-sm { display: none; }
  .tab { font-size: .8rem; padding-inline: 2px; }
}
@media (min-width: 540px) {
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-wide { grid-column: 1 / -1; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .intro { padding: 40px 0 30px; }
  .tool-card {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas: "content preview" "design preview";
    grid-template-rows: auto 1fr;
    gap: 24px 30px;
    padding: 26px;
  }
  .tool-preview { align-self: start; }
  .qr-frame { width: 100%; }
  .section { padding: 60px 0; }
  .section-alt .prose { padding: 40px 44px; }
}
@media (min-width: 960px) {
  .tool-card { grid-template-columns: minmax(0, 1fr) 340px; padding: 30px; }
}

/* =============================================================
   10. Reduced motion (solo lo intrusivo)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .rise, .aurora span { animation: none; }
}
