/* Template 4 membership form, rendered by static/js/membership_tpl4.js.
   Sized for a 794px-wide A4 sheet (210mm at 96dpi). */

.t4-host {
    padding: 0 !important;
    font-family: Arial, Helvetica, sans-serif !important;
}

.t4 {
    --t4-p: #1E6B34;
    --t4-gold: #C9A227;
    --t4-line: #BDBDBD;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    line-height: 1.35;
    color: #222;
    background: #fff;
    text-align: left;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.t4 *, .t4 *::before, .t4 *::after { box-sizing: border-box; }
.t4.t4-nobanner { padding-top: 24px; }

.t4-banner {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
}
.t4-orgline {
    text-align: center;
    font-size: 9px;
    color: #444;
    padding: 6px 35px 0;
}
.t4-dot { margin: 0 8px; color: #999; }

.t4-body { padding: 16px 35px 20px; }

.t4-box {
    border: 1.5px solid var(--t4-p);
    border-radius: 6px;
    padding: 14px 20px 16px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.t4-logo { text-align: center; margin-bottom: 6px; }
.t4-logo img {
    display: inline-block;
    max-height: 60px;
    max-width: 180px;
    object-fit: contain;
}

.t4-head { text-align: center; margin-bottom: 14px; }
.t4-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #2b2b2b;
    overflow-wrap: anywhere;
}
.t4-subtitle {
    font-size: 9.5px;
    font-style: italic;
    color: #666;
    margin-top: 8px;
    overflow-wrap: anywhere;
}

/* Membership type strip */
.t4-mtypes {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid var(--t4-p);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
    break-inside: avoid;
    page-break-inside: avoid;
}
.t4-mt {
    flex: 1 1 0;
    min-width: 96px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    margin: -1px 0 0 -1px;
    border-left: 1px solid var(--t4-p);
    border-top: 1px solid var(--t4-p);
    font-size: 9px;
    font-weight: 700;
    color: var(--t4-p);
    overflow-wrap: anywhere;
}
.t4-cb {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 11px;
    height: 11px;
    border: 1.5px solid var(--t4-gold);
    border-radius: 2px;
    font-size: 9px;
    line-height: 1;
    color: var(--t4-p);
}
.t4-cb.is-checked::after { content: '\2713'; font-weight: 700; }

/* Section headings */
.t4-sec {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--t4-p);
    border-bottom: 1.5px solid var(--t4-gold);
    padding-bottom: 5px;
    margin: 20px 0 14px;
    break-after: avoid;
    page-break-after: avoid;
}

/* Fields */
.t4-personal {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    break-inside: avoid;
    page-break-inside: avoid;
}
.t4-personal-main { flex: 1; min-width: 0; }

.t4-row {
    display: grid;
    gap: 10px 16px;
    margin-bottom: 20px;
    break-inside: avoid;
    page-break-inside: avoid;
}
.t4-row.t4-row-name { grid-template-columns: minmax(0, .45fr) minmax(0, 1fr) minmax(0, 1fr); }

.t4-f { min-width: 0; }
.t4-l {
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--t4-p);
}
.t4-v,
.t4-line {
    border-bottom: 1px solid var(--t4-line);
    font-size: 10px;
    color: #111;
    overflow-wrap: anywhere;
}
.t4-v { min-height: 20px; padding: 4px 2px 2px; }
.t4-line { min-height: 22px; padding: 6px 2px 2px; }

.t4-addr { margin-bottom: 20px; }
.t4-addr-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.t4-same {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 8.5px;
    color: #555;
}

.t4-photo {
    flex-shrink: 0;
    width: 136px;
    height: 164px;
    margin-top: 2px;
    border: 1.5px solid var(--t4-gold);
    border-radius: 6px;
    background: #F3F4F1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    overflow: hidden;
}
.t4-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.t4-photo svg { width: 30px; height: 24px; }
.t4-photo-lbl {
    font-size: 8px;
    font-style: italic;
    color: #777;
    text-align: center;
    line-height: 1.4;
}

.t4-group { break-inside: avoid; page-break-inside: avoid; }

