:root {
  --document-width: 8.5in;
}

body {
  background: #f5f7fb;
}

fieldset {
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 1.25rem;
}

fieldset:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

legend {
  color: #0d6efd;
  font-weight: 700;
  margin-bottom: 1rem;
}

.preview-column {
  top: 1rem;
}

.document-sheet {
  background: #fff;
  box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.12);
  color: #1f2937;
  line-height: 1.55;
  margin: 0 auto;
  max-width: var(--document-width);
  min-height: 11in;
  outline: 0;
  padding: 0.75in;
}

.document-sheet:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.2), 0 0.5rem 1.5rem rgba(15, 23, 42, 0.12);
}

.document-sheet h1 {
  color: #111827;
  font-size: 2rem;
  margin-bottom: 0.25rem;
  text-align: center;
}

.document-sheet h2 {
  border-bottom: 1px solid #d7dee8;
  color: #0d6efd;
  font-size: 1.15rem;
  margin-top: 1.75rem;
  padding-bottom: 0.25rem;
  text-transform: uppercase;
}

.document-sheet h3 {
  font-size: 1rem;
  margin-top: 1.25rem;
}

.document-sheet p,
.document-sheet li {
  font-size: 0.98rem;
}

.document-meta {
  color: #6b7280;
  text-align: center;
}

.signature-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2rem;
}

.signature-line,
.blank-line {
  border-bottom: 1px solid #111827;
  min-height: 1.8rem;
}

.blank-form-section {
  break-inside: avoid;
  margin-bottom: 1.25rem;
}

.blank-field {
  margin-bottom: 0.85rem;
}

.blank-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.print-only-title {
  display: none;
}

.pdf-export-source {
  left: -9999px;
  position: absolute;
  top: 0;
  width: var(--document-width);
  z-index: 0;
}

@media (max-width: 991.98px) {
  .preview-column {
    position: static;
  }

  .document-sheet {
    padding: 1.25rem;
  }
}

@media print {
  body {
    background: #fff;
  }

  nav,
  .alert,
  .card-header,
  #termsForm,
  .col-lg-5 {
    display: none !important;
  }

  main,
  .container,
  .row,
  .col-lg-7,
  .card,
  .card-body {
    display: block !important;
    margin: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .card,
  .document-sheet {
    border: 0 !important;
    box-shadow: none !important;
  }

  .document-sheet {
    min-height: auto;
    padding: 0.35in;
  }

  .print-only-title {
    display: block;
  }
}
