/* ============================================================
   DECLARAÇÃO QUILOMBOLA — IFAM 2026
   style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@400;600;700&family=Source+Sans+3:wght@400;600;700&display=swap');

/* ===== VARIABLES ===== */
:root {
    --green-dark:  #00441b;
    --green-mid:   #1b7340;
    --green-light: #e8f5e9;
    --border:      #000;
    --text:        #1a1a1a;
    --label-color: #444;
    --input-bg:    #fafff9;
    --input-border:#9bbf9b;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== BODY ===== */
body {
    font-family: 'Source Sans 3', Arial, sans-serif;
    background-color: #dce8dc;
    padding: 24px 16px;
    color: var(--text);
    font-size: 10.5pt;
    line-height: 1.5;
}

/* ===== PAGE WRAPPER ===== */
.page-wrapper {
    max-width: 794px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ===== PAGE CARD ===== */
.page {
    background: #fff;
    width: 100%;
    padding: 30px 35px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 4px;
    position: relative;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    border-bottom: 3px solid var(--green-dark);
    margin-bottom: 18px;
    padding-bottom: 14px;
}
.logo-ifam {
    height: 65px;
    width: auto;
    margin-bottom: 8px;
    object-fit: contain;
}
h1 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 13pt;
    color: var(--green-dark);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
    line-height: 1.3;
}
.header p {
    font-size: 9.5pt;
    color: #555;
}

/* ===== SECTION TITLES ===== */
h2 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 9.5pt;
    background-color: var(--green-light);
    color: var(--green-dark);
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-left: 5px solid var(--green-dark);
    margin: 18px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===== TABLE ===== */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
td {
    border: 1px solid var(--border);
    padding: 7px 9px;
    vertical-align: top;
    word-wrap: break-word;
}
td.section-header {
    background-color: #f0f4f0;
    font-weight: 700;
    font-size: 9pt;
    color: var(--green-dark);
}

/* ===== LABELS ===== */
.field-label {
    font-weight: 700;
    font-size: 8pt;
    display: block;
    margin-bottom: 3px;
    color: var(--label-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===== INPUTS (shared base) ===== */
.input-editable,
input[type="text"],
input[type="email"],
input[type="date"] {
    width: 100%;
    border: 1px solid var(--input-border);
    border-radius: 3px;
    background: var(--input-bg);
    font-family: 'Source Sans 3', Arial, sans-serif;
    font-size: 10pt;
    padding: 4px 6px;
    box-sizing: border-box;
    display: block;
    resize: none;
    overflow: hidden;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-editable:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--green-mid);
    box-shadow: 0 0 0 2px rgba(27,115,64,0.15);
}
textarea.input-editable {
    min-height: 28px;
}

/* ===== INLINE INPUT (inside paragraph) ===== */
.inline-input {
    display: inline !important;
    width: auto !important;
    min-width: 40px;
    max-width: 80px;
    border: none !important;
    border-bottom: 1.5px solid #666 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-family: 'Source Sans 3', Arial, sans-serif;
    font-size: 10pt;
    padding: 0 4px 1px;
    vertical-align: baseline;
    line-height: inherit;
    transition: border-color 0.2s;
}
.inline-input:focus {
    outline: none;
    border-bottom-color: var(--green-mid) !important;
    box-shadow: none !important;
}

/* ===== INSTRUCTION BOX ===== */
.instruction-box {
    border: 1px solid var(--border);
    border-top: none;
    padding: 14px 16px;
    text-align: justify;
    font-size: 10pt;
    line-height: 1.6;
}
.instruction-box .inline-field {
    margin-top: 10px;
}
.instruction-box textarea.input-editable,
.instruction-box input[type="text"] {
    margin-top: 3px;
}

/* ===== CITY/STATE ROW ===== */
.city-state-row {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}
.city-state-row .city-block { flex: 2; }
.city-state-row .state-block { flex: 1; }

/* ===== SIGNATURE ===== */
.sig-line {
    border-top: 1px solid #000;
    width: 90%;
    margin: 70px auto 5px;
}
.sig-block {
    text-align: center;
}
.sig-block span {
    font-size: 8pt;
    color: #555;
}

/* ===== BOTTOM ROW (local + assinatura) ===== */
.bottom-row {
    display: flex;
    margin-top: 24px;
    align-items: flex-end;
    gap: 20px;
}
.bottom-row .location-block { flex: 1.2; }
.bottom-row .sig-block      { flex: 1; }

/* ===== SIGNATURES ROW (3 cols) ===== */
.sigs-row {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
    text-align: center;
}
.sigs-row .sig-block { width: 30%; }

/* ===== OBS ===== */
.obs-destaque {
    font-weight: 700;
    font-size: 10.5pt;
    text-align: center;
    margin: 22px 0 10px;
    display: block;
    color: #000;
}

/* ===== PAGE INDICATOR ===== */
.page-indicator {
    text-align: right;
    font-size: 8pt;
    color: #888;
    margin-top: 18px;
    font-style: italic;
}

/* ===== PRINT BUTTON ===== */
.btn-wrapper {
    text-align: center;
    margin: 20px 0 10px;
}
.print-btn {
    background-color: var(--green-dark);
    color: #fff;
    padding: 12px 32px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Source Sans 3', Arial, sans-serif;
    font-size: 11pt;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: background-color 0.2s;
}
.print-btn:hover { background-color: var(--green-mid); }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 600px) {
    body { padding: 12px 8px; font-size: 10pt; }

    .page { padding: 18px 14px; }

    h1 { font-size: 11pt; }

    /* Stack table cells vertically on mobile */
    table, tbody, tr, td { display: block; width: 100% !important; }
    tr { border-bottom: none; }
    td { border-bottom: none; }
    /* Restore outer borders per row */
    tr:last-child td:last-child { border-bottom: 1px solid var(--border); }

    /* city/state side by side even on mobile */
    .city-state-row { flex-direction: row; }
    .city-state-row .state-block { flex: 0 0 80px; }

    /* bottom-row stack */
    .bottom-row { flex-direction: column; align-items: stretch; gap: 16px; }
    .bottom-row .sig-block { width: 100%; }

    /* signatures row — stack */
    .sigs-row { flex-direction: column; align-items: center; gap: 20px; }
    .sigs-row .sig-block { width: 80%; }

    .sig-line { margin-top: 50px; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {

    /* Hide UI chrome */
    .no-print,
    .btn-wrapper { display: none !important; }

    body {
        background: #fff;
        padding: 0;
        margin: 0;
        font-size: 10pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        size: A4 portrait;
        margin: 1.5cm;
    }

    .page-wrapper { max-width: 100%; gap: 0; }

    .page {
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        /* Force each .page onto its own printed page */
        page-break-after: always;
        break-after: page;
    }
    .page:last-child {
        page-break-after: avoid;
        break-after: avoid;
    }

    /* Clean inputs for print — remove borders/bg, keep bottom line */
    .input-editable,
    input[type="text"],
    input[type="email"],
    input[type="date"] {
        border: none !important;
        border-bottom: 1px solid #555 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Hide placeholders on print */
    .input-editable::placeholder,
    input::placeholder { color: transparent !important; }

    /* Keep background colors */
    h2 {
        background-color: var(--green-light) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    td.section-header {
        background-color: #f0f4f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Restore table layout for print */
    table, tbody, tr, td { display: table-cell; }
    table { display: table; }
    tbody { display: table-row-group; }
    tr    { display: table-row; }

    .page-indicator { color: #333; }
}
