* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background: #0b0b0f;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.contenedor {
    width: 100%;
    max-width: 650px;
    padding: 30px;
    background: #17171d;
    border: 1px solid #292932;
    border-radius: 22px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.45);
}

h1 {
    text-align: center;
    margin: 0 0 8px;
    font-size: 32px;
}

.subtitulo {
    text-align: center;
    color: #a8a8b3;
    margin-bottom: 30px;
}

.zona-subida {
    text-align: center;
}

.subir {
    display: block;
    padding: 22px;
    border: 2px dashed #555563;
    border-radius: 16px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: bold;
}

.subir:hover {
    border-color: #ff3030;
    background: #202027;
}

#imagen {
    display: none;
}

#nombreArchivo {
    color: #9999a5;
    font-size: 14px;
}

.vista-previa,
.resultado {
    margin-top: 25px;
}

.vista-previa p,
.resultado p {
    font-weight: bold;
}

#preview,
#resultado {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 14px;
    background: #0c0c10;
    display: block;
}

.instruccion {
    margin-top: 25px;
}

.instruccion label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
    padding: 15px;
    border: 1px solid #363640;
    border-radius: 14px;
    background: #0e0e13;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 15px;
    outline: none;
}

textarea:focus {
    border-color: #ff3030;
}

button {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: #e60000;
    color: white;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #ff2020;
}

button:disabled {
    opacity: 0.6;
    cursor: wait;
}

#estado {
    text-align: center;
    min-height: 22px;
    margin-top: 15px;
    color: #cfcfd8;
}

.resultado {
    padding-top: 10px;
    border-top: 1px solid #292932;
}

#descargar {
    display: block;
    margin-top: 15px;
    padding: 14px;
    border-radius: 12px;
    background: #292932;
    color: white;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
}

#descargar:hover {
    background: #3a3a46;
}

@media (max-width: 600px) {

    body {
        padding: 10px;
    }

    .contenedor {
        padding: 20px;
    }

    h1 {
        font-size: 27px;
    }
}

.generando {
    margin-top: 15px;
    padding: 18px;
    border-radius: 16px;
    background: #101015;
    border: 1px solid #30303a;
}

.generando-icono {
    font-size: 45px;
    margin-bottom: 10px;
    animation: dibujando 1s infinite alternate;
}

.generando-texto {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.generando-texto span {
    color: #9999a5;
    font-size: 14px;
}

.barra {
    width: 100%;
    height: 10px;
    margin-top: 18px;
    overflow: hidden;
    border-radius: 10px;
    background: #292932;
}

#barraProgreso {
    width: 0%;
    height: 100%;
    border-radius: 10px;
    background: #e60000;
    transition: width 0.15s linear;
}

.datos-generacion {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: #aaaab5;
    font-size: 14px;
}

.generacion-completa {
    line-height: 1.7;
}

.generacion-completa span {
    color: #aaaab5;
    font-size: 14px;
}

.error-generacion {
    color: #ff7070;
}

@keyframes dibujando {
    from {
        transform: translateY(0) rotate(-4deg);
    }

    to {
        transform: translateY(-5px) rotate(4deg);
    }
}
