/* =====================================================
   GLOBAL RESET & BASE STYLES - MODIFIED
   ===================================================== */
/* 
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
*/

/* More specific reset that won't interfere with input behavior */
div,
section,
header,
footer,
nav,
article,
aside,
main,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
ul,
ol,
li,
dl,
dt,
dd,
figure,
figcaption {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.acceptance-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.acceptance-popup {
    background: white;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    position: relative;

    /* Enhanced A4 proportions styling */
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    line-height: 1.6;
}

.acceptance-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 40px 50px 30px;
    border-bottom: 3px solid #2c5530;
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.logo-section {
    flex-shrink: 0;
}

.acceptance-logo {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.document-info {
    flex-grow: 1;
    text-align: center;
    margin: 0 30px;
}

.document-info h2 {
    margin: 0 0 20px 0;
    font-size: 32px;
    font-weight: 700;
    color: #2c5530;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.document-info p {
    margin: 8px 0;
    font-size: 16px;
    color: #444;
    font-weight: 500;
}

.document-info p strong {
    color: #2c5530;
    font-weight: 600;
}

.close-acceptance {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-acceptance:hover {
    background: #f5f5f5;
    color: #333;
}

.acceptance-body {
    padding: 40px 50px 50px;
    line-height: 1.7;
}

.acceptance-text {
    margin-bottom: 40px;
    font-size: 15px;
    color: #444;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    border-left: 4px solid #2c5530;
}

.acceptance-text p {
    margin: 0 0 18px 0;
}

.acceptance-text p strong {
    color: #2c5530;
    font-weight: 600;
}

.acceptance-text ul {
    margin: 20px 0 20px 25px;
    padding: 0;
}

.acceptance-text li {
    margin-bottom: 12px;
    color: #555;
    position: relative;
}

.acceptance-text li::marker {
    color: #2c5530;
}

.order-summary {
    margin: 40px 0;
    padding: 0;
    border-radius: 10px;
    background: black;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.order-summary h3 {
    margin: 0;
    font-size: 20px;
    color: white;
    background: #2c5530;
    padding: 20px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-table {
    width: 100%;
}

.summary-item {
    margin: 0;
    padding: 25px 30px;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.summary-item:hover {
    background: #f8f9fa;
}

.summary-item:last-of-type {
    border-bottom: none;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.item-name {
    font-weight: 600;
    font-size: 18px;
    color: #2c5530;
}

.item-total {
    font-weight: 700;
    font-size: 20px;
    color: #2c5530;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 6px;
}

.item-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.5;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #2c5530;
}

.item-details {
    display: flex;
    gap: 30px;
    font-size: 13px;
    color: #777;
    font-weight: 500;
}

.summary-totals {
    margin: 0;
    padding: 30px;
    background: linear-gradient(135deg, #2c5530 0%, #1a3d1e 100%);
    color: white;
}

.total-line {
    display: flex;
    justify-content: space-between;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.signature-section {
    margin: 40px 0;
    padding: 30px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.signature-section h3 {
    margin: 0 0 25px 0;
    font-size: 20px;
    color: #2c5530;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signature-mode-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 25px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9ecef;
}

.mode-btn {
    padding: 12px 24px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.mode-btn.active {
    background: #2c5530;
    color: white;
}

.mode-btn:hover:not(.active) {
    background: #f8f9fa;
    color: #2c5530;
}

.signature-input {
    margin-bottom: 25px;
}

#signature-canvas {
    border: 3px solid #e9ecef;
    border-radius: 8px;
    cursor: crosshair;
    display: block;
    width: 100%;
    max-width: 500px;
    height: 200px;
    background: white;
    transition: border-color 0.3s ease;
}

#signature-canvas:focus {
    outline: none;
    border-color: #2c5530;
    box-shadow: 0 0 0 3px rgba(44, 85, 48, 0.1);
}

.signature-controls {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-signature {
    padding: 10px 20px;
    border: 2px solid #dc3545;
    background: white;
    color: #dc3545;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.clear-signature:hover {
    background: #dc3545;
    color: white;
}

.signature-instructions {
    font-size: 13px;
    color: #777;
    margin: 0;
    font-style: italic;
}

.typed-signature {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    border: 3px solid #e9ecef;
    border-radius: 8px;
    font-size: 24px;
    font-family: 'Dancing Script', 'Brush Script MT', cursive;
    background: white;
    transition: border-color 0.3s ease;
}

.typed-signature:focus {
    outline: none;
    border-color: #2c5530;
    box-shadow: 0 0 0 3px rgba(44, 85, 48, 0.1);
}

.acceptance-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
    gap: 20px;
}

.cancel-acceptance,
.confirm-acceptance {
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 180px;
}

.cancel-acceptance {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.cancel-acceptance:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

.confirm-acceptance {
    background: linear-gradient(135deg, #2c5530 0%, #1a3d1e 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(44, 85, 48, 0.3);
}

.confirm-acceptance:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 85, 48, 0.4);
}

.confirm-acceptance:disabled {
    background: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.acceptance-success {
    text-align: center;
    padding: 80px 50px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.success-icon {
    font-size: 80px;
    margin-bottom: 30px;
    color: #28a745;
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.acceptance-success h2 {
    color: #2c5530;
    margin: 0 0 25px 0;
    font-size: 28px;
    font-weight: 700;
}

.acceptance-success p {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #555;
    line-height: 1.6;
}

.close-success {
    margin-top: 40px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #2c5530 0%, #1a3d1e 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.close-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 85, 48, 0.4);
}

.optional-items-section {
    margin-top: 15px;
    padding: 15px;
    background: #f1f3f4;
    border-radius: 6px;
    border-left: 3px solid #4285f4;
}

.optional-items-section h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #4285f4;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.optional-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.optional-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e8eaed;
    font-size: 13px;
}

.optional-name {
    color: #555;
    font-weight: 500;
}

.optional-price {
    color: #4285f4;
    font-weight: 600;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .acceptance-popup-overlay {
        padding: 10px;
    }

    .acceptance-popup {
        max-height: 95vh;
        aspect-ratio: auto;
    }

    .acceptance-header {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }

    .acceptance-body {
        padding: 20px;
    }

    .document-info {
        margin: 15px 0 0 0;
    }

    .acceptance-actions {
        flex-direction: column;
        gap: 15px;
    }

    .cancel-acceptance,
    .confirm-acceptance {
        width: 100%;
    }

    #signature-canvas {
        height: 150px;
    }
}

/* Print styles for PDF generation */
@media print {
    .acceptance-popup-overlay {
        position: static;
        background: none;
        padding: 0;
    }

    .acceptance-popup {
        max-width: none;
        max-height: none;
        box-shadow: none;
        border-radius: 0;
        overflow: visible;
    }

    .close-acceptance {
        display: none;
    }

    .acceptance-actions {
        display: none;
    }
}