/* Destination · NDA signing portal
   Provenance · Company wordmark and symbol on the invitation's navy chart
   Purpose · Accessible responsive signing interface
   Method · Local typefaces, native controls and high-contrast surfaces
   Validation · Layout at 1440 and 390 pixels */

:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #172b40;
  background: #f1f4f7;
  --navy: #132d48;
  --blue: #155e9c;
  --muted: #526679;
  --line: #d2dce4;
  --paper: #fff;
  --script: "Segoe Script", "Apple Chancery", "Snell Roundhand", "Brush Script MT", "URW Chancery L", "Dancing Script", cursive;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button, input, a {
  font: inherit;
}

button, a, input {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .54;
}

a {
  color: var(--blue);
}

[hidden] {
  display: none!important;
}

:focus-visible {
  outline: 3px solid #ad6400;
  outline-offset: 3px;
}

h2:focus {
  outline: none;
}

.shell {
  width: min(1180px, 100%);
  margin: auto;
  padding-inline: 32px;
}

.masthead {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #f5f8fc;
  background: #102139 url("/brand/chart.webp") center 66% / cover no-repeat;
  border-top: 3px solid #6298c7;
}

.masthead::before {
  content: "";
  position: absolute;
  top: 50%;
  right: max(-48px, calc((100% - 1280px) / 2));
  width: clamp(190px, 26vw, 360px);
  aspect-ratio: 439 / 452;
  transform: translateY(-47%);
  background: url("/brand/symbol.png") center / contain no-repeat;
  filter: grayscale(1) invert(1) contrast(1.2);
  mix-blend-mode: screen;
  opacity: .15;
  pointer-events: none;
}

.masthead-inner {
  position: relative;
  padding-block: 21px 25px;
}

.brand-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 19px;
}

.wordmark {
  display: block;
  width: 166px;
  height: auto;
  filter: grayscale(1) invert(1) contrast(1.2);
  mix-blend-mode: screen;
}

.masthead .eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a3ccef;
  margin-bottom: 4px;
}

.masthead .eyebrow::before {
  content: "";
  width: 23px;
  border-top: 2px solid currentColor;
}

.badge {
  display: inline-block;
  color: #e5f2ff;
  background: #224361;
  border: 1px solid #4b6882;
  border-radius: 100px;
  font-size: .8rem;
  padding: 6px 12px;
  font-weight: 600;
}

.eyebrow {
  margin: 0 0 7px;
  font-size: .71rem;
  letter-spacing: .12em;
  font-weight: 750;
  color: #456584;
  text-transform: uppercase;
}

h1, h2, p {
  overflow-wrap: break-word;
}

h1 {
  font-size: clamp(1.95rem, 3vw, 2.7rem);
  letter-spacing: -.044em;
  line-height: 1.13;
  margin: 0;
}

h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -.03em;
  line-height: 1.25;
}

.steps {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 20px 0;
}

.steps li {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: .87rem;
  color: var(--muted);
  font-weight: 600;
}

.steps li span {
  border: 1px solid #acbbc8;
  width: 23px;
  height: 23px;
  border-radius: 100%;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
}

.steps [aria-current=step] {
  color: var(--blue);
}

.steps [aria-current=step] span {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: start;
  gap: 22px;
}

.viewer, .panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 3px 12px #192e4409;
}

.viewer-top, .page-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
}

.viewer-top h2 {
  font-size: 1.1rem;
}

.text-link, .quiet {
  font-size: .88rem;
  font-weight: 650;
  color: var(--blue);
}

.text-link {
  text-underline-offset: 3px;
}

.paper-stage {
  background: #e3e9ee;
  padding: 16px;
  border-block: 1px solid var(--line);
}

.paper {
  position: relative;
  container-type: inline-size;
  max-width: 655px;
  margin: auto;
  background: white;
  border: 1px solid #c7cfd6;
  box-shadow: 0 2px 7px #20324415;
}

.paper img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 612/792;
}

/* The three blanks are on page 1 of the 612 × 792 point letter template.
   Position each field's bottom edge just above its printed underline. */
.document-field {
  position: absolute;
  display: block;
  transform: translateY(-100%);
  height: 1.44%;
  padding: 0 .25cqw;
  margin: 0;
  border: 0;
  border-radius: 0;
  line-height: 1.27;
  font-family: Arial, sans-serif;
  font-size: 1.72cqw;
  font-weight: 500;
  color: #162f46;
  background: #eaf3fb;
  white-space: nowrap;
}

#document-month-day {
  left: 69.61%;
  top: 14.20%;
  width: 17.97%;
}

#document-year {
  left: 13.73%;
  top: 15.87%;
  width: 4%;
}

#document-name {
  left: 11.76%;
  top: 22.16%;
  width: 39.90%;
  background: #e5f1fd;
  box-shadow: inset 0 0 0 1px #82aad0;
}

#sign-here {
  left: 55.39%;
  top: 78.91%;
  width: 32.68%;
  height: 3.1%;
  border: 1px dashed #6395c0;
  border-radius: 3px;
  background: #eff7ff;
  color: #154f80;
  font-weight: 650;
}

#sign-here::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  min-height: 24px;
  transform: translateY(-50%);
}

#last-page-name {
  left: 57.52%;
  top: 81.32%;
  width: 30.39%;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent;
}

.page-controls {
  font-size: .87rem;
  color: var(--muted);
}

.summary {
  padding: 24px;
  position: sticky;
  top: 16px;
}

