/* =====================================================================
 *  member-agreements.css — the Agreement pane inside the member login
 *  module (member.html).
 *
 *  Serves public/js/member-agreements.js.  Kept in its own file so the
 *  portal's stylesheet and these two forms never edit each other.
 *  Palette follows the site: navy ink, gold accent, quiet borders.
 *
 *  The bottom of this file is the PRINT contract: while the printed
 *  document is on screen, `body.agr-printing` hides everything on the
 *  page except it — so the browser's "Save as PDF" produces the
 *  agreement and nothing else, without ever opening a second window.
 * ===================================================================== */

/* ---- pane heading bits ---- */
.mp-pane-h .agr-h-bn {
  font-size: 15px;
  font-weight: 600;
  color: #8a93a5;
  margin-left: 6px;
}
.mp-pane-lead .agr-bn {
  display: block;
  color: #6b7280;
  font-size: 13.4px;
  margin-top: 4px;
}

/* ---- the note line: success, refusal, "log in again" ---- */
.agr-note {
  border: 1px solid #e3e7ee;
  background: #f7f9fc;
  border-radius: 8px;
  padding: 11px 13px;
  margin: 0 0 14px;
  font-size: 13.6px;
  color: #3d4657;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  line-height: 1.5;
}
.agr-note.ok { border-color: #bfe3cd; background: #e9f7ef; color: #14663a; }
.agr-note.bad { border-color: #f3c6c6; background: #fdeeee; color: #8f1d1d; }
.agr-note .btn { font-size: 13px; padding: 6px 14px; }

/* ---- who is signing: read from the registry, never typed ---- */
.agr-signer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  border: 1px solid #e3e7ee;
  border-left: 4px solid #b26b00;
  background: #fffdf6;
  border-radius: 8px;
  padding: 10px 13px;
  margin: 0 0 14px;
  font-size: 14px;
}
.agr-signer-l {
  font-size: 11.6px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a5a00;
}
.agr-signer-l i { font-style: normal; text-transform: none; letter-spacing: 0; color: #b08a3c; }
.agr-signer b { color: #0b1f3b; }
.agr-signer-id { font-size: 13px; color: #6b7280; }

/* ---- the two tabs ---- */
.agr-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 4px;
}
.agr-tab {
  flex: 1 1 240px;
  text-align: left;
  cursor: pointer;
  border: 1px solid #dfe4ec;
  background: #fff;
  border-radius: 10px;
  padding: 10px 13px;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.agr-tab b { display: block; font-size: 14.2px; color: #142850; }
.agr-tab span { display: block; font-size: 12.8px; color: #8a93a5; margin-top: 1px; }
.agr-tab:hover { border-color: #b9c3d3; }
.agr-tab.on {
  border-color: #c1440e;
  background: #fff7f2;
  box-shadow: inset 0 0 0 1px #c1440e;
}
.agr-tab.on b { color: #c1440e; }
.agr-tab.on span { color: #b0714f; }

/* ---- a form ---- */
.agr-form {
  border: 1px solid #e3e7ee;
  border-radius: 12px;
  background: #fbfcfe;
  padding: 16px 16px 14px;
  margin-top: 14px;
}
.agr-form-h h3 { margin: 0; font-size: 16.5px; color: #0b1f3b; }
.agr-form-h h3 span { display: block; font-size: 14.5px; font-weight: 600; color: #142850; margin-top: 1px; }
.agr-form-h p { margin: 7px 0 0; font-size: 13.4px; color: #6b7280; line-height: 1.6; }

.agr-fs {
  border: 1px solid #e6eaf1;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px 6px;
  margin: 15px 0 0;
  min-width: 0;
}
.agr-fs legend {
  font-size: 12.2px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #142850;
  padding: 0 7px;
}
.agr-fs legend span {
  text-transform: none;
  letter-spacing: 0;
  color: #8a93a5;
  font-weight: 600;
  margin-left: 4px;
}

.agr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 10px 13px;
}
.agr-f { min-width: 0; }
.agr-wide { grid-column: 1 / -1; }

.agr-f label,
.agr-radios-l {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #0d1c3a;
  margin-bottom: 5px;
}
.agr-f label i,
.agr-radios-l i {
  font-style: normal;
  color: #8a93a5;
  font-weight: 600;
  font-size: 12px;
  margin-left: 3px;
}
.agr-f label em { color: #b3261e; font-style: normal; }

.agr-form input[type="text"],
.agr-form input[type="tel"],
.agr-form input[type="email"],
.agr-form input[type="date"],
.agr-form select,
.agr-form textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 14px;
  color: #0d1c3a;
  background: #fff;
  border: 1px solid #d9dfeb;
  border-radius: 7px;
  padding: 9px 11px;
}
.agr-form textarea { resize: vertical; line-height: 1.55; }
.agr-form input:focus,
.agr-form select:focus,
.agr-form textarea:focus {
  outline: none;
  border-color: #0d1c3a;
  box-shadow: 0 0 0 3px rgba(13, 28, 58, .1);
}
.agr-form input[required],
.agr-form textarea[required] { background: #fffdf7; }

/* the deliverable checkboxes, two honest columns */
.agr-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 7px 13px;
}
.agr-checks label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.4px;
  color: #3d4657;
  font-weight: 500;
  margin: 0;
}
.agr-checks label i { font-style: normal; color: #98a1b2; font-size: 12.2px; }
.agr-checks input { accent-color: #142850; width: 15px; height: 15px; }

.agr-radios { margin-top: 12px; }
.agr-radios label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.3px;
  color: #3d4657;
  font-weight: 500;
  margin: 0 16px 4px 0;
}
.agr-radios label i { font-style: normal; color: #98a1b2; font-size: 12.2px; }
.agr-radios input { accent-color: #142850; }

/* ---- Terms & Conditions, as offered and as accepted ---- */
.agr-terms {
  margin-top: 16px;
  border: 1px solid #f0dcb4;
  background: #fffdf6;
  border-radius: 10px;
  padding: 12px 14px;
}
.agr-terms-h {
  font-size: 13.4px;
  font-weight: 700;
  color: #8a5a00;
  letter-spacing: .02em;
}
.agr-terms-h span { color: #b08a3c; font-weight: 600; margin-left: 6px; }
.agr-terms-list {
  max-height: 250px;
  overflow: auto;
  margin: 9px 0 10px;
  padding-left: 21px;
  font-size: 13.2px;
  line-height: 1.6;
  color: #3d4657;
}
.agr-terms-list li { margin-bottom: 10px; }
.agr-terms-list p { margin: 0; }
.agr-terms-list p.bn { color: #6b7280; font-size: 12.8px; margin-top: 2px; }

.agr-check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 13.6px;
  color: #0d1c3a;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
}
.agr-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: #c1440e; flex: none; }
.agr-check span { font-weight: 600; }
.agr-check i { display: block; font-style: normal; font-weight: 500; color: #8a93a5; font-size: 12.6px; }

/* ---- buttons ---- */
.agr-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
}
.agr-actions .btn { min-width: 160px; }
.agr-editing {
  font-size: 12.8px;
  color: #8a5a00;
  background: #fdf7ea;
  border: 1px solid #f0dcb4;
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 600;
}

/* ---- saved records ---- */
.agr-saved { margin-top: 22px; }
.agr-sh {
  margin: 0 0 9px;
  font-size: 14.5px;
  font-weight: 700;
  color: #142850;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.agr-sh span {
  text-transform: none;
  letter-spacing: 0;
  color: #8a93a5;
  font-weight: 600;
}
.agr-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 9px;
  background: #b26b00;
  color: #fff !important;
  font-size: 11.5px;
  text-align: center;
}
.agr-count:empty { display: none; }

.agr-list { display: grid; gap: 8px; }
.agr-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid #e8ebf1;
  border-radius: 9px;
  background: #fff;
  padding: 10px 12px;
}
.agr-row-main { min-width: 0; flex: 1 1 260px; }
.agr-row-t { font-size: 14px; font-weight: 700; color: #142850; }
.agr-row-t .no { color: #b26b00; }
.agr-row-m {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  align-items: center;
  margin-top: 4px;
  font-size: 12.3px;
  color: #6b7280;
}
.agr-row-acts { display: flex; gap: 6px; flex-wrap: wrap; }

.agr-tag {
  display: inline-block;
  padding: 1.5px 8px;
  border-radius: 999px;
  font-size: 11.3px;
  font-weight: 700;
  border: 1px solid transparent;
}
.agr-tag.ok   { background: #e7f5ec; color: #14663a; border-color: #bfe3cd; }
.agr-tag.warn { background: #fdf3e0; color: #8a5a00; border-color: #f0dcb4; }
.agr-tag.bad  { background: #fdeaea; color: #8f1d1d; border-color: #f3c6c6; }
.agr-tag.mute { background: #eef1f6; color: #4b5563; border-color: #dde2ea; }

.agr-mini {
  font-family: inherit;
  font-size: 12.6px;
  font-weight: 600;
  padding: 5px 11px;
  border: 1px solid #cbd4e2;
  background: #fff;
  color: #142850;
  border-radius: 6px;
  cursor: pointer;
}
.agr-mini:hover { background: #f4f7fb; }
.agr-mini.pr { background: #0b1f3b; color: #fff; border-color: #0b1f3b; }
.agr-mini.pr:hover { background: #142850; }
.agr-mini.drive { border-color: #f0dcb4; background: #fffdf6; color: #8a5a00; }
.agr-mini[disabled] { opacity: .55; cursor: default; }

/* ===================================================================== *
 *  THE PRINTED DOCUMENT — opened over this same page, never in a
 *  window of its own.
 * ===================================================================== */

.agr-print {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(15, 30, 60, .55);
  overflow: auto;
  padding: 16px 12px 44px;
}
.agr-print-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  max-width: 860px;
  margin: 0 auto 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: #0b1f3b;
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
}
.agr-print-bar strong { font-size: 14px; font-weight: 700; }
.agr-print-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.agr-print-bar .btn { font-size: 13px; padding: 7px 14px; }
.agr-print-bar .btn-ghost { color: #dfe7f4; border-color: #4a5c7d; }
.agr-print-bar .btn-ghost:hover { background: #1c3460; color: #fff; }

/* ID beats class on purpose: the document carries its own `.agr-doc`
   rules (written for Drive's PDF too), and this is the card chrome it
   sits in while it is on screen. */
#agrPrintDoc {
  max-width: 860px;
  margin: 0 auto;
  background: #fff;
  padding: 24px 26px;
  border-radius: 8px;
  box-shadow: 0 14px 46px rgba(0, 0, 0, .32);
}

/* ---- print: the document, and nothing around it ---- */
@media print {
  /* body.agr-printing is set only while the overlay is open, so an
     ordinary Ctrl+P on the portal is untouched */
  body.agr-printing > *:not(#agrPrintOverlay) { display: none !important; }
  body.agr-printing #agrPrintOverlay {
    position: static;
    inset: auto;
    background: #fff;
    padding: 0;
    overflow: visible;
    z-index: auto;
    display: block !important;
  }
  body.agr-printing .agr-print-bar { display: none !important; }
  body.agr-printing #agrPrintDoc {
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ---- phones ---- */
@media (max-width: 640px) {
  .agr-form { padding: 13px 12px 12px; }
  .agr-actions .btn { min-width: 120px; flex: 1 1 auto; }
  #agrPrintDoc { padding: 16px 13px; }
  .agr-print-bar { padding: 9px 11px; }
}
