/* ── Smart Form Fields — Signature ── */

/* ══════════════════════════════════════════════════
   PREVIEW ПОЛЕ НА СТРАНИЦАТА
══════════════════════════════════════════════════ */

.sff-sig-wrapper {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    width: 300px;
}

.sff-sig-preview {
    width: 300px;
    height: 150px;
    border: 2px solid #c0c0c0;
    border-radius: 4px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.sff-sig-preview--signed {
    border-color: #0073aa;
    background: #fff;
}

.sff-sig-preview-empty {
    font-size: 13px;
    color: #aaa;
    font-style: italic;
}

.sff-sig-preview svg {
    width: 100%;
    height: 100%;
}

/* Бутон „Подпиши" */
.sff-sig-open-btn {
    width: 300px;
    padding: 9px 0;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    letter-spacing: 0.2px;
}
.sff-sig-open-btn:hover {
    background: #005f8d;
}

/* ══════════════════════════════════════════════════
   FULLSCREEN OVERLAY
══════════════════════════════════════════════════ */

#sff-sig-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

#sff-sig-modal {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 960px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* Label над canvas */
#sff-sig-label-display {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    align-self: flex-start;
}

/* Canvas */
#sff-sig-canvas {
    border: 2px solid #d0d0d0;
    border-radius: 4px;
    width: 100%;
    cursor: crosshair;
    touch-action: none;
    display: block;
}

/* ── Бутони в overlay ── */
#sff-sig-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

/* Изчисти и Undo — икона бутони */
#sff-sig-clear,
#sff-sig-undo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
    padding: 0;
}
#sff-sig-clear:hover,
#sff-sig-undo:hover {
    border-color: #999;
    background: #ebebeb;
}
#sff-sig-clear img,
#sff-sig-undo img {
    width: 20px;
    height: 20px;
    display: block;
}

/* Запази */
#sff-sig-save {
    padding: 10px 32px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
#sff-sig-save:hover {
    background: #005f8d;
}

/* Отказ */
#sff-sig-cancel {
    padding: 10px 20px;
    background: transparent;
    color: #777;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
#sff-sig-cancel:hover {
    border-color: #999;
    color: #444;
}

/* ══════════════════════════════════════════════════
   МОБИЛНИ
══════════════════════════════════════════════════ */
@media (max-width: 600px) {
    .sff-sig-wrapper,
    .sff-sig-preview,
    .sff-sig-open-btn {
        width: 100%;
    }

    #sff-sig-modal {
        padding: 14px;
        gap: 10px;
        border-radius: 8px;
    }

    #sff-sig-save {
        flex: 1;
    }

    #sff-sig-cancel {
        flex: 1;
    }
}
