﻿/* SignaturePad + SignatureOtpDialog. Colours come from theme-bridge.css. */

.sigp {
    max-width: 560px;
    padding: 16px;
    color: var(--app-fg);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
}

.sigp-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.sigp-title { font-size: 16px; font-weight: 600; }
.sigp-sub { margin-top: 2px; font-size: 13px; color: var(--app-muted); }

.sigp-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--app-border);
}

.sigp-tab {
    padding: 6px 14px;
    margin-bottom: -1px;
    font-size: 14px;
    color: var(--app-muted);
    cursor: pointer;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
}

.sigp-tab:hover { color: var(--app-fg); }

.sigp-tab--active {
    font-weight: 600;
    color: var(--app-primary);
    border-bottom-color: var(--app-primary);
}

.sigp-field { margin-bottom: 12px; }

.sigp-upload {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border: 1px dashed var(--app-border);
    border-radius: 6px;
}

.sigp-upload:hover { background: var(--app-surface-soft); }
.sigp-upload-action { font-size: 14px; font-weight: 600; color: var(--app-primary); }
.sigp-upload-hint { font-size: 12px; color: var(--app-muted); }

.sigp-file {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
}

/* White in every theme: the stored signature is dark ink on a transparent PNG. */
.sigp-canvas-wrap {
    position: relative;
    max-width: 500px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 6px;
}

.sigp-canvas {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.sigp-canvas--live {
    cursor: crosshair;
    pointer-events: auto;
    touch-action: none;
}

.sigp-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #9ca3af;
    pointer-events: none;
}

.sigp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.sigp-msg {
    padding: 8px 12px;
    margin-top: 12px;
    font-size: 13px;
    border: 1px solid transparent;
    border-radius: 6px;
}

.sigp-msg--error {
    color: var(--app-danger);
    background: var(--app-danger-soft);
    border-color: var(--app-danger-border);
}

.sigp-msg--success {
    color: var(--app-success);
    background: var(--app-success-soft);
    border-color: var(--app-success-border);
}

.sigp-msg--warning {
    color: var(--app-fg);
    background: var(--app-warning-soft);
    border-color: var(--app-warning-border);
}

.sigp-msg--top { margin: 0 0 12px; }

/* OTP dialog */
.sigp-otp-preview {
    margin-bottom: 14px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 6px;
}

.sigp-otp-preview img {
    display: block;
    width: 100%;
    max-height: 110px;
    object-fit: contain;
}

.sigp-otp-text { margin: 0 0 10px; font-size: 14px; }

.sigp-channels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.sigp-channel.dxbl-btn {
    justify-content: flex-start;
    min-width: 0;
    height: auto;
    padding: 10px 12px;
    color: var(--app-fg);
    text-align: left;
    white-space: normal;
}

.sigp-channel--active.dxbl-btn,
.sigp-channel--active.dxbl-btn:hover {
    color: var(--app-fg);
    background: var(--app-primary-soft);
    border-color: var(--app-primary);
}

.sigp-channel-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sigp-channel-name { font-size: 14px; font-weight: 600; }

.sigp-channel-value {
    overflow: hidden;
    font-size: 12px;
    color: var(--app-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sigp-otp-box .dxbl-text-edit-input {
    font-family: 'Courier New', Courier, monospace;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 8px;
}

.sigp-otp-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--app-muted);
}

.sigp-otp-expired { color: var(--app-danger); }
.sigp-otp-links { display: inline-flex; gap: 4px; }
