:root {
  --navy: #17365d;
  --navy-dark: #102944;
  --blue-light: #eef4fa;
  --border: #d8e0e8;
  --text: #24313f;
  --muted: #657382;
  --background: #f5f7f9;
  --white: #ffffff;
  --error: #a43636;
  --warning-bg: #fff8e5;
  --warning-border: #e4c977;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family:
    Arial,
    Helvetica,
    sans-serif;
  line-height: 1.5;
}

.site-header {
  background: var(--navy);
  color: var(--white);
}

.site-header-inner {
  width: min(1040px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand {
  font-size: 23px;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 3px;
  font-size: 14px;
  opacity: .85;
}

.page-shell {
  width: min(960px, calc(100% - 32px));
  margin: 34px auto 60px;
}

.page-heading {
  margin-bottom: 22px;
}

.page-heading h1,
.status-card h1 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.2;
}

.page-heading p,
.status-card p {
  margin: 0;
  color: var(--muted);
}

.status-card,
.summary-card,
.signer-card,
.agreement-card,
.signature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.status-card {
  padding: 28px;
}

.error-card {
  border-top: 5px solid var(--error);
}

.error-card h1,
.error-card p {
  color: var(--error);
}

.summary-card {
  margin-bottom: 20px;
  padding: 20px;
}

.summary-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
}

.summary-label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.summary-value {
  font-size: 15px;
  font-weight: 600;
}

.signer-card {
  margin-bottom: 20px;
  padding: 20px;
  border-left: 5px solid var(--navy);
}

.signer-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.signer-name {
  margin-top: 4px;
  color: var(--navy);
  font-size: 21px;
  font-weight: 700;
}

.signer-role {
  margin-top: 2px;
  font-size: 15px;
}

.signer-expiration {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.agreement-card {
  margin-bottom: 20px;
  overflow: hidden;
}

.agreement-card-heading {
  padding: 18px 22px;
  background: var(--blue-light);
  border-bottom: 1px solid var(--border);
}

.agreement-card-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: 19px;
}

.agreement-card-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.agreement-document {
  padding: 28px 30px 34px;
  background: var(--white);
  font-family:
    Arial,
    Helvetica,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.doc-paragraph {
  margin: 0 0 12px;
}

h1.doc-paragraph {
  font-size: 24px;
}

h2.doc-paragraph {
  font-size: 20px;
}

h3.doc-paragraph {
  font-size: 17px;
}

h4.doc-paragraph {
  font-size: 15px;
}

.doc-empty {
  min-height: 8px;
  margin: 0;
}

.doc-align-center {
  text-align: center;
}

.doc-align-right {
  text-align: right;
}

.doc-align-justify {
  text-align: justify;
}

.doc-list {
  margin: 8px 0 16px 24px;
  padding: 0;
}

.doc-list li {
  margin-bottom: 7px;
}

.doc-rule {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.doc-page-break {
  margin: 20px 0;
  border-top: 1px dashed #aeb9c4;
}

.doc-inline-image {
  max-width: 100%;
  height: auto;
}

.doc-table-wrapper {
  width: 100%;
  margin: 18px 0;
  overflow-x: auto;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.doc-table td {
  padding: 10px 9px;
  border: 1px solid #cbd4dc;
  vertical-align: top;
}

.doc-signature-row td {
  background: #fafbfc;
}

.doc-current-signer-row td {
  background: #eef5fb;
  border-top: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
}

.doc-cell-primary {
  overflow-wrap: anywhere;
}

.doc-cell-label {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.doc-signature-required {
  color: var(--navy);
  font-weight: 700;
}

.doc-pending {
  color: var(--muted);
  font-style: italic;
}

.signature-card {
  padding: 22px;
}

.signature-card h2 {
  margin: 0 0 16px;
  color: var(--navy);
  font-size: 20px;
}

.validation-notice {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 6px;
  font-size: 13px;
}

.consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 18px;
  font-size: 14px;
}

.consent-row input {
  margin-top: 4px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
}

.signature-input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #bcc8d3;
  border-radius: 5px;
  background: #f2f4f6;
  font: inherit;
}

.action-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.button-primary,
.button-secondary {
  min-height: 46px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 700;
}

.button-primary {
  border: 0;
  background: #9ca8b4;
  color: var(--white);
}

.button-secondary {
  border: 1px solid #bcc8d3;
  background: #f1f3f5;
  color: #7b8792;
}

[hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  .summary-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .page-heading h1,
  .status-card h1 {
    font-size: 25px;
  }

  .agreement-document {
    padding: 20px 16px 26px;
  }

  .doc-table {
    min-width: 620px;
  }
}

/* ============================================================
 * SIGNING PORTAL POLISH
 * ============================================================
 */

.site-header .brand {
  display: block;
  visibility: visible;
  color: #ffffff;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.25;
}

.site-header .brand-subtitle {
  display: block;
  color: #ffffff;
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.35;
  opacity: .85;
}

/*
 * Prevent global form styles from stretching
 * the consent checkbox across the full row.
 */
.consent-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
}

.consent-row input[type="checkbox"] {
  width: auto !important;
  min-width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 3px 0 0;
  padding: 0;
  flex: 0 0 16px;
}

.consent-row span {
  display: block;
  flex: 1 1 auto;
  margin: 0;
  text-align: left;
  font-weight: 400;
}

/*
 * Give the contract a cleaner document appearance.
 */
.agreement-document {
  line-height: 1.55;
}

.agreement-document .doc-table {
  font-size: 13px;
}

.agreement-document .doc-current-signer-row td {
  background: #eef5fb;
}

/*
 * Trailing Google Doc blank paragraphs are removed
 * by portal.js. This keeps ordinary intentional
 * spacing elsewhere in the agreement intact.
 */

/* ============================================================
 * LIVE SIGNING CONTROLS
 * ============================================================
 */

.signature-input {
  background: #ffffff;
}

.signature-input:focus,
.decline-panel textarea:focus {
  outline: 2px solid rgba(23, 54, 93, .18);
  border-color: var(--navy);
}

.signature-help {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.button-primary:not(:disabled) {
  background: var(--navy);
  cursor: pointer;
}

.button-primary:not(:disabled):hover {
  background: var(--navy-dark);
}

.button-secondary:not(:disabled) {
  background: #ffffff;
  color: var(--navy);
  cursor: pointer;
}

.action-message {
  margin-bottom: 18px;
  padding: 13px 15px;
  border-radius: 6px;
  background: #eef4fa;
  border: 1px solid #c8d8e8;
  font-size: 13px;
}

.action-message.error {
  color: #8c2929;
  background: #fff0f0;
  border-color: #dfb2b2;
}

.decline-panel {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #dfb2b2;
  border-radius: 7px;
  background: #fffafa;
}

.decline-panel h3 {
  margin: 0 0 5px;
  color: #8c2929;
}

.decline-panel p {
  margin: 0 0 15px;
  font-size: 13px;
}

.decline-panel textarea {
  width: 100%;
  padding: 10px 11px;
  resize: vertical;
  border: 1px solid #bcc8d3;
  border-radius: 5px;
  font: inherit;
}

.decline-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.button-danger {
  min-height: 44px;
  border: 0;
  border-radius: 5px;
  background: #9c3030;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 700px) {
  .decline-actions {
    grid-template-columns: 1fr;
  }
}
