/* ===== RESET & FONT SIZE +1px ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.3;
    color: #0C4D6D;
    background-color: #f5f5f5;
    padding: 12px;
    font-size: 14px;
}

.form-container {
    max-width: 1100px;
    margin: 0 auto;
    background: white;
    padding: 18px; 
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.06);
}

.form-header {
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0C4D6D;
}

.form-header h1 {
    color: #0C4D6D;
    font-size: 24px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 10px;
    gap: 12px;
}

.form-column {
    flex: 1;
    min-width: 210px;
}

.form-group {
    margin-bottom: 10px;
}

label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
    color: #0C4D6D;
    font-size: 13px;
}

.required::after {
    content: " *";
    color: red;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #0C4D6D;
    border-radius: 4px;
    font-size: 13px;
    color: #0C4D6D;
    background: white;
}

.checkbox-group, .radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    margin-right: 12px;
    margin-bottom: 4px;
    font-size: 13px;
}

.checkbox-item input, .radio-item input {
    margin-right: 5px;
    transform: scale(1.05);
}

.section-divider {
    margin: 16px 0 10px;
    padding: 8px 0;
    border-top: 2px solid #0C4D6D;
    border-bottom: 2px solid #0C4D6D;
    font-size: 18px;
    font-weight: bold;
    color: #0C4D6D;
}

.section-subheader {
    font-size: 15px;
    font-weight: bold;
    color: #0C4D6D;
    margin: 14px 0 6px;
    padding-left: 5px;
    border-left: 3px solid #0C4D6D;
}

/* 3‑column layout for specified sections */
.checklist-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 20px;
    margin-top: 5px;
}
.checklist-3col .checkbox-item {
    margin-right: 0;
    margin-bottom: 5px;
    font-size: 13px;
}
/* 5‑column layout for Extras Supplied */
.extras-5col {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px 15px;
    margin-top: 5px;
}
.extras-5col .checkbox-item {
    margin-right: 0;
    font-size: 12px;
    white-space: nowrap;
}
@media (max-width: 900px) {
    .checklist-3col { grid-template-columns: repeat(2, 1fr); }
    .extras-5col { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .checklist-3col { grid-template-columns: 1fr; }
    .extras-5col { grid-template-columns: 1fr; }
}

.conditional-field {
    display: none;
}
.show-field {
    display: block;
}

/* ===== SIGNATURE STYLES ===== */
.signature-container {
    margin: 15px 0;
    padding: 16px;
    border: 1px dashed #0C4D6D;
    border-radius: 6px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.signature-preview-area {
    width: 100%;
    min-height: 90px;
    border: 1px solid #0C4D6D;
    border-radius: 4px;
    background: white;
    margin: 8px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
}

.signature-preview-img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

.signature-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-sign, .btn-clear-sig {
    padding: 8px 16px;
    background: #0C4D6D;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
}

.btn-clear-sig {
    background: #6c757d;
}

.btn-preview, .btn-submit {
    display: block;
    width: 180px;
    margin: 30px auto 10px;
    padding: 12px;
    background: #0C4D6D;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.btn-preview {
    background: #17a2b8;
}

/* MODAL (POPUP) for signature drawing */
.sig-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: 0.15s;
}
.sig-modal-active {
    visibility: visible;
    opacity: 1;
}
.sig-modal {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    padding: 20px;
}
.sig-modal h3 {
    color: #0C4D6D;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 8px;
}
.sig-canvas-wrapper {
    border: 2px solid #0C4D6D;
    border-radius: 6px;
    background: white;
    margin-bottom: 15px;
    touch-action: none;
}
#activeSigCanvas {
    width: 100%;
    height: 160px;
    display: block;
    cursor: crosshair;
    background: white;
}
.sig-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
.sig-modal-btn {
    padding: 9px 18px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}
.sig-save { background: #0C4D6D; color: white; }
.sig-clear { background: #ffc107; color: #0C4D6D; }
.sig-cancel { background: #6c757d; color: white; }

/* preview modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    visibility: hidden;
    opacity: 0;
    transition: 0.15s;
}
.modal-active {
    visibility: visible;
    opacity: 1;
}
.preview-modal {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}
.modal-header {
    padding: 14px 18px;
    background: #0C4D6D;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}
.modal-header h3 { font-size: 18px; }
.close-modal { background: none; border: none; color: white; font-size: 26px; cursor: pointer; }
.modal-body { padding: 16px 20px; overflow-y: auto; background: #fcfcfc; font-size: 13px; }
.preview-section { margin-bottom: 16px; border-bottom: 1px solid #ddd; padding-bottom: 10px; }
.preview-section h4 { font-size: 15px; color: #0C4D6D; margin-bottom: 8px; border-left: 4px solid #0C4D6D; padding-left: 8px; }
.preview-row { display: flex; flex-wrap: wrap; margin-bottom: 5px; }
.preview-label { font-weight: bold; width: 180px; color: #333; font-size: 13px; }
.preview-value { flex: 1; color: #0C4D6D; font-size: 13px; }
.signature-preview-img { max-width: 200px; max-height: 55px; border: 1px solid #aaa; }
.modal-footer { padding: 14px 18px; background: #eef3f7; display: flex; justify-content: flex-end; gap: 15px; border-radius: 0 0 8px 8px; flex-wrap: wrap; }
.btn-preview-action { padding: 8px 18px; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 13px; }
.btn-preview-cancel { background: #6c757d; color: white; }
.btn-preview-submit { background: #0C4D6D; color: white; }
.btn-preview-pdf { background: #dc3545; color: white; }

.status-message {
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 4px;
    display: none;
    font-size: 13px;
}
.status-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.phone-input-container { display: flex; gap: 8px; }
.phone-country { width: 90px; }
.small-select { padding: 6px; }
.extras-triggers { padding: 10px; background: #f9f9f9; }
.confirmation-text { font-size: 15px; font-weight: bold; color: #0C4D6D; text-align: center; margin-bottom: 8px; }

/* PDF specific styles */
#pdfContent {
    padding: 20px;
    background: white;
    color: #0C4D6D;
    font-family: Arial, sans-serif;
    font-size: 12px;
}
#pdfContent .preview-section {
    margin-bottom: 15px;
    border-bottom: 1px solid #0C4D6D;
    padding-bottom: 10px;
}
#pdfContent .preview-section h4 {
    color: #0C4D6D;
    font-size: 14px;
    margin-bottom: 8px;
    border-left: 4px solid #0C4D6D;
    padding-left: 8px;
}
#pdfContent .preview-row {
    display: flex;
    margin-bottom: 5px;
}
#pdfContent .preview-label {
    font-weight: bold;
    width: 200px;
    color: #333;
}
#pdfContent .preview-value {
    flex: 1;
    color: #0C4D6D;
}
#pdfContent .signature-preview-img {
    max-width: 150px;
    max-height: 40px;
    border: 1px solid #aaa;
}