/* =============================================================
   HERRAMIO — sistema visual base (compartido por todas las
   herramientas del sitio). Ver también el doc de marca en el
   proyecto de Claude para mantener coherencia entre páginas.
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f7f8fb;
  --bg-alt: #eef0f6;
  --surface: #ffffff;
  --surface-border: #e3e6ef;
  --text: #171923;
  --text-muted: #5b6072;
  --text-faint: #8a8fa3;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0fe;
  --ok: #16a34a;
  --ok-soft: #eafcf1;
  --error: #dc2626;
  --error-soft: #fdecec;
  --focus: #4f46e5;

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 20px;

  --shadow-card: 0 1px 2px rgba(23, 25, 35, .04), 0 8px 24px rgba(23, 25, 35, .06);
  --shadow-pop: 0 12px 32px rgba(23, 25, 35, .14);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --container: 920px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1116;
    --bg-alt: #15171f;
    --surface: #181b24;
    --surface-border: #2a2e3a;
    --text: #f1f2f6;
    --text-muted: #a7abbd;
    --text-faint: #6c7086;
    --accent: #7c74f0;
    --accent-hover: #8f88f5;
    --accent-soft: #211f3a;
    --ok: #34d399;
    --ok-soft: #103324;
    --error: #f87171;
    --error-soft: #3a1616;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; } /* algunas clases de componentes (.btn, .batch-actions…) fijan su propio display y pisarían el atributo hidden sin esto */
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.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
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.15; letter-spacing: -0.01em; font-weight: 700; }
ul { list-style: none; }
::selection { background: var(--accent); color: #fff; }

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

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--text); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 600;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.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;
}

/* =============================================================
   4. Header
   ============================================================= */
.site-header {
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--surface-border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em;
}
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: #fff; flex-shrink: 0;
}
.logo-mark svg { width: 18px; height: 18px; }
.site-nav { display: flex; align-items: center; gap: 1.4rem; }
.site-nav a {
  font-size: .92rem; font-weight: 600; color: var(--text-muted);
  transition: color .2s var(--ease-out);
}
.site-nav a:hover { color: var(--text); }

/* =============================================================
   5. Hero / intro
   ============================================================= */
.hero { padding-block: 2.4rem 1.4rem; text-align: center; }
.hero h1 {
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  max-width: 22ch;
  margin-inline: auto;
}
.hero .subtitle {
  margin-top: .7rem;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--text-muted);
  max-width: 46ch;
  margin-inline: auto;
}

/* =============================================================
   6. Tool card
   ============================================================= */
.tool-section { padding-block: 0 1.6rem; }

.tool-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
  padding: clamp(1.1rem, 3vw, 1.8rem);
}

.tool-options {
  display: flex; flex-wrap: wrap; gap: .6rem 1.4rem;
  align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
}
.option-group { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.option-group > span.option-label {
  font-size: .82rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.format-pills { display: inline-flex; background: var(--bg-alt); border-radius: 999px; padding: 3px; gap: 2px; }
.format-pill {
  padding: .45rem 1rem; border-radius: 999px; font-size: .88rem; font-weight: 700;
  color: var(--text-muted); transition: all .2s var(--ease-out);
}
.format-pill[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-card); }
.format-pill:not([aria-pressed="true"]):hover { color: var(--text); }
.format-pill:disabled { opacity: .4; cursor: not-allowed; }

.quality-row { display: flex; align-items: center; gap: .6rem; font-size: .86rem; color: var(--text-muted); }
.quality-row input[type="range"] { accent-color: var(--accent); width: 130px; }
.quality-row[hidden] { display: none; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .7rem; text-align: center; cursor: pointer;
  padding: clamp(1.8rem, 6vw, 3.2rem) 1.2rem;
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius-m);
  background: var(--bg-alt);
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--accent); box-shadow: var(--shadow-card);
}
.dropzone-icon svg { width: 26px; height: 26px; }
.dropzone-title { font-weight: 700; font-size: 1.02rem; }
.dropzone-hint { font-size: .86rem; color: var(--text-faint); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.file-list { margin-top: 1.1rem; display: flex; flex-direction: column; gap: .6rem; }
.file-row {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem .9rem; border: 1px solid var(--surface-border);
  border-radius: var(--radius-s); background: var(--surface);
}
.file-thumb {
  width: 42px; height: 42px; border-radius: 8px; object-fit: cover;
  background: var(--bg-alt); flex-shrink: 0;
}
.file-info { flex: 1 1 auto; min-width: 0; }
.file-name { font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: .78rem; color: var(--text-faint); }
.file-progress {
  height: 4px; border-radius: 2px; background: var(--bg-alt); overflow: hidden; margin-top: .35rem;
}
.file-progress > span { display: block; height: 100%; width: 0%; background: var(--accent); transition: width .2s var(--ease-out); }
.file-row[data-status="working"] .file-progress > span { width: 55%; }
.file-row[data-status="done"] .file-progress > span { background: var(--ok); width: 100%; }
.file-row[data-status="error"] .file-progress > span { background: var(--error); width: 100%; }
.file-row[data-status="error"] .file-thumb { opacity: .5; }
.file-action { flex-shrink: 0; }
.file-download {
  font-size: .82rem; font-weight: 700; color: var(--accent);
  padding: .4rem .7rem; border-radius: 999px; background: var(--accent-soft);
  white-space: nowrap;
}
.file-error-msg { font-size: .78rem; color: var(--error); margin-top: .2rem; }
.file-ios-hint { font-size: .74rem; color: var(--text-faint); margin-top: .3rem; line-height: 1.35; }

.batch-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 1.1rem; flex-wrap: wrap;
}
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.3rem; border-radius: 999px; font-weight: 700; font-size: .94rem;
  transition: transform .15s var(--ease-out), background .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-card); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { background: var(--bg-alt); color: var(--text); }
