/* ============================================================
   Herramienta 4 — Extractor de texto de imágenes (OCR)
   Mismo patrón de pasos 1-2-3 que la herramienta de RSS.
   ============================================================ */

.ocr-step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
}
.ocr-step:first-child { margin-top: 0; }

.ocr-step__num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .8125rem;
  font-weight: 800;
}

.ocr-step__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand-900);
}

.ocr-step__note {
  margin-left: auto;
  font-size: .75rem;
  font-weight: 700;
  color: var(--ink-3);
}

/* ---------- Zona de carga ---------- */
.ocr-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px 18px;
  border: 2px dashed var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.ocr-drop:hover { border-color: var(--accent); }
.ocr-drop.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.ocr-drop.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }

.ocr-drop input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.ocr-drop:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ocr-drop__icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}
.ocr-drop__icon svg { width: 22px; height: 22px; fill: currentColor; }

.ocr-drop strong { font-size: .9375rem; color: var(--brand-900); }
.ocr-drop span { font-size: .8125rem; color: var(--ink-3); }

.ocr-drop__preview {
  display: block;
  max-width: 100%;
  max-height: 220px;
  margin-top: 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--accent-line);
  object-fit: contain;
}
.ocr-drop__preview[hidden] { display: none; }

/* ---------- Selección de idioma ---------- */
.ocr-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
}

.ocr-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ocr-field input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.ocr-field.is-on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}
.ocr-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.ocr-help {
  display: block;
  margin-top: 8px;
  font-size: .75rem;
  color: var(--ink-3);
}

/* ---------- Progreso ---------- */
.ocr-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.ocr-progress__bar {
  flex: 1 1 auto;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  overflow: hidden;
}

.ocr-progress__fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .2s ease;
}

.ocr-progress span {
  flex: 0 0 auto;
  font-size: .75rem;
  font-weight: 700;
  color: var(--ink-3);
  white-space: nowrap;
}
