﻿/* ============================================================
   Termo Motor 968 — Design Clean/Minimalista
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: #eee;
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 13px;
    color: #000;
    padding: 20px;
}

/* ── Container ── */
.page-container {
    background: #fff;
    width: 100%;
    max-width: 210mm;
    margin: 10mm auto;
    padding: 12mm 14mm 18mm;
    box-shadow: 0 2px 16px rgba(0,0,0,0.12);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ── Logos ── */
.doc-header { margin-bottom: 10px; }
.logo-area { width: 100%; display: flex; justify-content: center; }
.header-image { max-width: 100%; height: auto; max-height: 90px; object-fit: contain; }

/* ── Título ── */
.doc-res {
    text-align: center;
    font-size: 11px;
    color: #666;
    margin-bottom: 3px;
    letter-spacing: 0.4px;
}

.doc-title {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #111;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ccc;
}

.content { flex-grow: 1; }

/* ── Seções ── */
.form-section { margin-bottom: 12px; }

.section-title {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    color: #555;
    letter-spacing: 1px;
    margin-bottom: 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid #ddd;
}

/* ── Grid dos campos ── */
.grid-box {
    display: grid;
    border: 1px solid #ccc;
}

.declarant-grid { grid-template-columns: 2fr 1fr; }
.vehicle-grid   { grid-template-columns: 1fr 1fr 2fr; }

.field-box {
    padding: 5px 7px;
    display: flex;
    flex-direction: column;
    min-height: 44px;
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

/* Remove bordas redundantes */
.declarant-grid .field-box:nth-child(2) { border-right: none; }
.declarant-grid .field-box.field-full   { grid-column: span 2; border-right: none; border-bottom: none; }
.vehicle-grid .field-box:nth-child(3)   { border-right: none; }
.vehicle-grid .field-box:nth-child(4)   { border-bottom: none; }
.vehicle-grid .field-box:nth-child(5)   { border-bottom: none; }
.vehicle-grid .field-box:nth-child(6)   { border-right: none; border-bottom: none; }
.field-box.field-full { grid-column: 1 / -1; }

.field-box label {
    font-size: 9.5px;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.field-box input {
    border: none;
    border-bottom: 1px solid #bbb;
    outline: none;
    font-size: 12px;
    width: 100%;
    background: transparent;
    font-family: inherit;
    padding: 1px 0;
    color: #000;
}

.field-box input:focus {
    border-bottom-color: #333;
    background: rgba(0,0,0,0.02);
}

/* Endereço inline */
.field-inline { display: flex; align-items: baseline; gap: 6px; width: 100%; }
.field-inline input { flex: 1; }
.field-suffix { font-size: 11px; white-space: nowrap; color: #555; }

/* ── Caixa Declaração ── */
.declaration-box {
    border: 1px solid #ccc;
    padding: 9px 11px;
    background: #fafafa;
}

.declaration-text {
    font-size: 12px;
    line-height: 1.65;
    text-align: justify;
    color: #222;
}

/* Campo número do motor */
.motor-field {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 7px 0;
    padding: 4px 8px;
    border-left: 2px solid #bbb;
    background: #fff;
}

.motor-field label {
    font-size: 9.5px;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.motor-field input {
    flex: 1;
    max-width: 260px;
    border: none;
    border-bottom: 1px solid #bbb;
    outline: none;
    font-size: 12px;
    font-weight: bold;
    background: transparent;
    font-family: inherit;
    color: #000;
}

.motor-field input:focus { border-bottom-color: #333; }

/* ── Caixa Legal ── */
.legal-box {
    border: 1px solid #ddd;
    padding: 8px 11px;
    margin-bottom: 14px;
    background: #fafafa;
}

.legal-box p {
    font-size: 11.5px;
    line-height: 1.6;
    text-align: justify;
    color: #444;
}

/* ── Data e Assinatura ── */
.footer-sign {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.date-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    flex-wrap: wrap;
}

.date-input {
    border: none;
    border-bottom: 1px solid #999;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    text-align: center;
    padding: 0 2px;
}

.date-input.day   { width: 35px; }
.date-input.month { width: 120px; }
.date-input.year  { width: 55px; }

.signature-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 14px;
}

.signature-line {
    width: 50%;
    border-top: 1px solid #000;
    margin-bottom: 5px;
}

.sig-label {
    font-size: 11px;
    text-align: center;
    color: #444;
    font-weight: 600;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Rodapé do documento ── */
.page-footer-info {
    display: flex;
    justify-content: space-between;
    font-size: 8.5px;
    color: #999;
    margin-top: 20px;
    padding-top: 6px;
    border-top: 1px solid #eee;
}

.website-link { font-weight: bold; color: #555; }

/* Barra sutil no rodapé */
.color-bar-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #ccc;
}

/* ============================================================
   IMPRESSÃO — A4 em UMA página
   ============================================================ */
@media print {

    @page {
        size: A4 portrait;
        margin: 8mm 12mm;
    }

    .top-bar,
    .main-header,
    footer,
    .mobile-menu-btn,
    .fab-container,
    .no-print {
        display: none !important;
    }

    body {
        background: transparent;
        padding: 0;
        margin: 0;
        font-size: 11px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .doc-header    { margin-bottom: 6px; }
    .header-image  { max-height: 70px; }
    .doc-title     { font-size: 12px; margin-bottom: 8px; padding-bottom: 5px; }
    .doc-res       { font-size: 10px; }

    .form-section  { margin-bottom: 8px; }
    .section-title { margin-bottom: 2px; padding-bottom: 2px; font-size: 9px; }

    .field-box        { min-height: 36px; padding: 3px 6px; }
    .field-box label  { font-size: 8.5px; margin-bottom: 2px; }
    .field-box input  { font-size: 11px; background: transparent !important; }

    .declaration-box  { padding: 6px 9px; }
    .declaration-text { font-size: 11px; line-height: 1.5; }
    .motor-field      { margin: 5px 0; padding: 3px 7px; }
    .motor-field input { font-size: 11px; background: transparent !important; }
    .motor-field label { font-size: 8.5px; }

    .legal-box    { padding: 6px 9px; margin-bottom: 8px; }
    .legal-box p  { font-size: 10.5px; }

    .footer-sign  { gap: 12px; }
    .date-line    { font-size: 11px; }
    .date-input   { font-size: 11px; background: transparent !important; }
    .sig-label    { font-size: 10px; }
    .signature-area { margin-top: 8px; }

    .page-footer-info { font-size: 8px; margin-top: 10px; padding-top: 4px; }
    .color-bar-bottom { display: none !important; }
}
