/* ==========================================================
   Quitafondos de Imagen - Estilos
   Mismo lenguaje visual que /hojas/ (neobrutalist + Poppins)
   pero con prefijo .fondo-* para evitar colisiones.
   Usa --color-primario / --color-menu / --color-boton de $dist
   ========================================================== */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 240, 245, 0.6), transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(254, 243, 199, 0.5), transparent 50%),
        #faf7f2;
    min-height: 100vh;
    color: #1f2937;
}

/* ===== Navbar ===== */
.fondo-navbar { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); }

/* ===== Hero ===== */
.fondo-hero { padding: 1.5rem 0 1rem; }

.fondo-badge {
    display: inline-block;
    background: #111827;
    color: #fff;
    padding: 0.4rem 1.25rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    box-shadow: 2px 2px 0 var(--color-borde, #1f2937);
}

.fondo-title {
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.25rem);
    color: #111827;
    margin: 0 0 0.75rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.fondo-subtitle {
    color: #4b5563;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    max-width: 620px;
    margin: 0 auto 1rem;
    line-height: 1.6;
}

.fondo-pills {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.fondo-pill {
    display: inline-block;
    background: #fff;
    color: #111827;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 2px solid #111827;
    box-shadow: 2px 2px 0 #111827;
}

.fondo-privacy-note {
    color: #059669;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}
.fondo-privacy-note i { font-size: 1rem; }

/* ===== Card base ===== */
.fondo-card {
    background: #fff;
    border-radius: 22px;
    padding: 1.5rem;
    border: 2px solid #111827;
    box-shadow: 4px 4px 0 #111827;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fondo-card:hover {
    transform: translateY(-2px);
    box-shadow: 4px 6px 0 #111827;
}

.fondo-card-final {
    background: linear-gradient(135deg, #fff 0%, #fef3c7 100%);
}

/* ===== Step header ===== */
.fondo-step-header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.1rem;
}

.fondo-step-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.15rem;
    line-height: 1.2;
}

.fondo-step-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

.fondo-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--color-primario);
    color: #fff;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1.15rem;
    flex-shrink: 0;
    border: 2px solid #111827;
    box-shadow: 2px 2px 0 #111827;
}

/* ===== Dropzone ===== */
.fondo-dropzone {
    border: 3px dashed #d1d5db;
    border-radius: 18px;
    padding: 2.5rem 1rem;
    text-align: center;
    background: #fcfaf7;
    transition: all 0.2s ease;
    cursor: pointer;
    outline: none;
}

.fondo-dropzone:hover,
.fondo-dropzone:focus,
.fondo-dropzone.dragover {
    border-color: var(--color-primario);
    background: #fff;
    transform: scale(1.005);
}

.fondo-dropzone-icon {
    font-size: 3.5rem;
    color: var(--color-primario);
    display: block;
    margin-bottom: 0.5rem;
}

.fondo-dropzone-title {
    font-weight: 700;
    color: #111827;
    font-size: 1.1rem;
    margin: 0 0 0.25rem;
}

.fondo-dropzone-sub {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0 0 1rem;
}

.fondo-dropzone-info {
    color: #9ca3af;
    font-size: 0.8rem;
    margin: 0.75rem 0 0;
}

/* ===== Botones ===== */
.fondo-btn-primary,
.fondo-btn-secondary,
.fondo-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid #111827;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.fondo-btn-primary {
    background: var(--color-primario);
    color: #fff;
    box-shadow: 3px 3px 0 #111827;
}
.fondo-btn-primary:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #111827;
    color: #fff;
}

.fondo-btn-secondary {
    background: #fff;
    color: #111827;
    box-shadow: 2px 2px 0 #111827;
}
.fondo-btn-secondary:hover {
    background: #fef3c7;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 #111827;
}

.fondo-btn-ghost {
    background: transparent;
    color: #6b7280;
    border-color: #d1d5db;
    box-shadow: none;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}
.fondo-btn-ghost:hover { background: #fee2e2; color: #dc2626; border-color: #dc2626; }

/* ===== Upload row (2 cols) ===== */
.fondo-upload-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.fondo-upload-col { min-width: 0; }

.fondo-files-panel {
    background: #fcfaf7;
    border: 2px dashed #e5e7eb;
    border-radius: 18px;
    padding: 1rem;
    min-height: 200px;
}

.fondo-files-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 180px;
    color: #9ca3af;
    text-align: center;
}
.fondo-files-empty i { font-size: 2.5rem; margin-bottom: 0.5rem; }
.fondo-files-empty p { margin: 0; font-size: 0.9rem; }

.fondo-files-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #e5e7eb;
    font-size: 0.9rem;
    color: #4b5563;
}

.fondo-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.fondo-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background:
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 14px 14px;
    background-position: 0 0, 0 7px, 7px -7px, -7px 0px;
    background-color: #fff;
}

.fondo-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}

.fondo-thumb-remove {
    position: absolute;
    top: 4px; right: 4px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.95);
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 14px; line-height: 1;
    padding: 0; transition: transform 0.1s ease;
}
.fondo-thumb-remove:hover { transform: scale(1.15); }

