/* Shared chassis for the fillable agent forms (blue-tape.html, selections.html).
   Lifted from public/contract.html, which shipped first and still inlines its own copy —
   the contract is a legal document and was left untouched rather than refactored onto
   this file. If a rule here changes and the contract should match, change it there too. */

:root {
  --navy: #173a63;
  --gold: #b59a40;
  --ink: #1d2834;
  --muted: #657180;
  --line: #d8e0e8;
  --soft: #f4f7fa;
  --blue-soft: #eef6fc;
  --gold-soft: #f7f2df;
  --field: #fdf6dd;
  --field-line: #c9ab4e;
  --field-focus: #fff3bf;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #e9edf1;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* ---------- Screen-only toolbar ---------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 4px 18px rgba(23, 58, 99, 0.28);
}

.toolbar a.back {
  color: #cfe0f2;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.toolbar a.back:hover { color: #fff; }

.spacer { margin-left: auto; }

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #cfe0f2;
}

.progress-bar {
  width: 120px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--gold);
  transition: width 220ms ease;
}

.saved-note {
  font-size: 0.76rem;
  font-weight: 700;
  color: #a9c6e4;
}

.btn {
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.btn.ghost:hover { background: rgba(255, 255, 255, 0.24); }

.btn.primary {
  background: var(--gold);
  color: #23201a;
}

.btn.primary:hover { background: #c8ab48; }

.toolbar .hint {
  flex: 1 0 100%;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #b9d2ea;
}

.toolbar .hint b { color: var(--gold); }

/* ---------- Document sheet ---------- */
.sheet {
  width: 8.5in;
  max-width: calc(100% - 24px);
  margin: 22px auto 60px;
  padding: 0.55in 0.6in 0.5in;
  background: #fff;
  box-shadow: 0 18px 50px rgba(23, 58, 99, 0.22);
}

/* Navy band so the white brand lockup reads on white paper. */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 13px 17px;
  background: var(--navy);
  border-radius: 5px;
}

.wm-logo {
  display: block;
  height: 112px;
  width: auto;
}

.doc-title {
  text-align: right;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}

.doc-sub {
  margin-top: 4px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: right;
}

.sheet p, .sheet li {
  font-size: 11.4px;
  line-height: 1.62;
  margin: 0 0 9px;
}

h2.part {
  margin: 22px 0 10px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--gold);
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h3.sub {
  margin: 15px 0 6px;
  color: var(--navy);
  font-size: 10.6px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.note {
  margin: 9px 0;
  padding: 9px 12px;
  background: var(--soft);
  border-left: 3px solid var(--navy);
  font-size: 10.8px;
  line-height: 1.55;
}

.note.gold {
  background: var(--gold-soft);
  border-left-color: var(--gold);
  font-weight: 700;
}

/* ---------- Fillable fields ---------- */
input.f, textarea.f {
  font: inherit;
  font-size: 11.2px;
  font-weight: 700;
  color: var(--navy);
  background: var(--field);
  border: 0;
  border-bottom: 1.4px solid var(--field-line);
  border-radius: 3px 3px 0 0;
  padding: 2px 6px;
  margin: 0 2px;
  min-width: 90px;
  transition: background 140ms ease;
}

input.f:focus, textarea.f:focus {
  outline: 0;
  background: var(--field-focus);
  box-shadow: 0 0 0 2px rgba(181, 154, 64, 0.45);
}

input.f.w-sm { width: 78px; }
input.f.w-md { width: 150px; }
input.f.w-lg { width: 250px; }
input.f.w-xl { width: 100%; margin: 3px 0 0; }

textarea.f {
  width: 100%;
  display: block;
  margin: 4px 0 0;
  resize: vertical;
  min-height: 40px;
  line-height: 1.5;
}

/* Required + empty gets a stronger cue, like a DocuSign tag. */
input.f[data-req]:placeholder-shown,
textarea.f[data-req]:placeholder-shown {
  background: #fdecc8;
  border-bottom-color: #c98a1e;
}

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

.fieldrow.one { grid-template-columns: 1fr; }
.fieldrow.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.fld label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 8.6px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.fld input.f { width: 100%; margin: 0; }

/* ---------- Checkboxes and radios ---------- */
.ck {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  margin: 3px 14px 3px 0;
  font-size: 11.4px;
  line-height: 1.55;
  cursor: pointer;
}

.ck.block { display: flex; margin: 5px 0; }

.ck input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin: 3px 0 0;
  border: 1.5px solid var(--navy);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}

.ck input[type="radio"] { border-radius: 50%; }

.ck input:checked {
  background: var(--navy);
  box-shadow: inset 0 0 0 2px #fff;
}

.ck input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

/* ---------- Walkthrough checklist ---------- */
.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 22px;
  margin: 4px 0 12px;
}

/* ---------- Selection tables ---------- */
table.grid {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 14px;
  font-size: 11px;
}

table.grid th {
  padding: 5px 8px;
  background: var(--navy);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
}

table.grid td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.grid tr:last-child td { border-bottom: 0; }
table.grid td.item { font-weight: 700; color: var(--navy); width: 34%; }
table.grid td.price { width: 88px; text-align: right; font-weight: 800; white-space: nowrap; }
table.grid td.pick { width: 54px; text-align: center; }
table.grid td.pick .ck { margin: 0; }
table.grid .opts { display: flex; flex-wrap: wrap; gap: 2px 12px; }
table.grid input.f { width: 100%; min-width: 0; }

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 6px;
  padding: 11px 14px;
  background: var(--navy);
  border-radius: 5px;
  color: #fff;
}

.total-row .label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.total-row .amount {
  font-size: 19px;
  font-weight: 900;
  color: var(--gold);
}

/* ---------- Signatures ---------- */
.sig-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 12px 0 4px;
}

.sig-block {
  padding: 10px 12px 8px;
  background: var(--soft);
  border-radius: 5px;
}

input.sig {
  font-family: "Snell Roundhand", "Apple Chancery", "Segoe Script", cursive;
  font-size: 17px;
  width: 100%;
  padding: 3px 4px;
  color: var(--navy);
  background: var(--field);
  border: 0;
  border-bottom: 1.4px solid var(--field-line);
}

input.sig:focus {
  outline: 0;
  background: var(--field-focus);
}

.sig-block label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8.6px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.foot {
  margin-top: 20px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .sheet { padding: 22px 16px 30px; }
  .fieldrow, .fieldrow.three, .sig-grid, .checklist { grid-template-columns: 1fr; }
  .toolbar { gap: 8px; padding: 10px 12px; }
  .progress-bar { width: 84px; }
  .btn { padding: 8px 12px; font-size: 0.78rem; }
  table.grid { font-size: 10px; }
  table.grid td.item { width: auto; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; }
  .toolbar, .no-print { display: none !important; }

  .sheet {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.35in 0.45in;
    box-shadow: none;
  }

  /* Fields print as plain ruled lines — no highlight fill. */
  input.f, textarea.f, input.sig {
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: 1px solid #333 !important;
    color: #000 !important;
  }

  .note, .sig-block { background: #fff !important; }
  .note, .sig-block, table.grid tr, .total-row { break-inside: avoid; }
  h2.part, h3.sub { break-after: avoid; }
  .page-break { break-before: page; }
  @page { size: letter; margin: 0.4in; }
}
