/* =============================================================
   PDFConverter · styles.css
   1. Tokens · 2. Reset · 3. Utilities · 4. Typography
   5. Components · 6. Sections · 7. Ad slots · 8. Cookie banner
   9. Responsive · 10. Reduced-motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --ink:        #101826;
  --ink-soft:   #3c4a5f;
  --muted:      #64748b;
  --line:       #e2e8f0;
  --line-soft:  #eef2f7;
  --bg:         #f7f9fc;
  --surface:    #ffffff;
  --surface-2:  #eef3fb;

  --accent:     #1668e3;
  --accent-2:   #3fb6a8;
  --accent-ink: #0d4fb0;
  --accent-wash:#e7f0fe;

  --good:       #12875a;
  --good-wash:  #e3f6ee;
  --warn:       #b5730b;
  --warn-wash:  #fbf0dc;
  --bad:        #d5433f;
  --bad-wash:   #fce9e8;

  --radius:     14px;
  --radius-sm:  9px;
  --radius-lg:  22px;
  --shadow-sm:  0 1px 2px rgba(16,24,38,.06), 0 2px 8px rgba(16,24,38,.04);
  --shadow-md:  0 6px 22px rgba(16,24,38,.10), 0 2px 8px rgba(16,24,38,.05);
  --shadow-lg:  0 20px 55px rgba(13,79,176,.16), 0 8px 22px rgba(16,24,38,.08);

  --gutter:     clamp(1.1rem, 4vw, 2.4rem);
  --maxw:       1180px;

  --sans:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Manrope", var(--sans);
  --mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #eef2f8;
    --ink-soft:   #c3cddb;
    --muted:      #93a1b6;
    --line:       #263041;
    --line-soft:  #1c2432;
    --bg:         #0b1220;
    --surface:    #131b2b;
    --surface-2:  #182234;

    --accent:     #5b9dff;
    --accent-2:   #5fd0c0;
    --accent-ink: #9dc4ff;
    --accent-wash:#16233b;

    --good-wash:  #0f2a20;
    --warn-wash:  #2c2110;
    --bad-wash:   #301a19;

    --shadow-sm:  0 1px 2px rgba(0,0,0,.4);
    --shadow-md:  0 8px 26px rgba(0,0,0,.45);
    --shadow-lg:  0 26px 64px rgba(0,0,0,.55);
  }
}

/* =============================================================
   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);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; line-height: 1.1; letter-spacing: -0.01em; font-weight: 700; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--accent); color: #fff; z-index: 9999; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 1rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 600; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); }
.section { padding-block: clamp(2.4rem, 6vw, 4.2rem); }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* =============================================================
   4. Typography
   ============================================================= */
.h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
.h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 1rem; }
.h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.lead { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--ink-soft); }
.prose h2 { margin-top: 2.2rem; }
.prose p, .prose li { color: var(--ink-soft); margin-bottom: .9rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin-bottom: 1rem; }

/* =============================================================
   5. Components
   ============================================================= */

/* -- Header / nav -- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .85rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.brand svg { width: 30px; height: 30px; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; font-weight: 600; font-size: .94rem; }
.nav-links a:hover { color: var(--accent-ink); }
.nav-toggle { display: none; }

/* -- Buttons -- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.3rem; border-radius: var(--radius-sm); font-weight: 700; font-size: .96rem; transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s var(--ease-out); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-ink); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: var(--line-soft); }
.btn-lg { padding: 1rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* -- Tool card -- */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.2rem, 3vw, 2rem);
  max-width: 640px;
  margin-inline: auto;
}
.tool-body { display: none; }
.tool-card[data-state="idle"] .tool-body.is-idle,
.tool-card[data-state="loading-engine"] .tool-body.is-loading,
.tool-card[data-state="working"] .tool-body.is-loading,
.tool-card[data-state="done"] .tool-body.is-done,
.tool-card[data-state="error"] .tool-body.is-error { display: block; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .7rem; text-align: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: clamp(1.8rem, 5vw, 2.8rem) 1.2rem;
  cursor: pointer;
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out);
  background: var(--surface-2);
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: var(--accent-wash); }
.dropzone-icon { width: 44px; height: 44px; color: var(--accent); }
.dropzone-title { font-weight: 700; font-size: 1.05rem; }
.dropzone-sub { color: var(--muted); font-size: .9rem; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.progress-track { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; margin-top: 1rem; }
.progress-fill { height: 100%; width: 8%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .3s var(--ease-out); }
.loading-label { margin-top: .8rem; font-size: .92rem; color: var(--muted); text-align: center; }

.tool-result { text-align: center; }
.tool-result-icon { width: 52px; height: 52px; margin-inline: auto .8rem; color: var(--good); }
.tool-file-meta { color: var(--muted); font-size: .92rem; margin-bottom: 1.1rem; word-break: break-word; }
.tool-reset { display: inline-block; margin-top: 1rem; font-size: .9rem; color: var(--muted); text-decoration: underline; }
.tool-reset:hover { color: var(--accent-ink); }

.tool-error { text-align: center; }
.tool-error-icon { width: 46px; height: 46px; margin-inline: auto .8rem; color: var(--bad); }
.tool-error-msg { color: var(--ink-soft); margin-bottom: 1.1rem; }

.privacy-badge {
  display: flex; align-items: center; gap: .6rem;
  margin-top: 1.1rem; padding: .75rem 1rem;
  background: var(--good-wash); border-radius: var(--radius-sm);
  font-size: .88rem; color: var(--ink-soft);
}
.privacy-badge svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--good); }
.tool-limits { margin-top: .7rem; font-size: .82rem; color: var(--muted); text-align: center; }

