* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-10px);
    }
}

body {
    font-family: 'Arial', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 210mm;
    margin: 0 auto;
    background: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    min-height: 297mm;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
}

.logo-section {
    display: flex;
    align-items: center;
    flex: 1;
}

.logo {
    width: 80px;
    height: 80px;
    margin-right: 15px;
}

.institution-info h2 {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c5aa0;
}

.institution-info p {
    font-size: 11px;
    line-height: 1.3;
}

.form-header {
    text-align: center;
    flex: 1;
}

.form-header h1 {
    font-size: 16px;
    font-weight: bold;
    color: #2c5aa0;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px;
    border-radius: 5px;
}

.code-section {
    background: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.code-section p {
    margin: 5px 0;
    font-size: 11px;
}

.code {
    font-weight: bold;
    font-size: 14px;
    color: #d32f2f;
}

.claim-number {
    font-weight: bold;
    font-size: 18px;
    color: #d32f2f;
    background: #ffe6e6;
    padding: 5px 10px;
    border-radius: 3px;
    border: 1px solid #d32f2f;
}

/* Date Section */
.date-section {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.date-section label {
    font-weight: bold;
    font-size: 12px;
}

.date-section input {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
}

/* Section Styles */
.section {
    margin-bottom: 25px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.section h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    margin: 0;
    font-size: 12px;
    font-weight: bold;
}

.section > div:not(h3) {
    padding: 15px;
}

/* Form Styles */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 11px;
    color: #555;
}

.form-group input,
.form-group textarea {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: Arial, sans-serif;
}

/* Checkbox and Radio Styles */
.checkbox-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
    margin: 0;
    width: auto;
    accent-color: #667eea;
}

.documento-group {
    flex: 2;
}

/* Classification Section */
.classification-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
    border: 1px solid #e9ecef;
}

.classification-section h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 12px;
}

.classification-result {
    background: white;
    padding: 15px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
    min-height: 60px;
}

.classification-result.loading {
    background: #e3f2fd;
    border-color: #2196f3;
}

.classification-result.success {
    background: #e8f5e8;
    border-color: #4caf50;
}

.classification-code {
    font-weight: bold;
    color: #2c5aa0;
    font-size: 14px;
    margin-top: 10px;
}

/* Signature Styles */
.signatures-section > div {
    padding: 15px;
}

.signature-container {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.signature-box,
.fingerprint-box {
    text-align: center;
    flex: 1;
    max-width: 300px;
}

.signature-area,
.fingerprint-area {
    border: 2px solid #333;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 10px;
    min-height: 180px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.signature-area p {
    font-size: 10px;
    text-align: center;
    margin-bottom: 15px;
    color: #666;
}

#firmaCanvas {
    border: 1px solid #ccc;
    background: white;
    cursor: crosshair;
    border-radius: 3px;
}

.signature-controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.signature-controls button {
    padding: 5px 10px;
    font-size: 10px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
}

.signature-controls button:hover {
    background: #f0f0f0;
}

.fingerprint-icon {
    font-size: 60px;
    color: #666;
    margin-bottom: 15px;
}

.fingerprint-area button {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s;
}

.fingerprint-area button:hover {
    background: #5a67d8;
}

.signature-label {
    font-weight: bold;
    font-size: 11px;
    text-align: center;
    display: block;
    margin-top: 10px;
    color: #333;
}

/* Direct Process Styles */
.direct-process-container {
    display: flex;
    gap: 20px;
}

.process-box {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    background: #fafafa;
}

.process-box h4 {
    font-size: 11px;
    margin-bottom: 10px;
    color: #333;
    text-align: center;
    background: #e9ecef;
    padding: 5px;
    border-radius: 3px;
}

.signature-small {
    margin-top: 15px;
    text-align: center;
}

.signature-small label {
    font-size: 9px;
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.mini-signature-area {
    border: 1px solid #ccc;
    height: 60px;
    background: white;
    border-radius: 3px;
}

/* Upload Area Styles */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 5px;
    padding: 30px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e3f2fd;
}

.upload-area i {
    font-size: 40px;
    color: #666;
    margin-bottom: 15px;
}

.upload-area p {
    color: #666;
    margin-bottom: 15px;
}

.upload-area input[type="file"] {
    display: none;
}

.file-list {
    margin-top: 15px;
    text-align: left;
}

.file-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 10px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-item .file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-item .file-size {
    color: #666;
    font-size: 11px;
}

.file-item .remove-file {
    color: #d32f2f;
    cursor: pointer;
    font-size: 16px;
}

.file-item .remove-file:hover {
    color: #b71c1c;
}

/* Submit Section */
.submit-section {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.submit-btn,
.save-draft-btn {
    padding: 12px 30px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 10px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.save-draft-btn {
    background: #6c757d;
    color: white;
}

.save-draft-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Footer Styles */
.footer {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 2px solid #333;
    font-size: 10px;
    line-height: 1.4;
    color: #666;
}

.footer p {
    margin-bottom: 10px;
}

.footer strong {
    color: #333;
}

/* Modal Styles */
.modal {
    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: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    color: #4caf50;
    margin-bottom: 20px;
    font-size: 18px;
}

.claim-code {
    font-size: 24px;
    font-weight: bold;
    color: #2c5aa0;
    background: #e3f2fd;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border: 2px solid #2196f3;
}

.modal-btn {
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.modal-btn {
    background: #667eea;
    color: white;
}

.modal-btn:hover {
    background: #5a67d8;
}

.print-btn {
    background: #4caf50;
}

.print-btn:hover {
    background: #45a049;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.loading-spinner {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.loading-spinner i {
    font-size: 40px;
    color: #667eea;
    margin-bottom: 15px;
}

.loading-spinner p {
    color: #666;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .signature-container {
        flex-direction: column;
    }
    c
    .direct-process-container {
        flex-direction: column;
    }
    
    .checkbox-group {
        flex-direction: column;
        gap: 5px;
    }
}

@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        max-width: none;
        margin: 0;
        padding: 20px;
    }
    
    .submit-section {
        display: none;
    }
    
    .signature-controls {
        display: none;
    }
    
    .upload-area {
        display: none;
    }
}

/* Validation Styles */
.form-group input:invalid,
.form-group textarea:invalid {
    border-color: #dc3545;
}

.form-group input:valid,
.form-group textarea:valid {
    border-color: #28a745;
}

.error-message {
    color: #dc3545;
    font-size: 11px;
    margin-top: 5px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #dc3545;
    background-color: #fff5f5;
}

/* Animation for classification */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.classification-result.loading {
    animation: pulse 1.5s infinite;
}

/* Success state animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal {
    animation: slideIn 0.3s ease-out;
}