/* V101f — Shared Signature Modal Styles
 *
 * Bisher waren diese Regeln NUR inline in contract-view.html (Zeilen ~1689-2230).
 * Talent-Portal hat das Modal-Markup importiert, hatte aber keinen Zugang zu
 * den .sig-modal-* CSS-Rules → Icon riesig, Layout kaputt.
 *
 * Diese Datei wird von BEIDEN Pages geladen (talent/index.html und auch in
 * contract-view.html nach dem inline-Block — gleiche Werte überschreiben sich
 * harmlos). Footer-Padding ist auf V101f-Werte gehoben (40/48/56 + gap 56)
 * damit der Trust-Bar-Text klaren Atemraum hat.
 */

.signature-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 17, 21, 0.45);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease-out;
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
.signature-modal.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}
.signature-modal-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 760px;
    width: 94%;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 18px 56px rgba(0, 0, 0, 0.22);
}
.signature-modal-content > .signature-modal-header,
.signature-modal-content > .sig-modal-info-row { flex: 0 0 auto; }
.signature-modal-content > .signature-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.signature-modal-content > .signature-modal-actions {
    flex: 0 0 auto;
    background: #ffffff;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
}
.signature-modal-header {
    padding: 22px 28px 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.signature-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.01em;
}
.signature-modal-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.signature-modal-subtitle .dot { color: #d1d5db; font-size: 11px; }
.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover { background: #f5f6f8; color: #111827; }

.sig-modal-info-row {
    border-top: 1px solid #eef0f3;
    padding: 18px 28px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: center;
}
.sig-modal-info-left {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}
.sig-modal-info-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sig-modal-info-icon svg { width: 18px; height: 18px; }
.sig-modal-info-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}
.sig-modal-info-subtitle {
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.4;
    margin-top: 1px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.sig-modal-info-right {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    max-width: 240px;
}
.sig-modal-progress-label {
    font-size: 10px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.sig-modal-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sig-modal-progress-track {
    flex: 1;
    height: 4px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}
.sig-modal-progress-bar {
    width: 0%;
    height: 100%;
    background: #111827;
    transition: width 0.3s ease;
}
.sig-modal-progress-pill {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 999px;
    white-space: nowrap;
}
.sig-modal-progress-text {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

.signature-modal-body {
    border-top: 1px solid #eef0f3;
    padding: 22px 28px;
}
.signer-info-section { margin-bottom: 18px; }
.signer-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-group label {
    display: block;
    font-size: 12px;
    color: #374151;
    font-weight: 500;
    margin-bottom: 6px;
}
.form-group .req { color: #2563eb; margin-left: 2px; }
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: #ffffff;
    box-sizing: border-box;
    color: #111827;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input::placeholder { color: #9ca3af; }
.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.management-fixed-info {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12.5px;
    color: #374151;
    margin-top: 10px;
    line-height: 1.5;
}

.sig-modal-sig-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
    flex-wrap: wrap;
}
.sig-modal-sig-label {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}
.sig-modal-sig-label .req { color: #2563eb; margin-left: 2px; }
.sig-modal-sig-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.sig-link-btn {
    background: transparent;
    border: none;
    color: #374151;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    border-radius: 6px;
    transition: background 0.12s ease, color 0.12s ease;
}
.sig-link-btn:hover { background: #f3f4f6; color: #111827; }
.sig-link-btn svg { width: 14px; height: 14px; }

.signature-canvas-wrapper {
    background: #ffffff;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    padding: 0;
    margin: 0;
    position: relative;
    height: 200px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.signature-canvas-wrapper:focus-within { border-color: #9ca3af; }
.signature-canvas-wrapper.has-content {
    border-style: solid;
    border-color: #9ca3af;
}
#modal-signature-canvas {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: crosshair;
    display: block;
    touch-action: none;
}
.sig-canvas-empty {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.signature-canvas-wrapper.has-content .sig-canvas-empty { opacity: 0; }
.sig-canvas-empty-main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    font-size: 13.5px;
    font-weight: 500;
}
.sig-canvas-empty-main svg { width: 16px; height: 16px; color: #374151; }
.sig-canvas-empty-hint { font-size: 11px; color: #9ca3af; }

.apply-to-all-wrapper {
    margin: 16px 0 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}
.apply-to-all-wrapper label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
}
.apply-to-all-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2563eb;
    flex-shrink: 0;
}
.apply-to-all-info {
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
}
.apply-to-all-info svg { width: 14px; height: 14px; }

/* Footer bar — V103c: SLIM padding 14/24/16 + reduzierte Note. Vorher
   40/48/56 = ~170px Höhe → überdeckte Signatur-Canvas. Jetzt ~80px. */
.signature-modal-actions {
    border-top: 1px solid #eef0f3;
    padding: 14px 24px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    margin: 0;
}
.sig-modal-trust-bar {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
}
.sig-modal-trust-bar > svg {
    width: 18px;
    height: 18px;
    color: #6b7280;
    flex-shrink: 0;
    margin-top: 2px;
}
.sig-modal-trust-bar-text { padding-right: 0; min-width: 0; }
.sig-modal-trust-bar-badges {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
    display: block;
    white-space: nowrap;
}
.sig-modal-trust-bar-badges > span { display: inline; }
.sig-modal-trust-bar-badges .dot { color: #d1d5db; margin: 0 7px; }
.sig-modal-trust-bar-note {
    font-size: 10px;
    color: #6b7280;
    line-height: 1.4 !important;
    margin-top: 4px;
}
.sig-modal-actions-right {
    display: flex;
    gap: 8px;
    align-self: center;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.btn:active { transform: scale(0.985); }
.btn svg { width: 14px; height: 14px; }
.btn-secondary {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}
.btn-secondary:hover { background: #f9fafb; }
.btn-primary {
    background: #111827;
    color: #ffffff;
}
.btn-primary:hover { background: #000000; }
.btn-primary:disabled {
    background: #6b7280;
    cursor: not-allowed;
}

@media (max-width: 720px) {
    .signature-modal-content {
        max-width: 100%;
        width: 100%;
        border-radius: 14px;
        margin: 8px;
        max-height: calc(100vh - 16px);
    }
    .sig-modal-info-row {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px 18px;
    }
    .sig-modal-info-right {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }
    .signature-modal-header,
    .signature-modal-body,
    .signature-modal-actions {
        padding-left: 18px;
        padding-right: 18px;
    }
    .signer-info-row { grid-template-columns: 1fr; }
    .sig-modal-sig-head { flex-direction: column; align-items: flex-start; gap: 6px; }
    .signature-modal-actions {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 24px 18px 32px;
    }
    .sig-modal-actions-right {
        justify-content: stretch;
        width: 100%;
    }
    .sig-modal-actions-right .btn { flex: 1; justify-content: center; min-height: 44px; }
}
