/* NDIS Support Fit + Quote tool — screen + A4 print. The Nest palette. */

.ndisq {
  --purple: #6B4C9A;
  --purple-deep: #4a2f73;
  --purple-pale: #d4c3ec;
  --purple-mist: #ede6f7;
  --amber: #c9a65f;
  --green: #2e7d5a;
  --red: #b8444e;
  --text: #1c1128;
  --text-mid: #4a3a5e;
  --text-light: #8a7a9e;
  --border: rgba(107, 76, 154, 0.18);
  --warn: #b87a00;
  --warn-bg: #fff8e6;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.6;
}

.ndisq * { box-sizing: border-box; }

.ndisq h2 { font-size: 1.35rem; color: var(--purple-deep); margin: 0 0 8px; }
.ndisq h3 { font-size: 1.05rem; color: var(--purple); margin: 18px 0 8px; }
.ndisq h4 { font-size: 0.95rem; color: var(--purple-deep); margin: 14px 0 6px; }
.ndisq p { margin: 0 0 10px; }
.ndisq .muted { color: var(--text-light); font-size: 0.85rem; }

.ndisq .card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}

.ndisq label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-mid); margin: 10px 0 4px; }
.ndisq input, .ndisq select, .ndisq textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; color: var(--text); background: #fff;
}
.ndisq textarea { min-height: 64px; resize: vertical; }
.ndisq .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .ndisq .grid2 { grid-template-columns: 1fr; } }

.ndisq .btn {
  display: inline-block; cursor: pointer; border: none; border-radius: 8px;
  padding: 11px 18px; font: inherit; font-weight: 600; margin: 6px 8px 6px 0;
  background: var(--purple); color: #fff;
}
.ndisq .btn.secondary { background: var(--purple-mist); color: var(--purple-deep); }
.ndisq .btn.ghost { background: #fff; color: var(--purple); border: 1px solid var(--border); }
.ndisq .btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ndisq .pill {
  display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; background: var(--purple-mist); color: var(--purple-deep); margin-right: 6px;
}
.ndisq .notice { background: var(--warn-bg); border: 1px solid #f0d98a; color: #6b5200; border-radius: 8px; padding: 12px 14px; margin: 12px 0; font-size: 0.9rem; }
.ndisq .priced { color: var(--green); font-weight: 700; }
.ndisq .manual { color: var(--warn); font-weight: 700; }

.ndisq table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 0.9rem; }
.ndisq th, .ndisq td { text-align: left; padding: 8px 10px; border: 1px solid var(--border); vertical-align: top; }
.ndisq thead th { background: var(--purple-mist); color: var(--purple-deep); }

.ndisq .quote-doc { background: #fff; }
.ndisq .doc-header { text-align: center; background: var(--purple-deep); color: #fff; padding: 18px 16px 16px; border-radius: 10px 10px 0 0; margin-bottom: 16px; }
.ndisq .doc-header .doc-logo { height: 56px; width: auto; margin-bottom: 8px; }
.ndisq .doc-header .brand { font-size: 1.3rem; font-weight: 800; color: #fff; letter-spacing: 0.01em; }
.ndisq .doc-header .tagline { font-style: italic; color: rgba(255,255,255,0.85); font-size: 0.85rem; }
.ndisq .doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 0.85rem; margin-bottom: 12px; }
.ndisq .doc-foot { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 10px; font-size: 0.78rem; color: var(--text-light); }

/* ── Print: A4, light table headers, dark text, no page-broken rows ── */
@media print {
  body * { visibility: hidden; }
  #ndisq-print, #ndisq-print * { visibility: visible; }
  /* Padding here keeps content off the page edge even when the browser's print
     margin is set to "None" (otherwise the left edge clips). */
  #ndisq-print { position: absolute; left: 0; top: 0; width: 100%; padding: 0 8mm; }
  .ndisq-noprint { display: none !important; }

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

  .ndisq .quote-doc { color: #000; font-size: 11pt; }
  /* Keep the branded purple header in print (logo bar). */
  .ndisq .doc-header { background: var(--purple-deep) !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ndisq .doc-header .brand, .ndisq .doc-header .tagline { color: #fff !important; }
  .ndisq h2, .ndisq h3, .ndisq h4 { color: #000; }
  .ndisq table { font-size: 10pt; }
  .ndisq thead { display: table-header-group; }
  .ndisq tr { break-inside: avoid; page-break-inside: avoid; }
  .ndisq thead th { background: #ede6f7 !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ndisq th, .ndisq td { border: 1px solid #999; }
  .ndisq .card { border: none; padding: 0; margin: 0 0 10px; }
  /* Let sections flow across page boundaries — avoids the big blank gap when a whole
     section will not fit the remaining space and jumps to the next page. Table rows stay
     intact (above), and a heading stays attached to the content that follows it. */
  .ndisq .section { break-inside: auto; page-break-inside: auto; }
  .ndisq h3, .ndisq h4 { break-after: avoid; page-break-after: avoid; }
  .ndisq .doc-header { break-after: avoid; page-break-after: avoid; }
}
