/* Benchquote signing page. Same look as the app: black on off-white, big type,
   rounded cards, pill buttons at least 56 points tall. Readable in sunlight. */

:root {
  --ink: #000000;
  --bg: #eef0f2;
  --card: #f8f9fa;
  --muted: #3d3d3d;
  --line: #5b6470;
  --divider: #c9ced4;
  --success: #0b6b36;
  --success-bg: #d9f4e3;
  --warn: #a3260f;
  --warn-bg: #fbe5e1;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.45;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) 16px 8px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 28px;
  font-weight: 800;
}

h2 {
  font-size: 22px;
  font-weight: 800;
}

p {
  margin: 0;
}

.loading {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.business {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.business img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 1.5px solid var(--divider);
  background: #fff;
}

.business .name {
  font-size: 22px;
  font-weight: 800;
}

.business .contact {
  color: var(--muted);
  font-size: 16px;
  word-break: break-word;
}

.label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.total {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 4px 0 6px;
}

.meta {
  color: var(--muted);
}

.job {
  margin-top: 14px;
  font-size: 20px;
}

.lines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lines li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--divider);
}

.lines li:last-child {
  border-bottom: 0;
}

.lines .item {
  font-weight: 700;
}

.lines .detail {
  color: var(--muted);
  font-size: 16px;
}

.lines .amount {
  font-weight: 700;
  white-space: nowrap;
}

.sums {
  margin-top: 6px;
  border-top: 1.5px solid var(--line);
  padding-top: 10px;
}

.sums div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.sums .grand {
  font-size: 22px;
  font-weight: 800;
  padding-top: 8px;
}

.terms {
  margin-top: 14px;
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 16px;
}

.button {
  display: block;
  width: 100%;
  min-height: 60px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  padding: 14px 20px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.button:disabled {
  background: #8d939a;
  border-color: #8d939a;
  cursor: not-allowed;
}

.button.secondary {
  background: var(--card);
  color: var(--ink);
}

.button + .button {
  margin-top: 12px;
}

.actions {
  margin-bottom: 16px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
}

input[type="text"] {
  width: 100%;
  min-height: 56px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-size: 20px;
  padding: 12px 16px;
  color: var(--ink);
}

.pad-wrap {
  position: relative;
}

canvas.pad {
  display: block;
  width: 100%;
  height: 200px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  touch-action: none;
}

.pad-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  text-align: center;
  color: #8d939a;
  pointer-events: none;
}

.pad-line {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 48px;
  border-bottom: 1.5px dashed #b7bcc2;
  pointer-events: none;
}

.clear {
  margin-top: 8px;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  color: var(--ink);
  padding: 8px 0;
  cursor: pointer;
}

.agree {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
  cursor: pointer;
}

.agree input {
  width: 28px;
  height: 28px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--ink);
}

.notice {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  font-weight: 700;
}

.notice.success {
  background: var(--success-bg);
  color: var(--success);
}

.notice.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.signed-block img {
  display: block;
  max-width: 100%;
  height: 120px;
  object-fit: contain;
  margin: 8px 0;
}

.footer {
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 28px);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.hidden {
  display: none !important;
}

/* "Save a copy" prints the page: just the quote and the signature. */
@media print {
  body {
    background: #fff;
    font-size: 12pt;
  }
  .button,
  .clear,
  .no-print {
    display: none !important;
  }
  .card {
    border: 1px solid #999;
    break-inside: avoid;
  }
}
