/*!
 * Finvera Signature Upload for RISE CRM.
 *
 * Every rule is scoped under .fvsign so nothing here can reach RISE's own pages. No
 * webfonts, no imports, no outbound requests — the module is entirely self-contained.
 */

.fvsign {
    margin: 10px 0 4px;
    font-size: 13px;
    line-height: 1.45;
    color: #333;
}

.fvsign * {
    box-sizing: border-box;
}

.fvsign-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 1px solid #e1e4e8;
    margin-bottom: 10px;
}

.fvsign-tab {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: 6px 12px;
    font: inherit;
    color: #5b6470;
    cursor: pointer;
}

.fvsign-tab:hover {
    color: #1b1f24;
    background: #f4f6f8;
}

.fvsign-tab.is-active {
    color: #1b1f24;
    background: #fff;
    border-color: #e1e4e8;
    font-weight: 600;
    margin-bottom: -1px;
    padding-bottom: 7px;
}

.fvsign-panel {
    padding: 2px 0 4px;
}

.fvsign-hint {
    display: block;
    color: #6c757d;
    font-size: 12px;
    margin: 4px 0;
}

.fvsign-drop {
    position: relative;
    display: block;
    border: 2px dashed #c6ccd4;
    border-radius: 6px;
    padding: 18px 14px;
    text-align: center;
    background: #fafbfc;
    transition: border-color .15s ease, background .15s ease;
}

.fvsign-drop.is-over {
    border-color: #2f7df6;
    background: #eef4ff;
}

.fvsign-drop strong {
    display: block;
    font-weight: 600;
    color: #35404e;
}

/* The input covers the drop zone so the whole area is clickable, and remains a real
   file input — keyboard focus and screen readers keep working. */
.fvsign-file {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.fvsign-preview {
    margin-top: 10px;
    padding: 8px;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    background:
        linear-gradient(45deg, #f0f1f3 25%, transparent 25%, transparent 75%, #f0f1f3 75%) 0 0/16px 16px,
        linear-gradient(45deg, #f0f1f3 25%, #fff 25%, #fff 75%, #f0f1f3 75%) 8px 8px/16px 16px;
    text-align: center;
}

/* The checkerboard behind it is what tells the signer the background really is
   transparent, rather than white paper that will print as a grey box. */
.fvsign-preview-canvas {
    max-width: 100%;
    max-height: 120px;
    height: auto;
    display: inline-block;
    vertical-align: middle;
}

.fvsign-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.fvsign-btn {
    appearance: none;
    font: inherit;
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid #c6ccd4;
    background: #fff;
    color: #35404e;
    cursor: pointer;
}

.fvsign-btn:hover {
    background: #f4f6f8;
}

.fvsign-btn-primary {
    background: #2f7df6;
    border-color: #2f7df6;
    color: #fff;
    font-weight: 600;
}

.fvsign-btn-primary:hover {
    background: #1f6ae0;
}

.fvsign-input {
    width: 100%;
    max-width: 380px;
    padding: 7px 10px;
    border: 1px solid #c6ccd4;
    border-radius: 4px;
    font: inherit;
    color: #1b1f24;
    background: #fff;
}

.fvsign-name {
    margin-bottom: 10px;
}

/* Sits inline between "Use this signature" and "Save to my signatures", so naming a saved
   signature never needs a browser dialog — embedded browsers disable those. */
.fvsign-save-name {
    width: auto;
    max-width: 190px;
    flex: 0 1 190px;
}

.fvsign-btn[disabled] {
    opacity: .55;
    cursor: default;
}

.fvsign-styles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.fvsign-style {
    appearance: none;
    padding: 6px 14px;
    font-size: 18px;
    border: 1px solid #c6ccd4;
    border-radius: 4px;
    background: #fff;
    color: #1b1f24;
    cursor: pointer;
}

.fvsign-style.is-active {
    border-color: #2f7df6;
    box-shadow: inset 0 0 0 1px #2f7df6;
}

.fvsign-saved {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fvsign-saved-item {
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 150px;
    padding: 8px;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    font-size: 12px;
    color: #5b6470;
    cursor: pointer;
}

.fvsign-saved-item:hover {
    border-color: #2f7df6;
}

.fvsign-saved-item img {
    max-width: 100%;
    max-height: 60px;
}

.fvsign-notice {
    margin-top: 10px;
    padding: 7px 11px;
    border-radius: 4px;
    border: 1px solid #e1e4e8;
    background: #f4f6f8;
    font-size: 12px;
}

.fvsign-notice.fvsign-ok {
    border-color: #b7e0c4;
    background: #eaf7ee;
    color: #1d6b37;
}

.fvsign-notice.fvsign-error {
    border-color: #f0c2c2;
    background: #fdeeee;
    color: #96201f;
}

@media (max-width: 480px) {
    .fvsign-saved-item { width: calc(50% - 4px); }
    .fvsign-actions .fvsign-btn { flex: 1 1 auto; }
}

/* Admin pages of the plugin reuse the same tokens. */
.fvsign-admin-table {
    width: 100%;
    border-collapse: collapse;
}

.fvsign-admin-table th,
.fvsign-admin-table td {
    padding: 7px 9px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
}

.fvsign-admin-table img {
    max-height: 40px;
    max-width: 150px;
}

.fvsign-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    word-break: break-all;
}
