/* Shared CSS for Printable A4 Forms - Compact v2 */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

@page {
    size: A4;
    margin: 0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    width: 210mm;
    height: 297mm;
    font-family: 'Roboto', sans-serif;
    background: white;
    color: black;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.page-container {
    width: 100%;
    height: 100%;
    padding: 5mm;
    /* Reduced from 15mm/10mm to 5mm for max space */
    display: flex;
    flex-direction: column;
}

/* Header */
.form-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 5px;
    /* Reduced */
    margin-bottom: 5px;
    /* Reduced further */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-box {
    width: 45px;
    /* Reduced */
    height: 45px;
    /* Reduced */
}

.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.header-text {
    flex: 1;
    text-align: center;
    padding: 0 5px;
}

.header-tagline {
    font-size: 10pt;
    font-weight: bold;
    color: #d32f2f;
    /* Red */
    margin-bottom: 2px;
    text-transform: uppercase;
}

.header-title {
    font-size: 11pt;
    font-weight: 800;
    color: #1a237e;
    /* Navy Blue */
    margin-bottom: 3px;
    text-transform: uppercase;
    line-height: 1.2;
}

.header-org {
    font-size: 9pt;
    font-weight: bold;
    margin-bottom: 1px;
    color: #000;
}

.header-collab {
    font-size: 8pt;
    font-weight: normal;
    margin-bottom: 3px;
    color: #333;
}

.header-date {
    font-size: 9pt;
    font-weight: bold;
    color: #555;
}

.form-title-box {
    background: #eee;
    color: #000;
    text-align: center;
    font-size: 12pt;
    /* Reduced */
    font-weight: bold;
    padding: 4px;
    text-transform: uppercase;
    border: 1px solid #000;
    margin-bottom: 15px;
    /* Reduced */
}

/* Sections */
.section {
    margin-bottom: 12px;
    /* Reduced */
}

.section-title {
    font-size: 10pt;
    /* Reduced */
    font-weight: bold;
    text-transform: uppercase;
    background: #f0f0f0;
    padding: 2px 5px;
    border: 1px solid #000;
    margin-bottom: 8px;
    /* Reduced */
}

/* Form Rows */
.form-row {
    display: flex;
    margin-bottom: 8px;
    /* Reduced */
    align-items: baseline;
}

.label {
    font-weight: bold;
    font-size: 9pt;
    /* Reduced */
    margin-right: 8px;
    min-width: 110px;
    /* Reduced */
}

.input-line {
    flex: 1;
    border-bottom: 1px dotted #000;
    height: 18px;
    /* Reduced */
}

/* Character Boxes (for Phone/Email) */
.char-boxes {
    display: flex;
    gap: 2px;
}

.box {
    width: 18px;
    /* Reduced */
    height: 22px;
    /* Reduced */
    border: 1px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    /* Reduced */
}

.checkbox-item {
    display: flex;
    align-items: center;
    font-size: 9pt;
    /* Reduced */
}

.check-box {
    width: 12px;
    /* Reduced */
    height: 12px;
    /* Reduced */
    border: 1px solid #000;
    margin-right: 6px;
    display: inline-block;
}

/* Table Style */
.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.print-table th,
.print-table td {
    border: 1px solid #000;
    padding: 6px;
    /* Reduced */
    text-align: left;
    font-size: 9pt;
    /* Reduced */
}

.print-table th {
    background: #f9f9f9;
}

/* Office Use Box */
.office-use {
    border: 2px dashed #666;
    padding: 8px;
    /* Reduced */
    margin-bottom: 15px;
    /* Reduced */
    background: #fff;
    display: flex;
    justify-content: space-between;
}

.office-label {
    font-weight: bold;
    font-size: 8pt;
    /* Reduced */
    color: #555;
    margin-bottom: 4px;
}

/* Footer Sig */
.signatures-row {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    /* Reduced */
}

.sig-block {
    text-align: center;
    width: 150px;
}

.sig-line {
    border-top: 1px solid #000;
    padding-top: 5px;
    font-weight: bold;
    font-size: 9pt;
    /* Reduced */
}

/* Screen Preview Enhancements */
body {
    background: #525659;
    align-items: center;
    min-height: 100vh;
}

.page-container {
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin: 20px auto;
    position: relative;
    height: 297mm;
    /* Force A4 height in preview */
}

.print-btn-container {
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: center;
}

.print-btn {
    background: #fff;
    color: #333;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Roboto', sans-serif;
}

@media print {
    body {
        background: white;
        display: block;
    }

    .page-container {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 10mm;
        box-shadow: none;
        page-break-after: always;
    }

    .no-print,
    .print-btn-container {
        display: none !important;
    }
}