/* wwwroot/css/timbro-firma.css — pagina "Timbro e firma" e relativa scheda in Configurazione */

.tf-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .tf-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ── Anteprima ───────────────────────────────────────────────── */
.tf-pagine {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
}

.tf-pagine:empty { display: none; }

.tf-pagina-numero {
    align-self: stretch;
    max-width: 860px;
    width: 100%;
    margin: .75rem auto 0;
    font-size: .78rem;
    color: #6b7280;
}

.tf-pagina {
    position: relative;
    width: 100%;
    max-width: 860px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
    cursor: crosshair;
    user-select: none;
}

.tf-pagina canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Timbro posizionato ──────────────────────────────────────── */
.tf-timbro {
    position: absolute;
    cursor: move;
    touch-action: none;
    outline: 1px dashed rgba(27, 110, 194, .7);
    outline-offset: 1px;
}

.tf-timbro img {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.tf-timbro--attivo { outline-style: solid; }

.tf-timbro-elimina {
    position: absolute;
    top: -11px;
    right: -11px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #dc3545;
    color: #fff;
    font-size: .7rem;
    line-height: 22px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

.tf-timbro-maniglia {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #1b6ec2;
    border: 2px solid #fff;
    cursor: nwse-resize;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

/* ── Pannello laterale ───────────────────────────────────────── */
.tf-pannello {
    position: sticky;
    top: 1rem;
}

.tf-anteprima-timbro {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    padding: .75rem;
    border-radius: .6rem;
    /* scacchiera: fa vedere se lo sfondo dell'immagine è trasparente */
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #eef1f5 25%, transparent 25%),
        linear-gradient(-45deg, #eef1f5 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eef1f5 75%),
        linear-gradient(-45deg, transparent 75%, #eef1f5 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    border: 1px solid #e5e7eb;
}

.tf-anteprima-timbro img {
    max-width: 100%;
    max-height: 160px;
}
