/* ------------------------------------------------------------------ *
 * Liability exposure snapshot worksheet.
 *
 * Sits on top of forms.css and reuses its controls, so the worksheet
 * looks like every other form on the site. What is added here is the
 * grid the money fields sit in, the computed-field treatment, and the
 * total at the end.
 * ------------------------------------------------------------------ */

.tw-worksheet { max-width: 900px; }

.tw-ws-section {
  padding: 0 0 6px;
  margin: 0 0 30px;
  border-bottom: 1px solid #E4E8EE;
}
.tw-ws-section:last-of-type { border-bottom: 0; }

.tw-ws-h {
  font: 600 17px/1.3 Montserrat, Arial, sans-serif !important;
  color: #232B33 !important;
  margin: 0 0 4px !important;
  /* the theme title-cases every heading, which turns "Income and future
     wages" into "Income And Future Wages" */
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.tw-ws-note {
  font: 400 14px/1.55 Inter, Arial, sans-serif !important;
  color: #5C6C7D !important;
  margin: 0 0 18px !important;
  max-width: 62ch;
}

/* the caveat carries legal weight, so it is set apart rather than
   tucked under the field as a hint */
.tw-ws-caveat {
  font: 400 13px/1.6 Inter, Arial, sans-serif !important;
  color: #5C6C7D !important;
  background: #F6F7F9;
  border-left: 3px solid #E39A62;
  border-radius: 0 6px 6px 0;
  padding: 13px 16px !important;
  margin: 16px 0 6px !important;
  max-width: 70ch;
}

/* ---------------------------------------------------------- the grids */
.tw-ws-grid { display: grid; gap: 14px 18px; align-items: end; }
.tw-ws-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tw-ws-grid-re { grid-template-columns: minmax(120px, .8fr) repeat(3, minmax(0, 1fr)); }
.tw-ws-grid-inc { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Column headings belong to the grid, not to each field, so the fields
   inside repeat their label for screen readers and hide it visually. */
.tw-ws-col {
  font: 600 12.5px/1.4 Inter, Arial, sans-serif;
  text-transform: none;
  color: #5C6C7D;
  padding: 0 0 2px;
}
.tw-ws-grid-re .tw-ws-rowlabel,
.tw-ws-grid-inc .tw-ws-col:first-child {
  font: 500 14.5px/1.4 Inter, Arial, sans-serif;
  color: #232B33;
  align-self: center;
  padding: 0 0 11px;
}
.tw-ws-grid-re .tw-field label,
.tw-ws-grid-inc .tw-field label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------- the money field */
.tw-ws-input { position: relative; }
.tw-ws-input > span {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font: 400 15px/1 Inter, Arial, sans-serif;
  color: #9AA4B2;
  pointer-events: none;
}
.tw-ws-money input { padding-left: 26px !important; text-align: right; }

/* computed fields are not typed into, and should not look as though they
   invite it */
.tw-ws-calc input {
  background: #F4F6F8 !important;
  color: #232B33 !important;
  font-weight: 600 !important;
  border-color: #DDE2E9 !important;
  cursor: default;
}
.tw-ws-total { margin-top: 16px; max-width: 320px; margin-left: auto; }
.tw-ws-total input { background: #FDF1F3 !important; border-color: #E8BCC6 !important; }

/* ------------------------------------------------------ life policies */
.tw-ws-policies { display: grid; gap: 14px; }
.tw-ws-policy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, .8fr);
  gap: 14px 18px;
  align-items: end;
}
.tw-ws-add {
  background: none !important;
  border: 1px dashed #B7BFCD !important;
  border-radius: 30px !important;
  color: #5C6C7D !important;
  font: 600 14px/1 Inter, Arial, sans-serif !important;
  padding: 11px 20px !important;
  margin: 16px 0 0 !important;
  cursor: pointer;
  text-transform: none !important;
  transition: border-color .15s ease, color .15s ease;
}
.tw-ws-add:hover { border-color: #B4203F !important; color: #B4203F !important; }

/* ------------------------------------------------------- the headline */
.tw-ws-result {
  background: #232B33;
  border-radius: 12px;
  padding: 26px 28px;
  margin: 8px 0 26px;
  color: #fff;
}
.tw-ws-result-main { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.tw-ws-result-label {
  font: 500 15px/1.4 Inter, Arial, sans-serif;
  color: #B7BFCD;
}
.tw-ws-result-value {
  font: 700 34px/1.15 Montserrat, Arial, sans-serif;
  color: #fff;
  letter-spacing: -.01em;
}
.tw-ws-result-sub {
  font: 400 13.5px/1.6 Inter, Arial, sans-serif !important;
  color: #B7BFCD !important;
  margin: 12px 0 0 !important;
  max-width: 64ch;
}
.tw-ws-result-life {
  display: flex; align-items: baseline; gap: 12px;
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid rgba(255,255,255,.16);
  font: 400 14px/1.4 Inter, Arial, sans-serif;
  color: #B7BFCD;
}
.tw-ws-result-life strong {
  font: 600 18px/1.3 Montserrat, Arial, sans-serif;
  color: #E39A62;
}

/* --------------------------------------------------------- the actions */
.tw-ws-actions { gap: 14px; }
.tw-ws-pdf {
  background: none !important;
  border: 1.5px solid #B4203F !important;
  border-radius: 30px !important;
  color: #B4203F !important;
  font: 600 15px/1 Inter, Arial, sans-serif !important;
  padding: 13px 26px !important;
  cursor: pointer;
  text-transform: none !important;
  transition: background .18s ease, color .18s ease;
}
.tw-ws-pdf:hover { background: #B4203F !important; color: #fff !important; }
.tw-ws-pdf:disabled { opacity: .55; cursor: default; }

.tw-worksheet .tw-done-panel {
  background: #F1F7F3;
  border-radius: 10px;
  padding: 22px 24px;
  margin: 22px 0 0;
}
.tw-worksheet .tw-done-panel h3 {
  font: 600 17px/1.35 Montserrat, Arial, sans-serif !important;
  color: #1E6B3A !important;
  margin: 0 0 8px !important;
}
.tw-worksheet .tw-done-panel p {
  font: 400 14.5px/1.6 Inter, Arial, sans-serif !important;
  color: #3F5147 !important;
  margin: 0 !important;
}

/* ------------------------------------------------------------ narrow */
@media (max-width: 860px) {
  .tw-ws-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tw-ws-policy { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .tw-ws-grid-3,
  .tw-ws-grid-inc,
  .tw-ws-policy { grid-template-columns: minmax(0, 1fr); }

  /* the real-estate table stops being a table and becomes four small
     stacks, one per property, with the labels back in view */
  .tw-ws-grid-re { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tw-ws-grid-re > .tw-ws-col { display: none; }
  .tw-ws-grid-re .tw-ws-rowlabel {
    padding: 16px 0 2px;
    font-weight: 600;
  }
  .tw-ws-grid-re .tw-field label {
    position: static;
    width: auto; height: auto;
    clip: auto;
  }
  .tw-ws-total { max-width: none; margin-left: 0; }
  .tw-ws-result-value { font-size: 28px; }
  .tw-ws-actions { flex-direction: column; align-items: stretch; }
  .tw-ws-actions .tw-submit,
  .tw-ws-actions .tw-ws-pdf { width: 100%; }
}

/* ------------------------------------------------------ the result panel
   Shown after "Calculate my liability" has sent the snapshot. */
.tw-worksheet .tw-ws-outcome { text-align: left; background: #fff; box-shadow: 0 0 0 1px #E6DCC8; padding: 28px 28px 22px; margin-top: 0; }
.tw-worksheet .tw-ws-outcome:focus { outline: none; }
.tw-worksheet .tw-ws-outcome h3 { color: #232B33 !important; font-size: 22px !important; }
.tw-worksheet .tw-ws-outcome .tw-ws-outcome-sent { color: #1E6B3A !important; margin: 0 0 18px !important; }
.tw-ws-outcome-total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  border-bottom: 2px solid #D91E1E; padding: 6px 0 10px; margin-bottom: 8px;
}
.tw-ws-outcome-total span { font: 700 18px/1.3 Montserrat, Arial, sans-serif; color: #D91E1E; }
.tw-ws-outcome-total strong { font: 700 30px/1.1 Montserrat, Arial, sans-serif; color: #D91E1E; }
.tw-ws-outcome-lines { margin: 0 0 10px; padding: 0; }
.tw-ws-outcome-lines > div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid #EEE7D9;
}
.tw-ws-outcome-lines dt { font: 400 15px/1.4 Inter, Arial, sans-serif; color: #3F4B57; }
.tw-ws-outcome-lines dd { margin: 0; font: 600 15px/1.4 Inter, Arial, sans-serif; color: #232B33; white-space: nowrap; }
.tw-ws-outcome-lines .tw-ws-outcome-life { border-bottom: 0; margin-top: 6px; }
.tw-ws-outcome-lines .tw-ws-outcome-life dt, .tw-ws-outcome-lines .tw-ws-outcome-life dd { color: #5C6C7D; }
.tw-worksheet .tw-ws-outcome .tw-ws-outcome-note { font-size: 12.5px !important; color: #5C6C7D !important; margin: 4px 0 20px !important; }
.tw-ws-outcome-email { display: flex; flex-direction: column; gap: 6px; max-width: 420px; margin-bottom: 14px; }
.tw-ws-outcome-email label { font: 600 14px/1.3 Inter, Arial, sans-serif !important; color: #232B33 !important; }
.tw-ws-outcome-email input {
  font: 400 16px/1.4 Inter, Arial, sans-serif !important; padding: 11px 12px !important; border: 1px solid #C9C2B2 !important;
  border-radius: 6px !important; background: #fff !important; color: #232B33 !important;
}
.tw-ws-outcome-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.tw-ws-email {
  background: #B4203F !important; color: #fff !important; border: 1.5px solid #B4203F !important; border-radius: 30px !important;
  font: 600 15px/1 Inter, Arial, sans-serif !important; padding: 13px 26px !important; cursor: pointer !important;
}
.tw-ws-email:hover { background: #8F1631 !important; border-color: #8F1631 !important; }
.tw-ws-email:disabled { opacity: .6 !important; cursor: default !important; }
.tw-ws-edit, .tw-ws-edit:hover, .tw-ws-edit:focus { box-shadow: none !important; }
.tw-ws-edit:hover { background: none !important; color: #8F1631 !important; }
.tw-worksheet .tw-ws-outcome h3, .tw-worksheet .tw-ws-outcome p { text-align: left !important; }
.tw-worksheet .tw-ws-outcome .tw-ws-outcome-status { margin: 12px 0 0 !important; min-height: 1.2em; font-size: 14px !important; }
.tw-worksheet .tw-ws-outcome .tw-ws-outcome-status.tw-ok { color: #1E6B3A !important; }
.tw-worksheet .tw-ws-outcome .tw-ws-outcome-status.tw-fail { color: #B4203F !important; }
.tw-ws-edit {
  margin-top: 16px !important; background: none !important; border: 0 !important; padding: 4px 0 !important; cursor: pointer !important;
  color: #B4203F !important; text-decoration: underline !important; font: 400 14px/1.4 Inter, Arial, sans-serif !important;
}
@media (max-width: 860px) {
  .tw-worksheet .tw-ws-outcome { padding: 22px 18px 18px; }
  .tw-ws-outcome-actions .tw-ws-email, .tw-ws-outcome-actions .tw-ws-pdf { width: 100%; }
  .tw-ws-outcome-total strong { font-size: 26px; }
}

/* Nothing is calculated on screen while the visitor fills the form in.
   The figures are still worked out quietly (the agency's email needs
   them); the visitor sees them only after "Calculate my liability". */
.tw-worksheet .tw-ws-calc,
.tw-worksheet #tw-ws-result,
.tw-worksheet .tw-ws-grid-re > .tw-ws-col:nth-child(4) { display: none !important; }
.tw-ws-grid-re { grid-template-columns: minmax(120px, .8fr) repeat(2, minmax(0, 1fr)); }
@media (max-width: 620px) { .tw-ws-grid-re { grid-template-columns: minmax(0, 1fr); } }
