:root {
  color-scheme: light;

  --page-background: #ececec;
  --paper: #ffffff;
  --text: #000000;
  --muted: #5f6368;
  --border: #dadce0;
  --accent: #111827;
  --danger: #b91c1c;
  --success: #166534;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page-background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.page-shell {
  width: 100%;
  margin: 0 auto;
  padding: 24px 12px 48px;
}

.brand-card,
.sign-card,
.message-card {
  width: min(8.5in, 100%);
  margin-left: auto;
  margin-right: auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--text);
}

.brand-card {
  margin-bottom: 18px;
}

.brand-card .eyebrow {
  margin: 0 0 6px;
}

.brand-card h1 {
  margin: 0 0 6px;
  color: #000000;
  font-size: 28px;
  line-height: 1.15;
}

.brand-card p {
  margin: 0;
}

.eyebrow {
  color: #000000;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted {
  color: #000000;
}

.compact-copy {
  margin-top: 0;
  margin-bottom: 14px;
}

.paper {
  width: min(8.5in, 100%);
  margin: 0 auto 18px;
  padding: 24px;
  border: 1px solid #d8d8d8;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.12);
}

.agreement-content {
  width: 100%;
  color: #000000;
  font-size: 11pt;
  line-height: 1.25;
}

.agreement-content p,
.agreement-content span,
.agreement-content div,
.agreement-content li,
.agreement-content td,
.agreement-content th {
  color: #000000;
}

/* Normal agreement text */
.agreement-content .document-paragraph {
  margin: 0;
  padding: 0 0 3px;
  line-height: 1.25;
}

/* Agreement headings */
.agreement-content .document-heading {
  margin-top: 22px;
  margin-bottom: 6px;
  padding: 0;
  line-height: 1.15;
  font-weight: 700;
}

.agreement-content .document-title {
  margin-top: 0;
  font-size: 18pt;
}

.agreement-content .document-section-heading {
  font-size: 14pt;
}

/* Force converted Google Doc lists flush-left */
.agreement-content .document-list-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 6px !important;

  margin: 0 !important;
  margin-left: 0 !important;

  padding: 0 0 3px !important;
  padding-left: 0 !important;

  text-indent: 0 !important;
  line-height: 1.25 !important;
}

.agreement-content .document-list-bullet {
  flex: 0 0 8px !important;
  width: 8px !important;

  margin: 0 !important;
  margin-left: 0 !important;

  padding: 0 !important;

  font-size: 7pt !important;
  line-height: 1.75 !important;
  text-align: left !important;
}

.agreement-content .document-list-content {
  flex: 1 1 auto !important;
  min-width: 0 !important;

  margin: 0 !important;
  margin-left: 0 !important;

  padding: 0 !important;
  padding-left: 0 !important;

  text-indent: 0 !important;
}

.agreement-content .document-inline-image {
  display: block;
  max-width: 260px;
  height: auto;
  margin: 4px 0;
}

.sign-card {
  margin-top: 18px;
}

.sign-card h2 {
  margin: 0 0 8px;
  line-height: 1.2;
}

.signing-divider {
  height: 1px;
  margin: 28px 0;
  background: var(--border);
}

.items-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 14px 0 8px;
}

.item-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.item-option:hover {
  background: #f8f9fa;
}

.item-option input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.item-option span {
  font-size: 15px;
  line-height: 1.25;
}

.selection-count {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.selection-count.valid {
  color: var(--success);
}

.selection-count.invalid {
  color: var(--danger);
}

.field {
  display: block;
  margin: 18px 0;
}

.field > span,
.field-label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.required-marker {
  color: var(--danger);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  font-size: 17px;
}

.signature-wrapper {
  position: relative;
  width: 100%;
  min-height: 190px;
  overflow: hidden;
  border: 2px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(
      to bottom,
      transparent calc(100% - 42px),
      #e5e7eb calc(100% - 41px),
      #e5e7eb calc(100% - 40px),
      transparent calc(100% - 39px)
    ),
    #ffffff;
}

.signature-canvas {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 190px;
  cursor: crosshair;
  touch-action: none;
}

.signature-placeholder {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #000000;
  text-align: center;
  pointer-events: none;
}

.signature-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 9px;
}

.secondary-button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #111111;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.consent-instruction {
  margin: 20px 0 8px;
  color: #000000;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 2px solid #4b5563;
  border-radius: 8px;
  background: #ffffff;
  line-height: 1.45;
  cursor: pointer;
  overflow: visible;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.consent:hover {
  background: #f8fafc;
  border-color: #111827;
}

.consent.is-checked {
  border-color: #111827;
  background: #f3f4f6;
}

.consent > input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

.consent-control {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.consent-control-box {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border: 2px solid #111827;
  border-radius: 4px;
  background: #ffffff;
}

.consent-control[aria-checked="true"] .consent-control-box,
.consent-control.is-checked .consent-control-box {
  background: #111827;
}

.consent-control-box::after {
  content: "";
  display: none;
  width: 6px;
  height: 11px;
  margin-top: -2px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent-control[aria-checked="true"] .consent-control-box::after,
.consent-control.is-checked .consent-control-box::after {
  display: block;
}

.consent-control:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
  border-radius: 8px;
}

.consent #consentText {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 10px;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.status-message {
  min-height: 22px;
  margin-top: 12px;
  color: #000000;
}

.status-message.error {
  color: var(--danger);
  font-weight: 700;
}

.success-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: #dcfce7;
  color: var(--success);
  font-size: 32px;
  font-weight: 800;
}

.signing-progress {
  margin-top: 16px;
}

.signing-progress[hidden] {
  display: none;
}

.progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  transition: width 0.4s ease;
}

.progress-details {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  color: #000000;
  font-size: 13px;
}

#progressPercent {
  font-weight: 700;
  color: #000000;
}

.completed-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.completed-action-button {
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.completed-action-button:hover {
  background: #f3f4f6;
}

/* Mobile */
@media (max-width: 760px) {
  .page-shell {
    padding: 8px 6px 32px;
  }

  .paper {
    width: 100%;
    padding: 24px;
  }

  .agreement-content {
    font-size: 10.5pt;
  }

  .brand-card,
  .sign-card {
    width: 100%;
  }

  .sign-card {
    padding: 18px;
  }

  .items-checklist {
    grid-template-columns: 1fr;
  }

  .signature-wrapper,
  .signature-canvas {
    min-height: 170px;
    height: 170px;
  }

  .completed-actions {
    grid-template-columns: 1fr;
  }
}

/* Printing */
@media print {
  html,
  body {
    background: #ffffff !important;
  }

  .brand-card,
  .sign-card,
  .completed-actions,
  #pdfActionStatus {
    display: none !important;
  }

  .page-shell {
    padding: 0 !important;
  }

  .paper {
    width: 100% !important;
    margin: 0 !important;
    padding: 0.35in 0.5in !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .agreement-content .document-inline-image {
    display: block !important;
    max-width: 260px !important;
    height: auto !important;
    margin: 4px 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}