/* FotoListo Pro: sistema de diseño propio. Tipografía nativa del sistema. */
:root {
  --ink: #14213d;
  --ink-soft: #3d4a66;
  --paper: #f6f1e7;
  --card: #fffdf8;
  --line: #14213d;
  --accent: #b83f0f;
  --accent-dark: #8f2f08;
  --teal: #0f766e;
  --sun: #f2b705;
  --danger: #b42318;
  --focus: #0b5fff;
  --radius: 14px;
  --shadow: 5px 5px 0 var(--ink);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); line-height: 1.55; font-size: 1rem;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(20, 33, 61, 0.06) 1px, transparent 1px);
  background-size: 18px 18px;
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--accent-dark); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: clamp(14px, 4vw, 32px); }
.sr-only, .sr-status {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 8px; }

/* Cabecera */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 2px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 1.15rem; }
.brand-mark { width: 32px; height: 32px; }
.brand strong { color: var(--accent); }
.nav-list { display: flex; flex-wrap: wrap; gap: 2px 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a { display: inline-block; padding: 8px 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; border-radius: 8px; }
.nav-list a:hover { background: rgba(20, 33, 61, .08); }
.nav-ext a { border: 1.5px solid rgba(20, 33, 61, .28); }
.nav-ext a:hover, .nav-ext a:focus-visible { border-color: var(--ink); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 20px; font: inherit; font-weight: 700; border: 2px solid var(--ink); border-radius: 999px;
  cursor: pointer; text-decoration: none; color: var(--ink); background: var(--card);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active:not(:disabled) { transform: none; box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-accent { background: var(--sun); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-small { min-height: 40px; padding: 6px 14px; font-size: .9rem; }
.btn-row, .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.actions { justify-content: flex-end; margin-top: 24px; }

/* Hero */
.hero { padding-block: clamp(28px, 6vw, 72px) clamp(24px, 4vw, 48px); }
.hero-grid { display: grid; gap: 32px; align-items: center; }
.eyebrow { display: inline-block; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--teal); }
h1 { font-size: clamp(2.2rem, 7vw, 4.2rem); letter-spacing: -0.03em; }
.hl { background: linear-gradient(transparent 62%, var(--sun) 62%); padding-inline: 2px; }
.lead { font-size: clamp(1.05rem, 2.4vw, 1.25rem); max-width: 60ch; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li { border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; font-size: .88rem; font-weight: 600; background: var(--card); }
.hero-art-wrap { min-width: 0; }
.hero-art { width: 100%; height: auto; display: block; }
.art-tag { font: 700 13px var(--font); fill: var(--ink); }

/* Secciones */
.section, .tool { padding-block: clamp(28px, 5vw, 56px); }
.section-head { margin-bottom: 22px; }
.section-head h2 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.section-head p { color: var(--ink-soft); max-width: 62ch; }
.subhead { margin-top: 28px; }

/* Herramienta */
.stepper { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 16px; padding: 0; }
.stepper li { flex: 1 1 140px; min-width: 0; }
.step-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; font: inherit; font-weight: 700;
  color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: 12px; cursor: pointer; text-align: left;
}
.step-num { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: .9rem; }
.step-btn[aria-current="step"] { background: var(--sun); }
.step-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.panel { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(14px, 3vw, 28px); min-width: 0; }
.panel h3 { font-size: clamp(1.3rem, 3.5vw, 1.7rem); }
.panel h3:focus { outline: none; }
.panel h4 { font-size: 1.05rem; }
.note { background: #fff4d6; border-left: 5px solid var(--sun); padding: 10px 14px; border-radius: 6px; font-size: .95rem; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: clamp(20px, 5vw, 40px) 16px; border: 3px dashed var(--ink); border-radius: var(--radius); background: var(--paper); cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
.dropzone.is-over { background: #ffe9a8; transform: scale(1.01); }
.dz-icon { width: 56px; height: 56px; color: var(--teal); }
.dz-title { font-size: 1.25rem; font-weight: 800; margin: 0; }
.dz-or { margin: 0; color: var(--ink-soft); }
.dz-hint { margin: 8px 0 0; font-size: .88rem; color: var(--ink-soft); }

.messages { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.messages:empty { display: none; }
.messages li { background: #fdecea; border-left: 5px solid var(--danger); padding: 8px 12px; border-radius: 6px; font-size: .92rem; overflow-wrap: anywhere; }
.messages.warn li { background: #fff4d6; border-left-color: var(--sun); }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; }
.list-head h4 { margin: 0; }
.image-list, .result-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.image-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; }
.thumb { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 8px; overflow: hidden; }
.thumb canvas { max-width: 64px; max-height: 64px; width: auto; height: auto; display: block; }
.image-meta { min-width: 0; }
.image-name { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.image-info { margin: 0; font-size: .85rem; color: var(--ink-soft); }
.empty { color: var(--ink-soft); font-style: italic; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #d9d4c7 25%, transparent 25%, transparent 75%, #d9d4c7 75%), linear-gradient(45deg, #d9d4c7 25%, transparent 25%, transparent 75%, #d9d4c7 75%); background-size: 12px 12px; background-position: 0 0, 6px 6px; }

/* Paso 2 */
.step2-grid { display: grid; gap: 20px; margin-top: 16px; }
.col-main, .col-preview { min-width: 0; display: grid; gap: 16px; align-content: start; }
.platform-list { display: grid; gap: 14px; }
fieldset { min-width: 0; margin: 0; }
.platform, .group { border: 2px solid var(--ink); border-radius: 12px; padding: 12px; background: #fff; }
.platform legend, .group legend { font-weight: 800; padding-inline: 8px; }
.profile { padding: 10px 0; border-top: 1px dashed rgba(20, 33, 61, .35); }
.profile:first-of-type { border-top: 0; }
.p-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.p-name { font-weight: 700; }
.p-desc { margin: 2px 0 8px 32px; font-size: .88rem; color: var(--ink-soft); }
.p-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin-left: 32px; }
.p-controls .field { width: 104px; }
.p-controls .field.grow { flex: 1 1 200px; width: auto; }
.times { padding-bottom: 12px; font-weight: 700; }
.ratio-box { padding-bottom: 10px; min-width: 56px; }
.ratio { display: inline-block; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 10px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.p-error { color: var(--danger); font-weight: 600; font-size: .88rem; margin: 6px 0 0 32px; }

.field { display: grid; gap: 4px; margin-bottom: 10px; min-width: 0; }
.field.inline { display: flex; align-items: center; gap: 12px; }
.field label { font-size: .88rem; font-weight: 700; }
.field-note { font-size: .85rem; color: var(--ink-soft); margin: 4px 0 8px; }
input[type="number"], input[type="text"], select {
  width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 10px;
}
input[aria-invalid="true"] { border-color: var(--danger); background: #fdecea; }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
input[type="color"] { width: 56px; height: 44px; padding: 2px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; cursor: pointer; }
input:disabled, select:disabled { opacity: .55; }
.check, .radio { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; font-weight: 600; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.radio-row { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.wm-fields { display: grid; gap: 4px 16px; margin-top: 8px; }

.preview-card { border: 2px solid var(--ink); border-radius: 12px; padding: 14px; background: #fff; }
.pv-selects { display: grid; gap: 0 12px; }
.pv-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 4px 0; }
.pv-compare figure { margin: 0; min-width: 0; }
.pv-compare .checker { display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 8px; min-height: 120px; overflow: hidden; }
.pv-compare canvas { display: block; max-width: 100%; max-height: 300px; width: auto; height: auto; }
#pvResult { cursor: grab; touch-action: none; }
#pvResult.dragging { cursor: grabbing; }
figcaption { font-size: .82rem; font-weight: 700; text-align: center; margin-top: 4px; }
.frame { margin-top: 10px; }
.summary { margin-top: 18px; padding: 12px 14px; background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; font-weight: 700; }
.summary:empty { display: none; }

/* Paso 3 */
.progress-wrap { margin: 14px 0; }
progress { width: 100%; height: 22px; appearance: none; -webkit-appearance: none; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
progress::-webkit-progress-bar { background: #fff; }
progress::-webkit-progress-value { background: var(--teal); transition: width .2s ease; }
progress::-moz-progress-bar { background: var(--teal); }
.counters { margin: 6px 0 0; font-weight: 700; }
.result-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px 12px; border: 2px solid var(--ink); border-left-width: 8px; border-radius: 10px; background: #fff; }
.result-item.is-ok { border-left-color: var(--teal); }
.result-item.is-error { border-left-color: var(--danger); background: #fdecea; }
.result-item.is-working { border-left-color: var(--sun); }
.result-item.is-cancelled, .result-item.is-queued { border-left-color: #9aa3b5; }
.r-name { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.r-meta { margin: 0; font-size: .82rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.r-side { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.r-status { font-weight: 800; font-size: .9rem; }
.r-size { font-size: .88rem; }

/* Contenido */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 18px; position: relative; box-shadow: 4px 4px 0 var(--ink); }
.card h3 { font-size: 1.2rem; }
.card p { margin: 0; color: var(--ink-soft); }
.card-num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--sun); border: 2px solid var(--ink); font-weight: 800; margin-bottom: 10px; }
.cards.tight { margin-top: 22px; }
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(20, 33, 61, .25); vertical-align: top; }
thead th { background: var(--ink); color: var(--paper); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.plain { padding-left: 1.2em; }
.plain li { margin-bottom: 6px; max-width: 75ch; }
.priv-box { background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: clamp(18px, 4vw, 32px); }
.priv-claim { font-size: clamp(1.15rem, 3vw, 1.6rem); font-weight: 800; }
.faq { display: grid; gap: 10px; }
details { background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 0 16px; }
summary { cursor: pointer; font-weight: 700; padding: 14px 0; }
details p { color: var(--ink-soft); }

.site-footer { border-top: 2px solid var(--ink); padding-block: 24px; margin-top: 24px; font-size: .92rem; }
.site-footer p { margin: 0 0 6px; }

@media (min-width: 480px) {
  .pv-selects, .wm-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wm-fields .field:first-child { grid-column: 1 / -1; }
}
@media (min-width: 640px) {
  .result-item { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.1fr .9fr; }
  .step2-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
  .col-preview { position: sticky; top: 84px; align-self: start; }
}
@media (max-width: 380px) {
  .nav-ext a { padding: 4px 7px; }
  .image-item { grid-template-columns: 52px minmax(0, 1fr); }
  .image-item .btn { grid-column: 1 / -1; }
  .thumb { width: 52px; height: 52px; }
  .thumb canvas { max-width: 52px; max-height: 52px; }
  .p-desc, .p-controls, .p-error { margin-left: 0; }
  .nav-list a { padding: 6px 7px; font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
