/* ============================================
   QR3D — Estilos principales
   ============================================ */

:root {
  --bg: #0f0e17;
  --surface: #1a1928;
  --surface-2: #232235;
  --border: #2e2d42;
  --border-light: #3a3954;
  --text: #e8e6f0;
  --text-muted: #8b89a8;
  --accent: #7c6ff7;
  --accent-2: #f7b731;
  --accent-3: #2dd4bf;
  --danger: #f87171;
  --warn: #fbbf24;
  --ok: #4ade80;
  --sans: 'Inter', system-ui, sans-serif;
  --display: 'Syne', sans-serif;
  --radius: 12px;
  --radius-lg: 18px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.02em; }
input, select, textarea { font: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--accent); color: #fff; z-index: 9999; border-radius: 8px; font-weight: 500; }
.skip-link:focus { top: 1rem; }
.hidden { display: none !important; }

/* ---- Layout ---- */
.container { width: min(100%, 1200px); margin: 0 auto; padding: 0 1.25rem; }

/* ---- Header ---- */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(15,14,23,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: .5rem; }
.logo-icon { display: flex; }
.logo-text { font-family: var(--display); font-size: 1.2rem; letter-spacing: -.03em; }
.logo-text strong { color: var(--accent); }
.site-nav { display: flex; gap: 1.5rem; font-size: .875rem; font-weight: 500; color: var(--text-muted); }
.site-nav a:hover { color: var(--text); }

/* ---- Hero ---- */
.hero { padding: 3.5rem 0 2rem; text-align: center; }
.hero-badge { display: inline-block; margin-bottom: 1rem; padding: .35rem 1rem; background: rgba(124,111,247,.15); border: 1px solid rgba(124,111,247,.3); border-radius: 100px; font-size: .8rem; font-weight: 500; color: var(--accent); }
.hero h1 { font-family: var(--display); font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.05; }
.hero h1 .accent { color: var(--accent); }
.hero-sub { margin: 1rem auto 0; max-width: 600px; color: var(--text-muted); font-size: 1.05rem; }

/* ---- Tool section ---- */
.tool-section { padding: 2rem 0 3rem; }
.tool-layout { display: grid; grid-template-columns: 1fr 380px; gap: 1.5rem; align-items: start; }

/* ---- Panels ---- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.panel-preview { display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 80px; }

/* ---- Steps ---- */
.step-block { padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.step-block:last-child { padding-bottom: 0; border-bottom: none; margin-bottom: 0; }
.step-label { font-weight: 600; font-size: .875rem; color: var(--text-muted); margin-bottom: .9rem; display: flex; align-items: center; gap: .5rem; text-transform: uppercase; letter-spacing: .05em; }
.step-num { width: 22px; height: 22px; background: var(--accent); border-radius: 50%; color: #fff; font-size: .7rem; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* ---- Content tabs ---- */
.content-tabs { display: flex; gap: .5rem; margin-bottom: .75rem; }
.ctab { padding: .4rem .9rem; border: 1px solid var(--border); border-radius: 8px; font-size: .8rem; font-weight: 500; color: var(--text-muted); transition: all .2s; }
.ctab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ctab:hover:not(.active) { border-color: var(--accent); color: var(--text); }
.tab-panel { display: flex; flex-direction: column; gap: .5rem; }

/* ---- Inputs ---- */
.input-field { width: 100%; padding: .65rem .9rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: .95rem; transition: border-color .2s; }
.input-field:focus { outline: none; border-color: var(--accent); }
.input-field::placeholder { color: var(--text-muted); }
.checkbox-row { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--text-muted); cursor: pointer; }
.checkbox-row input { accent-color: var(--accent); }

/* ---- Design row ---- */
.design-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.design-group { display: flex; flex-direction: column; gap: .4rem; }
.design-group.full-width { flex: 1 0 100%; }
.design-group label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---- Color input ---- */
.color-input { width: 52px; height: 40px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; padding: 2px; background: var(--surface-2); }

/* ---- Style selector ---- */
.style-selector { display: flex; gap: .5rem; }
.style-btn { width: 44px; height: 44px; border: 2px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: all .2s; padding: 4px; }
.style-btn:hover { border-color: var(--accent); color: var(--text); }
.style-btn.active { border-color: var(--accent); background: rgba(124,111,247,.15); color: var(--accent); }

/* ---- Logo/emoji ---- */
.logo-row { margin-top: .5rem; }
.center-options { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.emoji-picker { display: flex; gap: .35rem; flex-wrap: wrap; }
.emoji-btn { font-size: 1.3rem; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); transition: all .2s; display: flex; align-items: center; justify-content: center; }
.emoji-btn:hover { border-color: var(--accent); background: rgba(124,111,247,.1); transform: scale(1.1); }
.emoji-btn.active { border-color: var(--accent); background: rgba(124,111,247,.2); }
.upload-btn-label { display: flex; align-items: center; padding: .45rem .85rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; cursor: pointer; transition: all .2s; gap: .35rem; white-space: nowrap; }
.upload-btn-label:hover { border-color: var(--accent); }
.btn-ghost { border: 1px solid var(--border); border-radius: 8px; padding: .4rem .8rem; font-size: .8rem; font-weight: 500; color: var(--text-muted); transition: all .2s; }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-ghost.small { font-size: .78rem; padding: .3rem .65rem; }

/* ---- Format selector ---- */
.format-selector { display: flex; gap: .6rem; margin-bottom: 1rem; }
.format-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .7rem .5rem; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface-2); transition: all .2s; text-align: center; }
.format-btn:hover { border-color: var(--accent); }
.format-btn.active { border-color: var(--accent); background: rgba(124,111,247,.12); }
.format-icon { font-size: 1.4rem; }
.format-name { font-size: .75rem; font-weight: 600; color: var(--text); }
.format-desc { font-size: .65rem; color: var(--text-muted); }

