* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    padding: 20px;
    line-height: 1.6;
    color: #1a1a1b;
}

h1, h2, h3, .document-title {
    font-family: 'Outfit', sans-serif;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.form-section {
    flex: 1;
    min-width: 300px;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.signature-container {
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#signatureCanvas {
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: crosshair;
    background: white;
    display: block;
}

.btn-clear {
    margin-top: 10px;
    padding: 8px 16px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-clear:hover {
    background: #ff5252;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #45a049 0%, #2e7d32 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0b7dda 0%, #1565C0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.document-section {
    flex: 1;
    min-width: 300px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.document-a4 {
    width: 210mm;
    min-height: 297mm;
    background: white;
    padding: 15mm 20mm;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    position: relative;
}

.document-header {
    text-align: center;
    margin-bottom: 20px;
}

.header-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.logo {
    max-width: 200px;
    height: auto;
}

.document-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.document-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.document-text {
    text-align: justify;
    font-size: 14.5px;
    line-height: 1.8;
    margin-bottom: 25px;
    flex: 1;
    color: #333;
}

.section-container {
    margin: 20px 0;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1b;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.equipment-list {
    background: #fdfdfd;
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid #4CAF50;
    margin: 15px 0;
}

.equipment-list p {
    margin-bottom: 5px !important;
}

.document-text p {
    margin-bottom: 12px;
    text-indent: 0;
}

.field {
    border-bottom: 2px solid #333;
    padding: 0 5px;
    min-width: 150px;
    display: inline-block;
    font-weight: bold;
}

.document-date {
    text-align: right;
    margin: 25px 0 20px 0;
    font-size: 14px;
}

.signature-section {
    margin-top: 50px;
    margin-bottom: 30px;
}

.signatures-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 60px;
    margin-top: 30px;
}

.signature-client {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.signature-xnova {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.signature-label {
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 14px;
    text-align: left;
}

.signature-xnova .signature-label {
    text-align: right;
}

.signature-display {
    display: inline-block;
    padding: 0;
    background: transparent;
    border: none;
}

#signatureDisplay {
    display: block;
    border: none;
    background: white;
}

.cachet-display {
    display: inline-block;
    padding: 0;
}

.cachet {
    max-width: 150px;
    height: auto;
    display: block;
}

.document-footer {
    text-align: center;
    margin-top: auto;
    padding-top: 20px;
}

.footer-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .form-section,
    .form-actions {
        display: none;
    }
    
    .document-a4 {
        box-shadow: none;
        border: none;
        margin: 0;
        padding: 20mm;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .document-a4 {
        width: 100%;
        min-height: auto;
    }
    
    .signatures-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .signature-xnova {
        text-align: left;
    }
}
