/* receipt.css - the visitor's on-page receipt (owner directive 2026-11-12).
 *
 * Loaded by the estimate form (templates/form.php) and by the no-JavaScript contact
 * page (lib/contact.php -> contact_fallback_page), because both now show what was
 * submitted instead of emailing a copy of it.
 *
 * It is a separate file on purpose: the app's own pages are served under a generated CSP
 * of style-src 'self', so an inline <style> or a style="" attribute is refused, and the
 * email renderer (render_summary_html, inline styles for mail clients) cannot be reused
 * here.
 *
 * PRINTING IS THE POINT.  A visitor who wants a paper record presses Print: everything
 * else on the page is hidden and the receipt is laid out at the top of the sheet.  That
 * is done with visibility (not display:none) so the layout does not reflow, and it works
 * for the standalone no-JS page and the estimator alike. */

.rcpt {
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  padding: 14px 16px;
  margin: 18px 0;
  background: #fff;
  /* The receipt is a PAPER document: it keeps its own ink whatever the page is doing.
     Without this, a visitor in dark mode gets near-white text on the white receipt -
     and that is exactly what prints. */
  color: #1a1a1a;
  max-width: 720px;
}

.rcpt-h {
  font: 600 18px system-ui, sans-serif;
  margin: 0 0 4px;
}

.rcpt-h2 {
  font: 600 15px system-ui, sans-serif;
  margin: 16px 0 4px;
}

.rcpt-ref {
  font: 14px system-ui, sans-serif;
  color: #555;
  margin: 0 0 12px;
}

.rcpt-t {
  border-collapse: collapse;
  font: 14px system-ui, sans-serif;
  width: 100%;
  margin: 0 0 8px;
}

.rcpt-t th,
.rcpt-t td {
  text-align: left;
  vertical-align: top;
  padding: 3px 10px 3px 0;
  border-bottom: 1px solid #eee;
}

.rcpt-t th {
  color: #555;
  font-weight: 400;
  width: 34%;
}

.rcpt-t td {
  font-weight: 600;
  color: #111;
}

.rcpt-line {
  border-top: 1px solid #ddd;
  margin-bottom: 4px;
}

.rcpt-files {
  font: 14px system-ui, sans-serif;
  margin: 10px 0 0;
}

.rcpt-note {
  font: 13px system-ui, sans-serif;
  color: #555;
  margin: 14px 0 0;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.rcpt-actions {
  margin: 16px 0 0;
}

.rcpt-actions .btn,
.rcpt-actions a.btn {
  margin-right: 10px;
}

@media print {
  /* Hide the world, show the receipt.  The animation/transform reset matters: an
     ancestor mid-entrance-animation carries a transform, which makes it the containing
     block for the absolutely positioned receipt and drops it down the sheet - exactly
     what a visitor hits by pressing Print the instant the receipt appears. */
  body * { visibility: hidden; animation: none !important; transform: none !important; }
  #hsa-receipt, #hsa-receipt * { visibility: visible; }
  #hsa-receipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
    /* Keep a real margin inside the sheet: the browser supplies the paper margin,
       but a receipt flush to the box edge reads as unfinished on paper. */
    padding: 0.35in 0.3in;
    margin: 0;
    background: #fff;
    color: #000;
  }
  .noprint, .rcpt-actions, .rcpt-actions * { display: none !important; }
  a[href]:after { content: ""; }   /* no "(https://…)" after every link on paper */
}
