/* Wave 3 free tools (spec-ferramentas-gratis): warranty term, check-in checklist, service authorization,
   spreadsheets, WhatsApp messages and service reminder. Only what tools.css does not have; same tokens as
   landing.css. Plain CSS like the rest of the marketing pages (no output.css / Tailwind there, D4). */

/* ---------- sheet extras ---------- */
.doc-hand { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); cursor: pointer; }
.doc-hand input { width: 18px; height: 18px; accent-color: var(--brand); }

@media (min-width: 640px) { .sh-grid-3 { grid-template-columns: 2fr 1fr 1fr; } }

/* Textareas grow with the text (tools-documents.js), so nothing is cut off on paper. */
.sheet textarea[data-autogrow] { overflow: hidden; resize: none; }
.sh-block .sh-label + .sh-area, .sh-area + .sh-label { margin-top: 6px; }
.ck-gap { margin-top: 12px; }

.sh-note { margin-top: 8px; padding: 8px 12px; border-left: 2px solid #C98A00; background: #FFF7E0; color: var(--ink); font-size: 13px; }
.sh-note[hidden] { display: none; }

/* ---------- warranty term ---------- */
.sh-terms { display: grid; gap: 4px; }
.sh-terms p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sh-days { width: 64px; text-align: center; }
.sh-terms b { font-variant-numeric: tabular-nums; }

.wl { list-style: disc; padding-left: 20px; display: grid; gap: 2px; }
.wl li { display: list-item; }
.wl li > .sh-in { width: calc(100% - 40px); }
.wl li > .sh-del { vertical-align: middle; }

.sh-legal { margin: 16px 0 4px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 4px; background: #F6F8FB; font-size: 12.5px; line-height: 1.55; color: var(--ink); }

/* ---------- service authorization ---------- */
.auth-amount { margin-top: 10px; line-height: 2.1; }
.auth-money { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.auth-money .sh-in { min-width: 120px; font-weight: 700; }

/* ---------- check-in checklist ---------- */
/* Custom box instead of the native checkbox: the native one prints differently in each browser and
   disappears in some print previews. The tick is a background image, kept on paper by print-color-adjust. */
.ck {
    appearance: none; -webkit-appearance: none; flex: none;
    width: 22px; height: 22px; margin: 0; vertical-align: middle; cursor: pointer;
    border: 1.5px solid var(--ink); border-radius: 3px; background: #fff;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.ck:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 2px; }
.ck:checked {
    background: #101722 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.ck-bad:checked { background-color: #B42318; border-color: #B42318; }

.ck-fuel { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.ck-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 600; cursor: pointer; }

.ck-cols { display: grid; gap: 0 28px; }
@media (min-width: 900px) { .ck-cols { grid-template-columns: 1fr 1fr; } }
.ck-table { width: 100%; border-collapse: collapse; }
.ck-table th { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--ink); }
.ck-table td { padding: 1px 4px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.ck-table .ck-c { width: 58px; text-align: center; }
.ck-table .ck-obs { width: 30%; }
.ck-table td .sh-in { border-bottom: 0; }

/* On a phone the observation goes under the item, so the three boxes keep a 40px touch target. */
@media (max-width: 719px) {
    .ck-table, .ck-table thead, .ck-table tbody { display: block; }
    .ck-table tr { display: grid; grid-template-columns: minmax(0, 1fr) 52px 52px 52px; align-items: center; }
    .ck-table th, .ck-table td { width: auto !important; }
    .ck-table thead .ck-obs { display: none; }
    .ck-table td { border-bottom: 0; min-height: 40px; display: flex; align-items: center; }
    .ck-table td.ck-c { justify-content: center; }
    .ck-table td.ck-obs { grid-column: 1 / -1; }
    .ck-table tbody tr { border-bottom: 1px solid var(--rule); padding: 4px 0; }
}

.ck-declare { margin-top: 14px; font-size: 13px; color: var(--ink); }
.ck-exit { padding-top: 34px; }

/* ---------- spreadsheets ---------- */
.xl-grid { display: grid; gap: 18px; }
@media (min-width: 960px) { .xl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.xl-card { background: var(--surf); border: 1px solid var(--hair); border-top: 2px solid var(--brand); border-radius: var(--r); padding: 24px 22px; display: flex; flex-direction: column; gap: 12px; }
.xl-sum { color: var(--fg); }
.xl-list { list-style: disc; padding-left: 18px; display: grid; gap: 6px; color: var(--dim); font-size: .9rem; flex: 1; }
.xl-go { align-self: flex-start; }
.xl-note { margin-top: 16px; }

/* ---------- WhatsApp messages and reminder ---------- */
.wa-types { display: flex; flex-wrap: wrap; gap: 8px; }
.wa-type input { position: absolute; opacity: 0; pointer-events: none; }
.wa-type:has(input:checked) { background: var(--brand-grad); border-color: transparent; color: #fff; }
.wa-type:has(input:focus-visible) { outline: 2px solid var(--brand-bright); outline-offset: 2px; }
.wa-fields { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.wa-fields .tf[hidden] { display: none; }
@media (max-width: 520px) { .wa-fields { grid-template-columns: 1fr; } }

.tf-date { color-scheme: dark; }

.wa-preview {
    display: block; width: 100%; min-height: 170px; margin: 12px 0 14px; padding: 14px 16px;
    background: #005C4B; color: #fff; border: 0; border-radius: 10px 10px 10px 2px;
    font: inherit; font-size: 15px; line-height: 1.5; resize: vertical;
}
.wa-preview:focus { outline: 2px solid var(--brand-bright); outline-offset: 2px; }
.wa-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* .btn never wraps on the home page; here the long labels must, or they push the card past a phone screen. */
.wa-actions .btn { white-space: normal; text-align: center; }
.wa-privacy { margin-top: 14px; }

.rm-share { margin-top: 28px; background: var(--surf); border: 1px solid var(--hair); border-radius: var(--r); padding: 22px 20px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rm-fields { display: grid; gap: 14px; }
@media (min-width: 700px) { .rm-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rm-share .wa-preview { margin: 0; }

/* ---------- print ---------- */
@media print {
    /* A list item left blank does not print as an empty bullet. */
    .sheet:not(.handfill) .wl li:has(input:placeholder-shown) { display: none; }

    /* "Para preencher à mão": lines and field names stay on paper. */
    .sheet.handfill .sh-in { border-bottom-color: #8A94A6 !important; }
    .sheet.handfill .sh-in::placeholder { color: #8A94A6 !important; }
    .sheet.handfill .sh-area { border-color: #8A94A6 !important; min-height: 64px; }
    .sheet.handfill .ck-table td .sh-in { border-bottom: 0 !important; }

    /* Two columns of items on the page. A4 minus the margins is narrower than 720px, so the phone layout above
       can apply on paper: these rules put the observation back on the item's line and drop the touch heights. */
    .ck-cols { grid-template-columns: 1fr 1fr; }
    .ck-table th, .ck-table td { min-height: 0 !important; padding: 0 3px; }
    .ck-table th { font-size: 8.5px; letter-spacing: 0; }
    .ck-table .ck-c { width: 30px; }
    .ck-table .sh-in { min-height: 24px; padding: 2px 4px; }
    .ck { width: 16px; height: 16px; }
    .ck:checked { background-size: 12px; }
    .sh-legal { break-inside: avoid; }
    .sh-sign { break-inside: avoid; }
}
@media print and (max-width: 719px) {
    .ck-table tr { grid-template-columns: minmax(0, 1fr) 30px 30px 30px minmax(0, .7fr); }
    .ck-table td.ck-obs { grid-column: auto; }
    .ck-table thead .ck-obs { display: flex; align-items: center; }
}