/* Declaration & signature */
.t4-decl {
    margin: 0 0 8px;
    font-size: 9.5px;
    line-height: 1.55;
    color: #333;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.t4-sign {
    display: grid;
    gap: 16px 24px;
    margin-top: 18px;
}
.t4-sig { min-width: 0; }
.t4-sig-space {
    height: 40px;
    border-bottom: 1px solid var(--t4-line);
    display: flex;
    align-items: flex-end;
    padding-bottom: 2px;
}
.t4-sig-space img { max-height: 36px; max-width: 150px; object-fit: contain; }
.t4-sig .t4-l { margin-top: 5px; }

.t4-footer {
    border-top: 2px solid var(--t4-gold);
    margin-top: 4px;
    padding-top: 6px;
    min-height: 8px;
    text-align: center;
    font-size: 8.5px;
    color: #555;
    overflow-wrap: anywhere;
}

/* Compact levels, applied by MembershipTpl4.fit() only when the form would
   otherwise spill onto a second A4 page. */
.t4.t4-dense-1 .t4-body { padding-top: 12px; padding-bottom: 14px; }
.t4.t4-dense-1 .t4-box { padding: 10px 18px 12px; }
.t4.t4-dense-1 .t4-head { margin-bottom: 10px; }
.t4.t4-dense-1 .t4-subtitle { margin-top: 4px; }
.t4.t4-dense-1 .t4-mt { padding: 6px 10px; }
.t4.t4-dense-1 .t4-sec { margin: 12px 0 8px; padding-bottom: 4px; }
.t4.t4-dense-1 .t4-row { margin-bottom: 11px; }
.t4.t4-dense-1 .t4-addr { margin-bottom: 11px; }
.t4.t4-dense-1 .t4-v { min-height: 18px; padding-top: 3px; }
.t4.t4-dense-1 .t4-line { min-height: 18px; padding-top: 3px; }
.t4.t4-dense-1 .t4-photo { width: 120px; height: 146px; }
.t4.t4-dense-1 .t4-sign { margin-top: 10px; }
.t4.t4-dense-1 .t4-sig-space { height: 32px; }

.t4.t4-dense-2 .t4-banner { max-height: 150px; }
.t4.t4-dense-2 .t4-body { padding-top: 8px; padding-bottom: 10px; }
.t4.t4-dense-2 .t4-box { padding: 8px 16px 10px; }
.t4.t4-dense-2 .t4-title { font-size: 14px; }
.t4.t4-dense-2 .t4-head { margin-bottom: 8px; }
.t4.t4-dense-2 .t4-mt { padding: 5px 8px; }
.t4.t4-dense-2 .t4-sec { font-size: 12px; margin: 9px 0 6px; padding-bottom: 3px; }
.t4.t4-dense-2 .t4-row { margin-bottom: 7px; gap: 6px 14px; }
.t4.t4-dense-2 .t4-addr { margin-bottom: 7px; }
.t4.t4-dense-2 .t4-v { min-height: 16px; padding-top: 2px; }
.t4.t4-dense-2 .t4-line { min-height: 16px; padding-top: 2px; }
.t4.t4-dense-2 .t4-photo { width: 110px; height: 134px; gap: 8px; }
.t4.t4-dense-2 .t4-decl { margin-bottom: 4px; }
.t4.t4-dense-2 .t4-sign { margin-top: 6px; }
.t4.t4-dense-2 .t4-sig-space { height: 28px; }

/* Narrow screens (the printed page is always A4 width, so this never applies to print) */
@media screen and (max-width: 640px) {
    .t4.t4-nobanner { padding-top: 14px; }
    .t4-orgline { padding: 6px 12px 0; }
    .t4-body { padding: 12px 10px 16px; }
    .t4-box { padding: 12px 12px 14px; }
    .t4-title { letter-spacing: 2px; }
    .t4-mt { min-width: 45%; }
    .t4-row { gap: 10px; }
    .t4-personal { gap: 10px; }
    .t4-photo { width: 92px; height: 118px; gap: 8px; }
}
