/* =============================================================
   CompresorFacil — styles.css
   1. Tokens  2. Reset  3. Utilities  4. Typography  5. Components
   6. Sections  7. Effects  8. Responsive  9. Reduced-motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-alt: #eef3fb;
  --border: #dbe3f0;
  --text: #131b2e;
  --text-muted: #5c6579;
  --text-faint: #8b93a7;

  --primary: #2554eb;
  --primary-dark: #1a3fc4;
  --primary-light: #e9eefd;
  --primary-contrast: #ffffff;

  --accent: #0ea472;
  --accent-light: #e3f9f0;
  --accent-dark: #087a55;

  --warn: #b5750a;
  --warn-light: #fdf2e0;
  --danger: #d9392e;
  --danger-light: #fdeceb;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(19, 27, 46, 0.06);
  --shadow: 0 6px 24px rgba(19, 27, 46, 0.08);
  --shadow-lg: 0 20px 48px rgba(19, 27, 46, 0.14);

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

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1180px;

  --ad-label: "ANUNCIO";
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1120;
    --surface: #141b30;
    --surface-alt: #1a2440;
    --border: #2a3556;
    --text: #edf1fb;
    --text-muted: #a3aec8;
    --text-faint: #74809e;

    --primary: #5f86f5;
    --primary-dark: #7b9cf7;
    --primary-light: #1c2848;
    --primary-contrast: #0c1120;

    --accent: #34d399;
    --accent-light: #103526;
    --accent-dark: #6ee7b7;

    --warn: #f2b64a;
    --warn-light: #3a2c0f;
    --danger: #f18b83;
    --danger-light: #3a1917;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; overflow-x: clip; 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;
  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.12; letter-spacing: -0.01em; font-family: var(--display); font-weight: 800; }
ul { list-style: none; padding: 0; }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--text); color: var(--bg);
  border-radius: 8px; font-weight: 600; transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }
.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;
}
.inline-icon { display: inline-flex; flex: none; width: 1.15em; height: 1.15em; }
.inline-icon svg { width: 100%; height: 100%; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--primary); background: var(--primary-light); padding: .3rem .7rem; border-radius: 999px;
}
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* =============================================================
   4. Typography
   ============================================================= */
.h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); max-width: 22ch; }
.h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); max-width: 26ch; }
.h3 { font-size: 1.15rem; }
.lede { font-size: clamp(1rem, 1.6vw, 1.2rem); color: var(--text-muted); max-width: 60ch; }
.section-kicker { color: var(--primary); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }

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

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.5rem; border-radius: 999px; font-weight: 700; font-size: .98rem;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--surface-alt); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: .5rem 1rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 68px; }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--primary);
  color: #fff; display: grid; place-items: center; flex: none;
}
.brand-mark svg { width: 19px; height: 19px; }
.main-nav { display: none; align-items: center; gap: 1.6rem; }
.main-nav a { font-size: .92rem; font-weight: 600; color: var(--text-muted); transition: color .15s var(--ease-out); }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--primary); }
.header-cta { display: none; }
.nav-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-alt);
}
.nav-toggle svg { width: 20px; height: 20px; }
.mobile-nav {
  display: none; flex-direction: column; gap: .2rem; padding: .5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border); background: var(--bg);
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a { padding: .7rem .4rem; font-weight: 600; border-radius: 8px; }
.mobile-nav a:hover { background: var(--surface-alt); }

/* --- Hero --- */
.hero { padding: 2.6rem 0 1.6rem; text-align: center; }
.hero .h1 { margin-inline: auto; }
.hero .lede { margin: .9rem auto 0; }
.hero-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.3rem; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600;
  color: var(--text-muted); background: var(--surface); border: 1px solid var(--border);
  padding: .4rem .8rem; border-radius: 999px;
}
.pill svg { width: 15px; height: 15px; color: var(--accent); flex: none; }

/* --- Page shell with side ad rails --- */
.page-shell { display: block; }
.ad-rail { display: none; }

/* --- Tool card --- */
.tool-section { padding-block: .5rem 1.5rem; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: clamp(1.1rem, 3vw, 1.9rem); max-width: 840px; margin-inline: auto;
}

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem;
  text-align: center; padding: clamp(2rem, 6vw, 3.2rem) 1.25rem; border-radius: var(--radius);
  border: 2px dashed var(--border); background: var(--surface-alt);
  cursor: pointer; transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--primary); }