.fondo-thumb-status {
    position: absolute;
    bottom: 4px; left: 4px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}
.fondo-thumb-status.ok    { background: rgba(5, 150, 105, 0.9); }
.fondo-thumb-status.err   { background: rgba(220, 38, 38, 0.9); }

/* ===== Botón procesar grande ===== */
.fondo-btn-process {
    width: 100%;
    padding: 1.1rem 1.5rem;
    background: var(--color-primario);
    color: #fff;
    border: 2px solid #111827;
    border-radius: 16px;
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: 4px 4px 0 #111827;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}
.fondo-btn-process:hover:not(:disabled) {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 #111827;
}
.fondo-btn-process:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #111827;
}
.fondo-btn-process:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: 2px 2px 0 #9ca3af;
}

/* ===== Progress ===== */
.fondo-progress { width: 100%; }
.fondo-progress .progress {
    height: 10px; border-radius: 999px; background: #f3f4f6;
    border: 1px solid #e5e7eb;
}
.fondo-progress .progress-bar { background: var(--color-primario); }

/* ===== Opciones de fondo ===== */
.fondo-bg-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.6rem;
}

.fondo-bg-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.9rem 0.5rem;
    background: #fcfaf7;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    user-select: none;
}
.fondo-bg-btn:hover {
    border-color: var(--color-primario);
    background: #fff;
    transform: translateY(-1px);
}
.btn-check:checked + .fondo-bg-btn {
    border-color: var(--color-primario);
    background: var(--color-primario);
    color: #fff;
    box-shadow: 2px 2px 0 #111827;
}
.btn-check:checked + .fondo-bg-btn .fondo-bg-preview {
    border-color: #fff;
}

