/* ================================================================
   SIGNATURE PAD — Cezer Staff Panel
   Non-dismissable popup overlay requiring staff digital signature
   ================================================================ */

/* ── Overlay (fullscreen lock) ───────────────────────────── */
.sig-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: sigFadeIn 0.35s ease;
}

@keyframes sigFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal card ──────────────────────────────────────────── */
.sig-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    width: 100%;
    max-width: 560px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
    animation: sigSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sigSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Modal header ────────────────────────────────────────── */
.sig-header {
    padding: 1.5rem 1.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.sig-header-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: rgba(228, 226, 221, 0.07);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--beige);
}
.sig-header-icon i, .sig-header-icon svg {
    width: 22px;
    height: 22px;
}
.sig-header-text h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}
.sig-header-text p {
    font-size: 0.775rem;
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.55;
}

/* ── Body ────────────────────────────────────────────────── */
.sig-body {
    padding: 1.5rem 1.75rem;
}

/* ── Info badge ──────────────────────────────────────────── */
.sig-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: rgba(228, 226, 221, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.775rem;
    color: var(--text-secondary);
    line-height: 1.55;
}
.sig-notice i, .sig-notice svg {
    width: 15px;
    height: 15px;
    color: var(--beige);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Canvas label ────────────────────────────────────────── */
.sig-canvas-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
    margin-bottom: 0.6rem;
}

/* ── Canvas wrapper ──────────────────────────────────────── */
.sig-canvas-wrap {
    position: relative;
    border: 1.5px dashed var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    cursor: crosshair;
    user-select: none;
    touch-action: none;
}
.sig-canvas-wrap:focus-within,
.sig-canvas-wrap.sig-drawing {
    border-color: var(--beige);
    border-style: solid;
}
.sig-canvas {
    display: block;
    width: 100%;
    height: 160px;
}
.sig-canvas-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.2s;
}
.sig-canvas-hint span {
    font-size: 0.8rem;
    color: #aaa;
    font-style: italic;
}
.sig-canvas-wrap.has-content .sig-canvas-hint {
    opacity: 0;
}

/* ── Actions ─────────────────────────────────────────────── */
.sig-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
}
.sig-btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.sig-btn-clear:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}
.sig-btn-clear i, .sig-btn-clear svg { width: 13px; height: 13px; }

.sig-btn-submit {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    background: var(--beige);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: -0.01em;
}
.sig-btn-submit:hover:not(:disabled) {
    background: var(--beige-dark);
    transform: translateY(-1px);
}
.sig-btn-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.sig-btn-submit i, .sig-btn-submit svg { width: 15px; height: 15px; }

/* ── Error state ─────────────────────────────────────────── */
.sig-error {
    margin-top: 0.75rem;
    font-size: 0.775rem;
    color: #e06c6c;
    display: none;
}
.sig-error.visible { display: block; }

/* ── Success overlay inside modal ────────────────────────── */
.sig-success-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 10;
    border-radius: 18px;
}
.sig-success-overlay.visible {
    opacity: 1;
    pointer-events: all;
}
.sig-success-check {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(80, 200, 120, 0.12);
    border: 2px solid rgba(80, 200, 120, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6bcf7f;
    animation: sigCheckPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}
.sig-success-check i, .sig-success-check svg {
    width: 30px;
    height: 30px;
}
@keyframes sigCheckPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.sig-success-text {
    text-align: center;
}
.sig-success-text h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}
.sig-success-text p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin: 0;
}

/* ── Scrollbar lock when overlay active ──────────────────── */
body.sig-locked {
    overflow: hidden;
}

/* ── Mobile responsive ───────────────────────────────────── */
@media (max-width: 768px) {
    .sig-modal {
        border-radius: 14px;
        max-width: calc(100vw - 24px);
    }
    .sig-header {
        padding: 1.25rem 1.25rem 1rem;
    }
    .sig-header-text h2 {
        font-size: 0.95rem;
    }
    .sig-header-text p {
        font-size: 0.73rem;
    }
    .sig-body {
        padding: 1.25rem;
    }
    .sig-notice {
        font-size: 0.73rem;
        padding: 0.7rem 0.85rem;
    }
    .sig-canvas {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .sig-overlay {
        padding: 0.5rem;
    }
    .sig-modal {
        max-width: 100%;
        border-radius: 12px;
    }
    .sig-header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.65rem;
    }
    .sig-header-icon {
        width: 38px;
        height: 38px;
    }
    .sig-body {
        padding: 1rem;
    }
    .sig-canvas {
        height: 120px;
    }
    .sig-actions {
        flex-direction: column;
    }
    .sig-btn-clear {
        width: 100%;
        justify-content: center;
    }
    .sig-btn-submit {
        width: 100%;
    }
    .sig-success-check {
        width: 52px;
        height: 52px;
    }
    .sig-success-check i, .sig-success-check svg {
        width: 24px;
        height: 24px;
    }
    .sig-success-text h3 {
        font-size: 0.9rem;
    }
    .sig-success-text p {
        font-size: 0.75rem;
    }
}