.dropzone.is-dragover { border-color: var(--primary); background: var(--primary-light); }
.dropzone-icon {
  width: 58px; height: 58px; border-radius: 16px; background: var(--primary-light); color: var(--primary);
  display: grid; place-items: center;
}
.dropzone-icon svg { width: 28px; height: 28px; }
.dropzone-title { font-weight: 700; font-size: 1.08rem; }
.dropzone-sub { color: var(--text-muted); font-size: .9rem; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone-formats { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin-top: .3rem; }
.format-chip {
  font-size: .74rem; font-weight: 700; color: var(--text-faint); background: var(--surface);
  border: 1px solid var(--border); padding: .18rem .5rem; border-radius: 6px;
}

/* Queue of files being processed */
.file-queue { display: flex; flex-direction: column; gap: .8rem; margin-top: 1.1rem; }
.file-row {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: var(--surface);
}
.file-row-head { display: flex; align-items: center; gap: .8rem; }
.file-row-icon {
  width: 42px; height: 42px; border-radius: 10px; background: var(--surface-alt); color: var(--primary);
  display: grid; place-items: center; flex: none;
}
.file-row-icon svg { width: 21px; height: 21px; }
.file-row-name { font-weight: 700; font-size: .95rem; overflow-wrap: anywhere; }
.file-row-meta { font-size: .82rem; color: var(--text-muted); }
.file-row-remove { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--text-faint); flex: none; }
.file-row-remove:hover { background: var(--surface-alt); color: var(--danger); }
.file-row-remove svg { width: 16px; height: 16px; }

.controls-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }
.control label.control-label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: .4rem; }
.control-hint { font-size: .78rem; color: var(--text-faint); margin-top: .3rem; }
input[type="range"] {
  width: 100%; height: 6px; border-radius: 999px; background: var(--border); appearance: none; -webkit-appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--primary);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--primary); border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--primary); cursor: pointer;
}
select, .select {
  width: 100%; padding: .68rem .8rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: .92rem; font-weight: 600;
}
.range-value { font-weight: 800; color: var(--primary); }
.check-row { display: flex; align-items: center; gap: .55rem; font-size: .88rem; font-weight: 600; }
.check-row input { width: 18px; height: 18px; accent-color: var(--primary); }

.style-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.style-pill {
  padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--border); font-weight: 700; font-size: .85rem;
  background: var(--surface);
}
.style-pill[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

.progress-track { height: 8px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; margin-top: .6rem; }
.progress-bar { height: 100%; width: 0%; background: var(--primary); border-radius: 999px; transition: width .2s var(--ease-out); }
.progress-label { font-size: .82rem; color: var(--text-muted); margin-top: .4rem; }

.result-panel { border-top: 1px dashed var(--border); margin-top: 1rem; padding-top: 1rem; }
.result-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.stat-box { background: var(--surface-alt); border-radius: var(--radius-sm); padding: .75rem .9rem; }
.stat-box .stat-label { font-size: .74rem; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.stat-box .stat-value { font-size: 1.2rem; font-weight: 800; margin-top: .15rem; }
.stat-box.is-accent { background: var(--accent-light); }
.stat-box.is-accent .stat-value { color: var(--accent-dark); }
.result-download { display: flex; align-items: center; gap: .8rem; margin-top: .9rem; flex-wrap: wrap; }

.tool-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }

.error-box {
  display: flex; gap: .7rem; align-items: flex-start; background: var(--danger-light); color: var(--danger);
  border-radius: var(--radius-sm); padding: .8rem 1rem; font-size: .9rem; font-weight: 600; margin-top: 1rem;
}
.error-box svg { width: 19px; height: 19px; flex: none; margin-top: .1rem; }

.privacy-badge {
  display: flex; align-items: center; gap: .6rem; max-width: 840px; margin: 1rem auto 0; padding: .85rem 1.1rem;
  background: var(--accent-light); border-radius: var(--radius-sm); font-size: .86rem; color: var(--accent-dark); font-weight: 600;
}
.privacy-badge svg { width: 20px; height: 20px; flex: none; }
.limits-note { text-align: center; font-size: .82rem; color: var(--text-faint); max-width: 840px; margin: .6rem auto 0; }

/* Sections that only appear per file kind, hidden by default */
[data-controls-for] { display: none; }
[data-controls-for].is-active { display: block; }

/* Tool card states */
.tool-card[data-state="idle"] .queue-block,
.tool-card[data-state="idle"] .result-panel,
.tool-card[data-state="idle"] .progress-wrap,
.tool-card[data-state="idle"] .error-box,
.tool-card:not([data-state="error"]) .error-box { display: none; }
.tool-card[data-state="working"] .result-panel,
.tool-card[data-state="loading-engine"] .result-panel { display: none; }

/* --- Ad slots (placeholders only) --- */
.ad-slot {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  background: var(--surface-alt); color: var(--text-faint);
  font-size: .78rem; font-weight: 700; letter-spacing: .08em;
}
.ad-slot::before { content: var(--ad-label); }
.ad-banner { width: 100%; max-width: 840px; min-height: 90px; margin: 0 auto; }
.ad-inline { width: 100%; min-height: 250px; margin: 0 auto; max-width: 700px; }
.ad-rail-slot { width: 160px; min-height: 600px; position: sticky; top: 90px; }
.ad-corner {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60; width: 260px; min-height: 84px;
  box-shadow: var(--shadow-lg); border-style: solid; padding-right: 2.1rem;
  transform: translateY(140%); transition: transform .5s var(--ease-out);
}
.ad-corner.is-visible { transform: translateY(0); }
.ad-corner-close {
  position: absolute; top: .35rem; right: .35rem; width: 24px; height: 24px; border-radius: 6px;
  display: grid; place-items: center; color: var(--text-faint); background: var(--surface);
}
.ad-corner-close svg { width: 13px; height: 13px; }

/* --- Steps (cómo funciona) --- */
.steps-grid { display: grid; grid-template-columns: 1fr; gap: 1.2rem; margin-top: 1.6rem; }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; position: relative; }
.step-num {
  width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 800; margin-bottom: .8rem;
}
.step-card h3 { margin-bottom: .35rem; }
.step-card p { color: var(--text-muted); font-size: .92rem; }