.btn-ghost:hover { background: var(--surface-border); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.reset-link {
  font-size: .86rem; font-weight: 600; color: var(--text-muted);
  text-decoration: underline; text-underline-offset: 3px;
}
.reset-link:hover { color: var(--text); }

.engine-status {
  margin-top: 1rem; padding: .7rem 1rem; border-radius: var(--radius-s);
  background: var(--accent-soft); color: var(--accent-hover);
  font-size: .86rem; font-weight: 600; display: none; align-items: center; gap: .6rem;
}
.engine-status.is-visible { display: flex; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite; flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.4s; } }
@keyframes spin { to { transform: rotate(360deg); } }

.privacy-badge {
  margin-top: 1.1rem; display: flex; align-items: center; gap: .55rem;
  font-size: .86rem; color: var(--text-muted); justify-content: center; text-align: center;
  flex-wrap: wrap;
}
.privacy-badge svg { width: 16px; height: 16px; color: var(--ok); flex-shrink: 0; }
.limits-note { margin-top: .35rem; font-size: .8rem; color: var(--text-faint); text-align: center; }

/* =============================================================
   7. Ad slots
   ============================================================= */
.ad-slot {
  margin-block: 1.6rem; border: 1px dashed var(--surface-border);
  border-radius: var(--radius-m); min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; color: var(--text-faint); letter-spacing: .05em; text-transform: uppercase;
  background: var(--bg-alt);
}

/* =============================================================
   8. Content sections
   ============================================================= */
.section { padding-block: 2rem; }
.section h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  margin-bottom: 1rem;
}
.section > .section-lead { color: var(--text-muted); margin-bottom: 1.2rem; max-width: 65ch; }

.steps { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); }
.step {
  padding: 1.2rem; border-radius: var(--radius-m); background: var(--surface);
  border: 1px solid var(--surface-border);
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-weight: 800; font-size: .85rem; margin-bottom: .6rem;
}
.step h3 { font-size: 1rem; margin-bottom: .3rem; }
.step p { font-size: .88rem; color: var(--text-muted); }

.seo-copy { max-width: 70ch; }
.seo-copy p { margin-bottom: 1rem; color: var(--text-muted); }
.seo-copy h3 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; color: var(--text); }

.faq-list { display: flex; flex-direction: column; gap: .6rem; max-width: 70ch; }
.faq-item {
  border: 1px solid var(--surface-border); border-radius: var(--radius-s);
  background: var(--surface); padding: .2rem .2rem;
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: .85rem 1rem;
  font-weight: 700; font-size: .95rem; display: flex; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; color: var(--accent); font-size: 1.2rem; flex-shrink: 0; transition: transform .2s var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 1rem 1rem; color: var(--text-muted); font-size: .9rem; }

.more-tools { padding-block: 2rem; }
.tool-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tool-card-link {
  display: block; padding: 1.1rem; border-radius: var(--radius-m);
  border: 1px solid var(--surface-border); background: var(--surface);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.tool-card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.tool-card-link .tool-card-icon {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: .6rem;
}
.tool-card-link .tool-card-icon svg { width: 18px; height: 18px; }
.tool-card-link h3 { font-size: .96rem; margin-bottom: .25rem; }
.tool-card-link p { font-size: .82rem; color: var(--text-muted); }
.tool-card-link.is-placeholder { opacity: .55; }
.tool-card-link .soon-tag {
  display: inline-block; margin-top: .5rem; font-size: .72rem; font-weight: 700;
  color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em;
}

/* =============================================================
   9. Footer
   ============================================================= */
.site-footer {
  border-top: 1px solid var(--surface-border);
  padding-block: 1.6rem; margin-top: 1rem;
}
.site-footer .container {
  display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: center; justify-content: space-between;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.footer-links a { font-size: .84rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
.footer-credits { font-size: .76rem; color: var(--text-faint); max-width: 60ch; }
.footer-copy { font-size: .82rem; color: var(--text-faint); }

/* =============================================================
   10. Legal pages
   ============================================================= */
.legal-page main { padding-block: 2.4rem 3rem; }
.legal-page h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .8rem; }
.legal-page h2 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
.legal-page p, .legal-page li { color: var(--text-muted); margin-bottom: .7rem; }
.legal-page ul { padding-left: 1.2rem; list-style: disc; }

/* =============================================================
   11. Responsive
   ============================================================= */
@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
  .site-nav { gap: .9rem; }
}
@media (max-width: 539px) {
  .batch-actions { flex-direction: column; align-items: stretch; }
  .batch-actions .btn { justify-content: center; }
}

/* =============================================================
   12. No-JS fallback
   ============================================================= */
.no-js-note { display: none; }
.no-js .no-js-note { display: block; margin-top: 1rem; padding: .8rem 1rem; border-radius: var(--radius-s); background: var(--error-soft); color: var(--error); font-size: .88rem; font-weight: 600; text-align: center; }
.no-js .dropzone { opacity: .5; pointer-events: none; }
