@keyframes ventana_fondo_in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes ventana_in {
    from {
        opacity: 0;
        transform: scale(.94) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ventana_fondo {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    background: var(--base_oscura_transparente);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: ventana_fondo_in .2s ease-out;
    z-index: 99;
}

.ventana_fondo:not(.oculto) {
    display: flex;
}

/* Columna: header fijo arriba (flex-shrink: 0) + .ventana_contenido como
   única región que scrollea - así el botón de cerrar nunca se mueve con el
   contenido (overflow-x: hidden evita que algo interno empuje el scroll
   lateral). */
.ventana {
    width: 100%;
    max-width: 26rem;
    max-height: 90vh;
    background: var(--tarjeta_interna);
    border: 1px solid var(--borde_tarjeta_interna);
    border-radius: 1.2rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ventana_in .22s ease-out;
    box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .5);
}

.ventana_caracteristicas {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    width: 100%;
    padding-bottom: 0.8rem;
}

.btn_cierre {
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    border-radius: 50%;
    background: var(--mal_fondo);
    color: var(--mal);
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 0.8rem sans-serif;
}

.ventana_contenido {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
    /* min-height: 0 pisa el "min-height: auto" por default de un flex item:
       sin esto, overflow-y:auto de acá abajo nunca llegaría a activarse y
       .ventana crecería más allá de su max-height en vez de scrollear
       puertas adentro. */
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    align-items: stretch;
}

.ventana_error,
.ventana_contenido .mensaje_error {
    font-size: .8rem;
}

.ventana_contenido label {
    font: 600 0.68rem "Ubuntu", sans-serif;
    color: var(--texto_menor_enfasis);
    text-align: left;
}

.ventana_contenido input,
.ventana_contenido select,
.ventana_contenido textarea {
    width: 100%;
}

.ventana_contenido textarea {
    resize: vertical;
    min-height: 4rem;
}

#ventana_confirmacion_texto {
    width: -webkit-fill-available;
    text-align: center;
}

@media (max-width: 600px) {
    .ventana {
        max-width: 90vw;
    }
}