/* --- Privacy explainer section --- */
.privacy-explain {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.4rem); display: grid; grid-template-columns: 1fr; gap: 1.4rem; align-items: center;
}
.privacy-explain-icon {
  width: 60px; height: 60px; border-radius: 16px; background: var(--accent-light); color: var(--accent-dark);
  display: grid; place-items: center;
}
.privacy-explain-icon svg { width: 30px; height: 30px; }
.privacy-points { display: grid; gap: .8rem; margin-top: 1rem; }
.privacy-point { display: flex; gap: .6rem; font-size: .9rem; }
.privacy-point svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: .15rem; }

/* --- SEO text block --- */
.seo-text { max-width: 780px; margin-inline: auto; color: var(--text-muted); }
.seo-text h2, .seo-text h3 { color: var(--text); margin-top: 1.6rem; margin-bottom: .5rem; }
.seo-text h2:first-child, .seo-text h3:first-child { margin-top: 0; }
.seo-text p { margin-top: .7rem; }
.seo-text ul { margin-top: .6rem; display: grid; gap: .4rem; }
.seo-text li { padding-left: 1.3rem; position: relative; }
.seo-text li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }

/* --- FAQ --- */
.faq-list { max-width: 780px; margin-inline: auto; display: grid; gap: .7rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.faq-item summary {
  padding: 1rem 1.1rem; font-weight: 700; cursor: pointer; list-style: none; display: flex;
  align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; width: 18px; height: 18px; flex: none;
  background: currentColor; color: var(--text-faint);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M12 15.5 4.5 8l1.4-1.4L12 12.7l6.1-6.1L19.5 8z"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M12 15.5 4.5 8l1.4-1.4L12 12.7l6.1-6.1L19.5 8z"/></svg>') center / contain no-repeat;
  transition: transform .2s var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item p { padding: 0 1.1rem 1.1rem; color: var(--text-muted); font-size: .92rem; }

/* --- Related tools grid --- */
.tools-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.tool-card-mini {
  display: flex; flex-direction: column; gap: .6rem; padding: 1.2rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.tool-card-mini:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.tool-card-mini-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; }
.tool-card-mini-icon svg { width: 21px; height: 21px; }
.tool-card-mini h3 { font-size: 1rem; }
.tool-card-mini p { font-size: .85rem; color: var(--text-muted); }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--border); margin-top: 2.5rem; padding: 2.2rem 0; }
.footer-grid { display: grid; gap: 1.4rem; }
.footer-brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-family: var(--display); }
.footer-tagline { color: var(--text-muted); font-size: .88rem; margin-top: .5rem; max-width: 40ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .86rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--primary); }
.footer-legal { font-size: .78rem; color: var(--text-faint); margin-top: 1.4rem; border-top: 1px solid var(--border); padding-top: 1.2rem; }

/* Sections spacing rhythm */
.section { padding-block: 2.6rem; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 0; }
.section-head + * { margin-top: 1.6rem; }

/* =============================================================
   6. Effects
   ============================================================= */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .controls-grid { grid-template-columns: 1fr 1fr; }
  .result-stats { grid-template-columns: repeat(4, 1fr); }
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 720px) {
  .header-cta { display: inline-flex; }
  .privacy-explain { grid-template-columns: auto 1fr; }
}
@media (min-width: 960px) {
  .main-nav { display: flex; }
  .nav-toggle { display: none; }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
  .hero .h1 { max-width: 26ch; }
}
@media (min-width: 1440px) {
  .page-shell {
    display: grid; grid-template-columns: 180px minmax(0, 1fr) 180px;
    gap: 0; max-width: 1540px; margin-inline: auto; padding-inline: 1rem;
  }
  .ad-rail { display: flex; justify-content: center; padding-top: 1.5rem; }
}

/* =============================================================
   9. Reduced-motion — solo lo intrusivo
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .ad-corner { transition: none; }
}