/* ---- Object options ---- */
.object-options { display: flex; flex-direction: column; gap: .75rem; }
.slider-row { display: flex; align-items: center; gap: .75rem; }
.slider { flex: 1; accent-color: var(--accent); }
.slider-label { font-size: .85rem; font-weight: 600; color: var(--accent); min-width: 48px; }

/* ---- Print warnings ---- */
.print-warnings { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; padding: .75rem 1rem; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25); border-radius: 10px; font-size: .82rem; }
.warn-item { display: flex; align-items: flex-start; gap: .4rem; }
.warn-item.error { color: var(--danger); }
.warn-item.warning { color: var(--warn); }
.warn-item.ok { color: var(--ok); }

/* ---- Preview 2D ---- */
.preview-2d-wrap { display: flex; flex-direction: column; gap: .5rem; }
.preview-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; justify-content: space-between; }
.tip { font-weight: 400; font-size: .72rem; }
.qr-preview-box { width: 100%; aspect-ratio: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden; min-height: 200px; }
.qr-preview-box canvas, .qr-preview-box svg { max-width: 100% !important; max-height: 100% !important; }
.qr-placeholder { display: flex; flex-direction: column; align-items: center; gap: .75rem; color: var(--text-muted); font-size: .82rem; text-align: center; }
.download-2d { display: flex; gap: .5rem; }

/* ---- Preview 3D ---- */
.preview-3d-wrap { display: flex; flex-direction: column; gap: .5rem; }
.viewer-3d { width: 100%; aspect-ratio: 4/3; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); position: relative; overflow: hidden; min-height: 200px; }
#three-canvas { width: 100%; height: 100%; border-radius: var(--radius); }
.viewer-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; color: var(--text-muted); font-size: .85rem; }
.loader-spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewer-fallback { padding: 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); font-size: .85rem; color: var(--text-muted); text-align: center; }

