/* ===== Tokens ===== */
:root {
  --bg: #F6F7FB; --surface: #FFFFFF; --ink: #161B2E; --muted: #5E6478; --line: #E2E5EF;
  --accent: #2546C8; --accent-ink: #FFFFFF; --soft: #ECEFFB;
  --ok: #1F7A45; --warn: #9A5B00; --bad: #B42318;
  --display: 'Fraunces', Georgia, serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11131C; --surface: #1A1D29; --ink: #EEF0F7; --muted: #A6ABBD; --line: #2E3242;
    --accent: #7D95FF; --accent-ink: #0E1430; --soft: #222842; --ok: #6FD39B; --warn: #E8B04B; --bad: #FF8A80;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ===== Header / footer ===== */
.site-header { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); text-decoration: none; font-weight: 800; font-size: 19px; }
.logo span { color: var(--ink); }
.header-link { color: var(--muted); font-weight: 700; text-decoration: none; font-size: 15px; }
.header-nav { display: flex; gap: 16px; }
@media (max-width: 480px) { .header-nav .header-link[href="#mas-herramientas"] { display: none; } }
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.site-footer p { margin: 0 0 6px; }
.credits { font-size: 12px; }

/* ===== Hero ===== */
main { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hero { padding: 6px 0 14px; }
.hero h1 { font-family: var(--display); font-size: clamp(26px, 5vw, 44px); letter-spacing: -0.01em; }
.subtitle { margin: 6px 0 0; color: var(--muted); max-width: 720px; font-size: clamp(15px, 2vw, 17px); }

/* ===== Tool card ===== */
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px -18px rgba(20,30,80,.25); }
@media (min-width: 860px) { .tool-card { padding: 24px; } }
.noscript { margin: 0 0 12px; padding: 12px; background: var(--soft); border-radius: 12px; font-weight: 700; }

.dropzone { position: relative; display: grid; place-items: center; gap: 4px; text-align: center; padding: 28px 16px; border: 2px dashed var(--line); border-radius: 18px; background: var(--bg); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.dropzone svg { width: 36px; height: 36px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dropzone strong { font-size: 18px; }
.dropzone span { color: var(--muted); font-size: 14px; }

.options { display: grid; gap: 12px 20px; grid-template-columns: minmax(0, 1fr); margin-top: 16px; }
@media (min-width: 720px) { .options { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.mini-title { font-family: var(--body); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.choice { min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font-weight: 800; font-size: 15px; }
.choice[aria-checked="true"] { border-color: var(--accent); color: var(--accent); background: var(--soft); }
.field { display: block; font-weight: 700; font-size: 14px; margin: 0; }
.field select { display: block; width: 100%; margin-top: 5px; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); font-weight: 500; font-size: 16px; }
.field input[type="range"] { display: block; width: 100%; margin-top: 12px; accent-color: var(--accent); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.status { margin: 14px 0 0; font-weight: 700; font-size: 14px; color: var(--muted); min-height: 1px; }
.status:empty { margin: 0; }
.status.bad { color: var(--bad); }

.files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.files:empty { margin: 0; }
.file { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--soft); display: block; }
.thumb.empty { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.meta { min-width: 0; }
.name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sizes { color: var(--muted); font-size: 13px; }
.sizes .ok { color: var(--ok); font-weight: 700; }
.file[data-state="error"] .sizes { color: var(--bad); font-weight: 700; }
.file-actions { display: flex; gap: 4px; align-items: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--muted); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.dl { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.icon-btn:disabled { opacity: .45; cursor: progress; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.summary { margin: 0; color: var(--muted); font-size: 14px; flex-basis: 100%; }
@media (min-width: 720px) { .summary { flex-basis: auto; margin-left: auto; } }

/* ===== Fotos a PDF ===== */
#pdf-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { #pdf-options { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pages { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.pages:empty { margin: 0; }
.page { position: relative; display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.page-img { aspect-ratio: 1; border-radius: 10px; background: var(--soft); display: grid; place-items: center; overflow: hidden; }
.page-img img { width: 100%; height: 100%; object-fit: contain; transition: transform .2s; }
@media (prefers-reduced-motion: reduce) { .page-img img { transition: none; } }
.page-num { position: absolute; top: 12px; left: 12px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.page-err { margin: 0; color: var(--bad); font-weight: 700; font-size: 13px; }
.page-err:empty { display: none; }
.page[data-state="error"] .page-img { display: none; }
.page[data-state="error"] .page-num { background: var(--bad); }
.page[data-state="error"] { padding-top: 44px; }
.page-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.page-actions .icon-btn { width: 100%; height: 36px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.pdf-name { flex: 1 1 200px; }
.pdf-name input { display: block; width: 100%; margin-top: 5px; min-height: 50px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); font-weight: 500; font-size: 16px; }
#herramienta .actions { align-items: flex-end; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; padding: 0 22px; border-radius: 14px; border: 0; font-weight: 800; font-size: 16px; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn:disabled { opacity: .55; cursor: progress; }

.privacy { margin: 12px 4px 20px; color: var(--muted); font-size: 14px; text-align: center; }

/* ===== Ads ===== */
.ad-slot { display: grid; place-items: center; border: 1.5px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin: 24px 0; }
.ad-leader { min-height: 100px; }
.ad-content { min-height: 280px; }

/* ===== Content ===== */
.content { max-width: 760px; margin: 0 auto; }
.content h2 { font-family: var(--display); font-size: clamp(22px, 3.2vw, 30px); margin: 36px 0 12px; }
.content h3 { font-size: 19px; margin: 24px 0 8px; }
.content p { margin: 0 0 12px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; }
.steps svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.steps span { color: var(--muted); font-size: 15px; }
.tips { padding-left: 20px; }
.tips li { margin-bottom: 8px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.more { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.more-card { display: grid; gap: 2px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.more-card span { color: var(--muted); font-size: 14px; }
.more-card:hover { border-color: var(--accent); }

/* ===== Legal pages ===== */
.legal { max-width: 760px; margin: 0 auto; padding: 8px 16px 24px; }
.legal h1 { font-family: var(--display); font-size: 32px; margin-bottom: 16px; }
.legal h2 { font-size: 20px; margin: 24px 0 8px; }
.todo { background: #FFF3C4; color: #5C4300; padding: 0 4px; border-radius: 4px; }