.fondo-bg-preview {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 2px solid #d1d5db;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    background:
        linear-gradient(45deg, #d1d5db 25%, transparent 25%),
        linear-gradient(-45deg, #d1d5db 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d1d5db 75%),
        linear-gradient(-45deg, transparent 75%, #d1d5db 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
    background-color: #fff;
}
.fondo-bg-transparent {
    /* ya tiene el patrón damero por default */
}

.fondo-bg-label {
    font-size: 0.82rem;
    font-weight: 600;
}

.fondo-bg-extra {
    margin-top: 1rem;
    padding: 1rem;
    background: #fcfaf7;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
}

input[type="color"].form-control-color {
    width: 100%;
    height: 48px;
    cursor: pointer;
}

/* ===== Resultados ===== */
.fondo-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.85rem;
    margin: 1rem 0;
}

.fondo-result {
    position: relative;
    border: 2px solid #111827;
    border-radius: 12px;
    overflow: hidden;
    background:
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    background-color: #fff;
    box-shadow: 3px 3px 0 #111827;
    aspect-ratio: 1;
    transition: transform 0.15s ease;
}
.fondo-result:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #111827;
}

.fondo-result canvas,
.fondo-result img {
    width: 100%; height: 100%; object-fit: contain; display: block;
}

.fondo-result-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
    padding: 0.6rem 0.5rem 0.4rem;
    display: flex;
    gap: 0.3rem;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.fondo-result:hover .fondo-result-overlay,
.fondo-result:focus-within .fondo-result-overlay { opacity: 1; }

.fondo-result-btn {
    background: #fff;
    border: 2px solid #111827;
    border-radius: 8px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform 0.1s ease;
    padding: 0;
    color: #111827;
}
.fondo-result-btn:hover { transform: scale(1.1); background: var(--color-primario); color: #fff; }

.fondo-result-status {
    position: absolute;
    top: 6px; left: 6px;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-weight: 600;
}
.fondo-result-status.processing { background: rgba(245, 158, 11, 0.95); }
.fondo-result-status.done       { background: rgba(5, 150, 105, 0.95); }
.fondo-result-status.error      { background: rgba(220, 38, 38, 0.95); }

/* ===== Summary ===== */
.fondo-summary {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.fondo-summary.has-data {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

/* ===== Botón descargar ===== */
.fondo-btn-download {
    width: 100%;
    padding: 1.1rem 1.5rem;
    background: var(--color-boton);
    color: #fff;
    border: 2px solid #111827;
    border-radius: 16px;
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: 4px 4px 0 #111827;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
}
.fondo-btn-download:hover:not(:disabled) {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 #111827;
}
.fondo-btn-download:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #111827;
}
.fondo-btn-download:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: 2px 2px 0 #9ca3af;
}

/* ===== Comparador antes/después ===== */
.fondo-compare-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-height: 70vh;
    overflow: hidden;
    background:
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #fff;
}
.fondo-compare-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    pointer-events: none;
}
.fondo-compare-after-wrap {
    position: absolute;
    top: 0; left: 0;
    width: 50%; height: 100%;
    overflow: hidden;
}
.fondo-compare-after-wrap .fondo-compare-img {
    width: 200%;
}
.fondo-compare-slider {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    cursor: ew-resize;
    z-index: 3;
    opacity: 0;
}
.fondo-compare-handle {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 4px;
    background: #fff;
    box-shadow: 0 0 0 2px #111827;
    transform: translateX(-2px);
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fondo-compare-handle::before {
    content: '';
    position: absolute;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #111827;
    box-shadow: 2px 2px 0 #111827;
}
.fondo-compare-handle i {
    z-index: 1;
    color: #111827;
    font-size: 0.8rem;
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
    .fondo-upload-row { grid-template-columns: 1fr; }
}

@media (max-width: 575px) {
    .fondo-card { padding: 1.15rem; border-radius: 18px; box-shadow: 3px 3px 0 #111827; }
    .fondo-step-num { width: 32px; height: 32px; font-size: 1rem; }
    .fondo-step-header h2 { font-size: 1.05rem; }
    .fondo-btn-process, .fondo-btn-download { font-size: 1rem; padding: 0.95rem 1.2rem; }
    .fondo-bg-options { grid-template-columns: repeat(3, 1fr); }
    .fondo-bg-preview { width: 36px; height: 36px; }
    .fondo-results-grid { grid-template-columns: repeat(2, 1fr); }
    .fondo-thumb { /* ajustes finos en móvil */ }
}

/* =====================================================
   SECCIONES SEO (Cómo funciona, Beneficios, FAQ, Uso)
   ===================================================== */
.fondo-seo-section {
    background: #fff;
    border-radius: 22px;
    border: 2px solid #111827;
    box-shadow: 4px 4px 0 #111827;
    padding: 2rem 1.75rem;
    margin-top: 1.75rem;
}
.fondo-seo-title {
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 800;
    color: #111827;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.fondo-seo-lead {
    color: #4b5563;
    font-size: 1rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

/* ----- Cómo funciona ----- */
.fondo-howto-list {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: 1fr; gap: 0.85rem;
}
.fondo-howto-step {
    display: flex; gap: 1rem;
    background: #fcfaf7;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem 1.15rem;
    transition: all 0.15s ease;
}
.fondo-howto-step:hover {
    border-color: var(--color-primario);
    background: #fff;
}
.fondo-howto-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex-shrink: 0;
    background: var(--color-primario); color: #fff;
    border-radius: 50%;
    font-weight: 800; font-size: 1rem;
    border: 2px solid #111827;
}
.fondo-howto-step h3 {
    font-size: 1.05rem; font-weight: 700;
    color: #111827; margin: 0 0 0.25rem;
}
.fondo-howto-step h3 i { color: var(--color-primario); margin-right: 0.35rem; }
.fondo-howto-step p { color: #4b5563; font-size: 0.92rem; margin: 0; line-height: 1.5; }

/* ----- Beneficios ----- */
.fondo-benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.fondo-benefit {
    background: #fcfaf7;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.1rem;
    transition: all 0.15s ease;
}
.fondo-benefit:hover {
    border-color: var(--color-primario);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 2px 2px 0 #111827;
}
.fondo-benefit i {
    font-size: 1.8rem;
    color: var(--color-primario);
    display: block;
    margin-bottom: 0.4rem;
}
.fondo-benefit h3 {
    font-size: 1rem; font-weight: 700;
    color: #111827; margin: 0 0 0.4rem;
}
.fondo-benefit p { font-size: 0.88rem; color: #4b5563; margin: 0; line-height: 1.5; }

/* ----- Casos de uso ----- */
.fondo-usecases {
    list-style: none; padding: 0; margin: 0;
    display: grid; gap: 0.65rem;
}
.fondo-usecases li {
    background: #fcfaf7;
    border-left: 4px solid var(--color-primario);
    padding: 0.75rem 1rem;
    border-radius: 0 10px 10px 0;
    color: #374151;
    line-height: 1.55;
    font-size: 0.95rem;
}
.fondo-usecases li strong { color: #111827; }

/* ----- FAQ ----- */
.fondo-faq .accordion-item {
    background: #fcfaf7;
    border: 2px solid #e5e7eb;
    border-radius: 12px !important;
    margin-bottom: 0.65rem;
    overflow: hidden;
}
.fondo-faq .accordion-button {
    background: #fcfaf7;
    font-weight: 600; color: #111827;
    font-size: 0.98rem; padding: 0.95rem 1.1rem;
}
.fondo-faq .accordion-button:not(.collapsed) {
    background: var(--color-primario);
    color: #fff; box-shadow: none;
}
.fondo-faq .accordion-button:not(.collapsed)::after {
    filter: brightness(0) invert(1);
}
.fondo-faq .accordion-button:focus {
    box-shadow: none; border-color: var(--color-primario);
}
.fondo-faq .accordion-body {
    color: #4b5563; font-size: 0.95rem; line-height: 1.6;
    padding: 1rem 1.1rem; background: #fff;
}

@media (max-width: 575px) {
    .fondo-seo-section {
        padding: 1.5rem 1.15rem;
        border-radius: 18px;
        box-shadow: 3px 3px 0 #111827;
    }
}