/* -- Cards / grid -- */
.grid { display: grid; gap: 1.2rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-icon { width: 34px; height: 34px; color: var(--accent); margin-bottom: .7rem; }
.card-title { font-weight: 700; margin-bottom: .3rem; }
.card-desc { color: var(--muted); font-size: .92rem; }

/* -- Steps -- */
.steps { display: grid; gap: 1.4rem; }
.step { display: flex; gap: 1rem; align-items: flex-start; }
.step-num {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-wash); color: var(--accent-ink); font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-family: var(--display);
}

/* -- FAQ -- */
.faq-item { border-bottom: 1px solid var(--line); padding-block: 1rem; }
.faq-item summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--accent); flex-shrink: 0; transition: transform .2s var(--ease-out); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: .7rem; color: var(--ink-soft); }

/* =============================================================
   6. Sections
   ============================================================= */
.hero { padding-block: clamp(1.8rem, 5vw, 3rem) clamp(1.2rem, 3vw, 2rem); text-align: center; }
.hero .h1 { max-width: 20ch; margin-inline: auto; }
.hero .lead { max-width: 46ch; margin: .9rem auto 1.8rem; }

.no-js-note { display: none; }
.no-js .tool-body { display: none !important; }
.no-js .no-js-note { display: block; text-align: center; padding: 2rem 1rem; color: var(--muted); }

.section-head { text-align: center; max-width: 46ch; margin: 0 auto 2rem; }

.footer { border-top: 1px solid var(--line); padding-block: 2rem; margin-top: 3rem; color: var(--muted); font-size: .88rem; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a:hover { color: var(--accent-ink); }
.footer-bottom { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem; }

.credit-line { font-size: .78rem; color: var(--muted); margin-top: .6rem; }

/* =============================================================
   7. Ad slots (placeholders — sin scripts reales)
   ============================================================= */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  min-height: 100px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-block: 2rem;
}
.ad-slot.ad-leaderboard { min-height: 100px; max-width: 728px; margin-inline: auto; }
.ad-slot.ad-incontent { min-height: 250px; max-width: 336px; margin-inline: auto; }

/* =============================================================
   8. Cookie banner
   ============================================================= */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: -140px;
  max-width: 640px; margin-inline: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 1.1rem 1.3rem;
  z-index: 9999; transition: bottom .45s var(--ease-out);
  font-size: .88rem; color: var(--ink-soft);
}
.cookie-banner.show { bottom: 1rem; }
.cookie-banner a { color: var(--accent-ink); text-decoration: underline; }
.cookie-actions { display: flex; gap: .7rem; margin-top: .9rem; justify-content: flex-end; }
.cookie-actions .btn { padding: .6rem 1.1rem; font-size: .88rem; }

/* =============================================================
   9. Responsive (mobile-first, breakpoints fijos)
   ============================================================= */
@media (min-width: 540px) { }
@media (min-width: 720px) {
  .nav-links { display: flex; }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 719px) {
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; align-items: flex-start; padding: 1rem var(--gutter); display: none; }
  .nav-links.is-open { display: flex; }
  .nav-toggle { display: block; width: 40px; height: 40px; }
}
@media (max-width: 719px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { flex-direction: column; }
}
@media (min-width: 1280px) { }

/* =============================================================
   10. Reduced-motion (solo lo intrusivo)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transition-duration: .01ms; }
}