.summary h2 {
  font-size: 1.35rem;
}

dl, dd {
  margin: 0;
}

.summary dl {
  margin: 21px 0 17px;
}

.summary dt, .dates dt {
  font-size: .77rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.summary dd, .dates dd {
  overflow-wrap: anywhere;
  font-size: .94rem;
}

.summary dd+dt {
  margin-top: 14px;
}

.primary, .secondary, .quiet {
  border-radius: 7px;
  font-weight: 650;
  line-height: 1.3;
}

.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 17px;
  text-decoration: none;
  border: 1px solid transparent;
}

.primary {
  background: var(--blue);
  color: #fff;
}

.primary:hover:not(:disabled) {
  background: #114c7e;
}

.secondary {
  padding: 7px 12px;
  background: white;
  border-color: #abbaC8;
  color: var(--navy);
}

.secondary:hover:not(:disabled) {
  background: #eef4f9;
}

.quiet {
  border: 0;
  background: transparent;
  padding: 5px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wide {
  width: 100%;
}

.helper, .intro {
  font-size: .91rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 9px 0 17px;
}

.summary .helper {
  margin: 8px 0 17px;
}

.sidebar-name {
  display: block;
}

.signing-panel, .receipt {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 32px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.section-header .eyebrow {
  margin: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}

.field, legend {
  font-size: .87rem;
  font-weight: 650;
}

.field input {
  margin-top: 6px;
  display: block;
  width: 100%;
  padding: 10px 12px;
  color: var(--navy);
  background: white;
  border: 1px solid #a4b4c2;
  border-radius: 6px;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.signature-choice {
  border: 0;
  padding: 0;
  margin: 20px 0 10px;
}

.signature-choice legend {
  padding: 0;
  margin-bottom: 7px;
}

.choice-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.choice-row label {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: .89rem;
}

.choice-row label:has(input:checked) {
  border-color: #5c97c4;
  background: #eef6fc;
}

.choice-row input, .consent input {
  accent-color: var(--blue);
}

.signature-area {
  position: relative;
  padding: 12px 16px 16px;
  border: 1px solid #b8c9d6;
  border-radius: 8px;
  background: #fbfcfd;
}

.signature-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 23px;
  font-size: .75rem;
  font-weight: 650;
  color: var(--muted);
}

.signature-rule {
  border-top: 1px solid #b5c3cf;
  pointer-events: none;
}

#typed-preview {
  display: grid;
  place-items: center;
  min-height: 100px;
  max-width: 100%;
  color: #18324a;
  font-family: var(--script);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-align: center;
}

#typed-preview canvas, #drawing {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4/1;
}

#drawing {
  touch-action: none;
  cursor: crosshair;
}

.dates {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 38px;
  padding: 15px 0;
  border-block: 1px solid var(--line);
  margin: 14px 0;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  line-height: 1.5;
  font-size: .91rem;
}

.consent input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 3px 0 0;
}

.notice {
  background: #eaf2f9;
  border: 1px solid #c1d5e7;
  border-radius: 8px;
  padding: 14px 16px;
}

.notice p {
  margin: 0 0 10px;
}

.error {
  background: #fff4f1;
  border-color: #deb5aa;
  color: #742f20;
}

.receipt {
  line-height: 1.5;
}

.receipt p {
  color: var(--muted);
}

.receipt .dates {
  margin-bottom: 22px;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin-bottom: 16px;
  background: #e1f1e9;
  color: #285f47;
  border-radius: 50%;
  font-size: 1.4rem;
}

.footnote {
  padding-block: 24px 28px;
  color: var(--muted);
  font-size: .77rem;
}

@media(max-width:800px) {
  .shell {
    padding-inline: 20px;
  }
  .review-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .summary {
    grid-row: 1;
    position: static;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 16px;
    align-items: center;
  }
  .summary .eyebrow, .summary dl {
    display: none;
  }
  .summary .helper {
    border: 0;
    padding: 0;
    margin: 0;
    font-size: .84rem;
  }
  .summary .sidebar-name, .summary .helper {
    grid-column: 1;
  }
  .summary .wide {
    grid-column: 2;
    grid-row: 1/4;
  }
}

@media(max-width:520px) {
  .shell {
    padding-inline: 15px;
  }
  .masthead-inner {
    padding-block: 16px 19px;
  }
  .masthead::before {
    right: -52px;
    opacity: .09;
  }
  .brand-row {
    margin-bottom: 15px;
  }
  .wordmark {
    width: 136px;
  }
  .badge {
    font-size: .7rem;
    padding: 4px 9px;
  }
  .steps {
    gap: 17px;
    padding: 15px 0;
  }
  .steps li {
    font-size: .81rem;
  }
  .summary {
    padding: 14px;
    gap: 8px;
    grid-template-columns: 1fr;
  }
  .summary .wide {
    grid-row: auto;
    grid-column: auto;
  }
  .summary h2 {
    font-size: 1.1rem;
  }
  .viewer-top, .page-controls {
    padding: 12px;
  }
  .paper-stage {
    padding: 5px;
  }
  .signing-panel, .receipt {
    padding: 18px 15px;
  }
  .field-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .choice-row {
    gap: 6px;
  }
  .choice-row label {
    padding: 7px;
    font-size: .81rem;
  }
  .signature-area {
    padding: 10px;
  }
  .section-header {
    align-items: flex-start;
  }
  .dates {
    gap: 12px 22px;
  }
  .footnote {
    padding-block: 18px;
  }
}
