/**
 * Signature Capture Styles for Customer Portal
 * Optional signature section with ESIGN compliance
 * 
 * @package Silva_Customer_Portal
 * @version 2.2.2
 */

/* ========================================
   Signature Section
   ======================================== */

.signature-section {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.signature-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.signature-section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #2c3e50;
}

.toggle-signature-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.toggle-signature-btn:hover {
    background: #0056b3;
}

.toggle-signature-btn .toggle-icon {
    transition: transform 0.3s;
}

.toggle-signature-btn.active .toggle-icon {
    transform: rotate(180deg);
}

.signature-fields {
    margin-top: 1rem;
}

.signature-description {
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 1rem;
}

/* ========================================
   Signature Pad
   ======================================== */

.signature-pad-wrapper {
    margin-bottom: 1.5rem;
}

.signature-pad-wrapper label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.signature-name-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}

.signature-name-input:focus {
    outline: none;
    border-color: #007bff;
}

.signature-canvas-container {
    position: relative;
    background: white;
    border: 2px dashed #ced4da;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 0.5rem;
}

#portal-signature-canvas {
    display: block;
    width: 100%;
    height: 200px;
    touch-action: none;
    cursor: crosshair;
}

.clear-signature-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s;
    z-index: 10;
}

.clear-signature-btn:hover {
    background: #c82333;
}

.signature-help {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* ========================================
   ESIGN Compliance Checkbox
   ======================================== */

.acceptance-checkbox {
    background: #fff;
    padding: 1rem;
    border: 2px solid #007bff;
    border-radius: 4px;
    margin-top: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-text {
    color: #2c3e50;
    font-size: 0.9rem;
    line-height: 1.5;
}

.checkbox-text strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #007bff;
}

/* ========================================
   Approve Button States
   ======================================== */

#approve-estimate-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

#approve-estimate-btn:not(:disabled) {
    background-color: #28a745;
}

#approve-estimate-btn:not(:disabled):hover {
    background-color: #218838;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .signature-section {
        padding: 1rem;
    }
    
    .signature-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .toggle-signature-btn {
        width: 100%;
        justify-content: center;
    }
    
    #portal-signature-canvas {
        height: 150px;
    }
    
    .checkbox-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .signature-section-header h3 {
        font-size: 1.1rem;
    }
    
    #portal-signature-canvas {
        height: 120px;
    }
    
    .signature-name-input {
        font-size: 0.9rem;
        padding: 0.6rem;
    }
}