/* ---- Download 3D ---- */
.download-3d { display: flex; flex-direction: column; gap: .5rem; }
.btn-primary { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.2rem; background: var(--accent); color: #fff; border-radius: 10px; font-weight: 700; font-size: .95rem; transition: all .2s; }
.btn-primary:hover:not(:disabled) { background: #6a5ef0; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,111,247,.35); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-icon { font-size: 1.1rem; }

/* ---- Privacy badge ---- */
.privacy-badge { font-size: .78rem; color: var(--text-muted); text-align: center; padding: .5rem; }

/* ---- Ad slots ---- */
.ad-slot { display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.02); border: 1.5px dashed var(--border); border-radius: 8px; color: var(--text-muted); font-size: .7rem; font-weight: 600; letter-spacing: .08em; }
.ad-leaderboard { width: 100%; min-height: 90px; margin: 0 0 1rem; }
.ad-incontent { width: 100%; min-height: 90px; margin: 2rem auto; max-width: 728px; }
.ad-popup-slot { min-height: 250px; min-width: 300px; border-radius: 8px; }

/* ---- Download popup ---- */
.ad-popup { border: none; border-radius: var(--radius-lg); padding: 0; background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.7); max-width: 380px; width: 90%; }
.ad-popup::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.ad-popup-inner { padding: 1.5rem; position: relative; }
.ad-popup-close { position: absolute; top: .75rem; right: .75rem; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); color: var(--text-muted); font-size: .85rem; display: flex; align-items: center; justify-content: center; z-index: 1; }
.ad-popup-close:hover { background: var(--border); color: var(--text); }

/* ---- Corner ad ---- */
.ad-corner { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 500; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,.5); max-width: 280px; animation: slideUp .35s var(--ease-out); }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } }
.ad-corner-close { position: absolute; top: .4rem; right: .4rem; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--text-muted); font-size: .7rem; display: flex; align-items: center; justify-content: center; }
.ad-corner-close:hover { background: var(--border); }
.ad-corner-inner { padding: .75rem 1rem; display: flex; flex-direction: column; gap: .4rem; }
.ad-corner-label { font-size: .65rem; font-weight: 700; letter-spacing: .08em; color: var(--text-muted); }

/* ---- Sections ---- */
.section-steps, .section-ideas, .section-seo, .section-faq { padding: 4rem 0; }
.section-steps { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-ideas { background: var(--bg); }
.section-seo { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-faq { background: var(--bg); }

h2 { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 2rem; }
.section-sub { color: var(--text-muted); margin-top: -.75rem; margin-bottom: 2rem; max-width: 700px; }

.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.step-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; }
.step-icon { font-size: 2.2rem; margin-bottom: .75rem; }
.step-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.step-card p { color: var(--text-muted); font-size: .9rem; }

.ideas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.idea-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; transition: border-color .2s; }
.idea-card:hover { border-color: var(--accent); }
.idea-icon { font-size: 1.8rem; margin-bottom: .6rem; }
.idea-card h3 { font-size: 1rem; margin-bottom: .4rem; }
.idea-card p { color: var(--text-muted); font-size: .85rem; }

.section-seo p { max-width: 760px; margin-bottom: 1rem; color: var(--text-muted); line-height: 1.8; }
.section-seo p strong { color: var(--text); }

.faq-list { max-width: 760px; display: flex; flex-direction: column; gap: .75rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-item summary { padding: 1rem 1.25rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--accent); transition: transform .2s; flex-shrink: 0; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 1.25rem 1rem; color: var(--text-muted); font-size: .9rem; line-height: 1.7; }

/* ---- Footer ---- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 2rem 0; }
.footer-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.footer-nav { display: flex; gap: 1.25rem; font-size: .82rem; color: var(--text-muted); }
.footer-copy { font-size: .78rem; color: var(--text-muted); }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .tool-layout { grid-template-columns: 1fr; }
  .panel-preview { position: static; }
}
@media (max-width: 720px) {
  .site-nav { display: none; }
  .format-selector { flex-direction: column; }
  .format-btn { flex-direction: row; justify-content: flex-start; text-align: left; gap: .75rem; }
  .format-name, .format-desc { text-align: left; }
  .hero { padding: 2.5rem 0 1.5rem; }
}
@media (max-width: 540px) {
  .design-row { flex-direction: column; }
  .style-selector { gap: .35rem; }
  .style-btn { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .loader-spinner { animation: none; border-top-color: var(--accent); }
  .ad-corner { animation: none; }
  * { transition-duration: .01ms !important; }
}
