/* Investment Questionnaire — Vantage Wealth Management
   ---------------------------------------------------------------------------
   Deliberately close to the printed Worldsource form: the same near-black navy
   headings, the same heavy sans-serif, the same gold rule under the cover
   title, the same chart colours. A client who has seen the PDF should feel like
   they are filling in that document, not a different one.

   Colours below were sampled from the PDF itself rather than guessed:
     #012639  headings and the score-table header
     #1d95bf  "best year" bars
     #d38d2f  "average year" bars
     #828282  "worst year" bars
     #c5a54a  the gold rule (also Vantage's accent)
*/

:root {
  --navy: #012639;
  --navy-soft: #0a3d57;
  --ink: #1c1c1c;
  --grey: #5a6672;
  --rule: #d7dde2;
  --field: #eef1f3;
  --gold: #c5a54a;
  --best: #1d95bf;
  --avg: #d38d2f;
  --worst: #828282;
  --page: #ffffff;
  --shell: #eef1f4;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--shell);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- page shell: one white sheet, like the paper form ---------- */

.sheet {
  max-width: 840px;
  margin: 0 auto;
  background: var(--page);
  min-height: 100vh;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sheet-inner {
  padding: 34px 44px 48px;
}

@media (max-width: 640px) {
  .sheet-inner {
    padding: 22px 20px 36px;
  }
}

/* ---------- masthead: both logos ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.masthead img.vantage {
  height: 46px;
  width: auto;
  display: block;
}

.masthead img.worldsource {
  height: 44px;
  width: auto;
  display: block;
}

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

.masthead-note {
  font-size: 11px;
  color: var(--grey);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 6px;
}

@media (max-width: 560px) {
  .masthead {
    gap: 14px;
  }
  .masthead img.vantage {
    height: 36px;
  }
  .masthead img.worldsource {
    height: 34px;
  }
  .masthead-right {
    text-align: left;
  }
}

/* ---------- cover ---------- */

/* The printed form runs a tall photograph down the right-hand side of the cover.
   Two columns on a wide screen; on a narrow one the photo becomes a short band
   above the copy so it stays a grace note rather than a page of scrolling before
   the first question. */
.cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 34px;
  align-items: stretch;
}

.cover-art {
  border-radius: 3px;
  overflow: hidden;
  /* The source image is very tall; the frame decides the shape and the image
     crops to fill it rather than dictating the height of the row. */
  min-height: 100%;
}

.cover-art img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  object-position: 50% 30%;
}

@media (max-width: 860px) {
  .cover {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  /* Photo first, so the page opens with an image the way the form does. */
  .cover-art {
    order: -1;
  }
  .cover-art img {
    min-height: 0;
    height: 180px;
    object-position: 50% 28%;
  }
}

.cover h1 {
  font-size: 44px;
  line-height: 1.06;
  color: var(--navy);
  margin: 30px 0 0;
  /* The line break in the markup is the one from the printed cover; below the
     two-column breakpoint the heading is allowed to wrap naturally instead. */
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cover .rule {
  height: 2px;
  background: var(--gold);
  margin: 20px 0 18px;
  max-width: 340px;
}

.cover h2 {
  font-size: 23px;
  line-height: 1.3;
  color: var(--navy);
  font-weight: 600;
  margin: 0 0 20px;
  max-width: 30ch;
}

.cover p {
  margin: 0 0 14px;
  max-width: 62ch;
  color: var(--ink);
}

.cover-copy > *:first-child {
  margin-top: 0;
}

@media (max-width: 640px) {
  .cover h1 {
    font-size: 32px;
  }
  .cover h2 {
    font-size: 19px;
  }
}

/* ---------- section headings, as on the form ---------- */

.section-title {
  font-size: 30px;
  line-height: 1.15;
  color: var(--navy);
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.section-lead {
  font-weight: 700;
  margin: 0 0 26px;
  max-width: 68ch;
}

.section-lead.plain {
  font-weight: 400;
  color: var(--ink);
}

@media (max-width: 640px) {
  .section-title {
    font-size: 24px;
  }
}

/* ---------- identity fields ---------- */

.fields {
  margin: 0 0 30px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.field-row label {
  font-size: 14px;
  font-weight: 600;
  min-width: 168px;
  color: var(--ink);
}

.field-row input {
  flex: 1 1 220px;
  min-width: 0;
  background: var(--field);
  border: 1px solid #dde2e6;
  border-radius: 2px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.field-row input:focus {
  outline: 2px solid var(--navy-soft);
  outline-offset: 1px;
}

.field-hint {
  font-size: 13px;
  color: var(--grey);
  margin: -4px 0 18px;
  max-width: 70ch;
}

.accounts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}

@media (max-width: 640px) {
  .accounts-grid {
    grid-template-columns: 1fr;
  }
  .field-row label {
    min-width: 0;
    flex: 1 1 100%;
  }
}

/* ---------- questions ---------- */

.question {
  margin: 0 0 34px;
  scroll-margin-top: 20px;
}

.question-head {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.question-num {
  font-weight: 700;
  color: var(--ink);
  flex: 0 0 auto;
  min-width: 22px;
}

.question-body {
  flex: 1 1 auto;
  min-width: 0;
}

.question-intro {
  font-weight: 700;
  margin: 0 0 12px;
}

.question-prompt {
  font-weight: 700;
  margin: 0;
}

.options {
  list-style: none;
  margin: 12px 0 0;
  padding: 0 0 0 34px;
}

@media (max-width: 640px) {
  .options {
    padding-left: 4px;
  }
}

.option {
  margin: 0 0 9px;
}

.option label {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  cursor: pointer;
  padding: 4px 6px 4px 0;
  border-radius: 3px;
}

.option label:hover {
  background: #f7f9fa;
}

.option input[type="radio"] {
  margin: 3px 0 0;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  accent-color: var(--navy);
}

.option-text {
  flex: 1 1 auto;
  min-width: 0;
}

.option-text strong {
  font-weight: 700;
}

.option-detail {
  color: var(--ink);
}

.option-detail.italic {
  font-style: italic;
}

/* Point values, shown the way the form shows them: small, grey, to the side.
   Clients see them on the paper version, so hiding them here would make the
   two documents disagree. */
.option-points {
  color: var(--grey);
  font-size: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
  padding-top: 2px;
}

.other-input {
  margin: 8px 0 0 26px;
  max-width: 460px;
}

.other-input input {
  width: 100%;
  background: var(--field);
  border: 1px solid #dde2e6;
  border-radius: 2px;
  padding: 9px 11px;
  font: inherit;
  font-size: 15px;
}

/* ---------- the question 3 chart ---------- */

.chart-wrap {
  margin: 18px 0 16px;
}

.chart-title {
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 10px;
}

.chart-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chart-scroll svg {
  display: block;
  min-width: 620px;
  width: 100%;
  height: auto;
}

.chart-legend {
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ink);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 11px;
  height: 11px;
  display: inline-block;
  border-radius: 1px;
}

.chart-hint {
  font-size: 12px;
  color: var(--grey);
  text-align: center;
  margin: 8px 0 0;
}

/* ---------- running subtotal boxes ---------- */

.subtotal {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 34px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
}

.subtotal-label {
  font-style: italic;
  font-size: 15px;
  flex: 1 1 300px;
}

.subtotal-box {
  background: var(--field);
  border: 1px solid #dde2e6;
  border-radius: 2px;
  min-width: 92px;
  padding: 9px 14px;
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
}

/* ---------- navigation ---------- */

.nav {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 30px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
}

.btn {
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 13px 26px;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: #01344d;
}

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border-color: #c3ccd3;
}

.btn-secondary:hover {
  background: #f4f7f9;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-note {
  font-size: 13px;
  color: var(--grey);
  flex: 1 1 200px;
}

/* ---------- progress ---------- */

.progress {
  margin: 0 0 26px;
}

.progress-track {
  height: 4px;
  background: #e5eaee;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0;
  transition: width 0.25s ease;
}

.progress-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey);
  padding-top: 8px;
}

/* ---------- results ---------- */

.score-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 340px;
  font-size: 14px;
}

.score-table caption {
  text-align: left;
  font-weight: 700;
  padding-bottom: 8px;
  color: var(--navy);
}

.score-table th {
  background: var(--navy);
  color: #fff;
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.score-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
}

.score-table td:first-child {
  width: 34%;
}

.score-table tr.hit td {
  background: #fdf8ea;
  font-weight: 700;
  color: var(--navy);
}

.results-top {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin: 0 0 30px;
}

.results-copy {
  flex: 1 1 320px;
  min-width: 0;
}

.results-copy p {
  margin: 0 0 14px;
  max-width: 62ch;
}

.results-table-wrap {
  flex: 0 1 340px;
}

.profile-row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin: 0 0 26px;
}

.profile-cell h4 {
  font-size: 15px;
  color: var(--navy);
  margin: 0 0 7px;
  font-weight: 700;
}

.profile-box {
  background: var(--field);
  border: 1px solid #dde2e6;
  border-radius: 2px;
  padding: 11px 14px;
  min-width: 132px;
}

.profile-box .num {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}

.profile-box .rating {
  font-size: 13px;
  color: var(--grey);
  padding-top: 2px;
}

.profile-box.primary {
  background: var(--navy);
  border-color: var(--navy);
}

.profile-box.primary .num,
.profile-box.primary .rating {
  color: #fff;
}

.profile-box.primary .rating {
  color: #cddbe4;
}

.profile-join {
  font-size: 13px;
  color: var(--grey);
  padding-bottom: 13px;
  flex: 0 0 auto;
}

.callout {
  background: #f6f8fa;
  border-left: 3px solid var(--gold);
  padding: 16px 18px;
  margin: 0 0 26px;
  font-size: 14px;
  line-height: 1.6;
}

.callout h4 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--navy);
}

.callout p {
  margin: 0 0 9px;
}

.callout p:last-child {
  margin: 0;
}

.callout ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.callout li {
  margin-bottom: 5px;
}

.transcript {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 8px 0 0;
}

.transcript th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey);
  font-weight: 400;
  padding: 0 10px 7px 0;
  border-bottom: 1px solid var(--rule);
}

.transcript td {
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.transcript td.num {
  width: 26px;
  color: var(--grey);
}

.transcript td.pts {
  width: 62px;
  text-align: right;
  color: var(--grey);
  white-space: nowrap;
}

.transcript td.ans {
  font-weight: 700;
}

.transcript .missing {
  color: #a3300f;
  font-weight: 700;
}

/* Four columns of prose do not fit a phone: the question column becomes a
   ribbon a few words wide and answers like "5-10%" split across lines. Below
   this width each question becomes its own stacked block — number and points on
   one line, then the question, then the answer. */
@media (max-width: 640px) {
  .transcript thead {
    /* Hidden visually but still announced, so the column meanings survive for
       screen readers even though the cells are relabelled below. */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .transcript,
  .transcript tbody,
  .transcript td {
    display: block;
    width: auto;
  }

  /* Cell order in the markup is number, question, answer, points. Flex order
     pulls the points up beside the number so the meta line reads
     "Question 3 · 3 points" above the question. */
  .transcript tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    border-bottom: 1px solid var(--rule);
    padding: 12px 0;
  }

  .transcript td {
    border-bottom: 0;
    padding: 0;
  }

  .transcript td.num {
    order: 1;
    width: auto;
    flex: 0 0 auto;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  /* "3" alone reads as nothing once the # header is gone. */
  .transcript td.num::before {
    content: "Question ";
  }

  .transcript td.pts {
    order: 2;
    width: auto;
    flex: 0 0 auto;
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .transcript td.pts::before {
    content: "\00a0\00b7\00a0";
  }

  .transcript td.q {
    order: 3;
    flex: 0 0 100%;
    margin: 5px 0 6px;
  }

  .transcript td.ans {
    order: 4;
    flex: 0 0 100%;
    /* Ranges and dollar figures should never be the thing that wraps. */
    overflow-wrap: break-word;
  }

  .transcript td.ans::before {
    content: "Your answer: ";
    font-weight: 400;
    color: var(--grey);
  }
}

/* ---------- the email step ---------- */

.email-card {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 22px 24px;
  margin: 30px 0 0;
  position: relative;
}

.email-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
  color: var(--navy);
}

.email-card > p {
  margin: 0 0 16px;
  font-size: 14px;
  max-width: 64ch;
}

.email-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}

@media (max-width: 640px) {
  .email-grid {
    grid-template-columns: 1fr;
  }
}

.email-grid label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}

.email-grid input {
  width: 100%;
  background: var(--field);
  border: 1px solid #dde2e6;
  border-radius: 2px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
}

/* Required-field marker. Colour alone is not the signal — the asterisk carries
   it, and the inputs also have aria-required. */
.req {
  color: #a3300f;
  font-weight: 700;
}

.email-grid .optional {
  font-weight: 400;
  color: var(--grey);
}

.field-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--grey);
  margin: 10px 0 0;
}

/* Applied by main.js on the field that failed, so the message under the button
   and the field itself point at the same thing. */
.email-grid input.invalid,
.fields input.invalid {
  border-color: #a3300f;
  box-shadow: 0 0 0 2px rgba(163, 48, 15, 0.12);
}

/* The cover's required-name prompt turns into the error message in place. */
.field-note.error {
  color: #a3300f;
  font-weight: 700;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.55;
  max-width: 66ch;
}

.consent input {
  margin: 2px 0 0;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  accent-color: var(--navy);
}

.email-note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--grey);
  margin: 12px 0 0;
  min-height: 20px;
}

.email-note.error {
  color: #a3300f;
  font-weight: 700;
}

.email-note.good {
  color: #1c5c34;
  font-weight: 700;
}

/* Off screen rather than display:none — a bot filling hidden fields will still
   fill this one, which is the point. */
.trap {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

textarea.freetext {
  width: 100%;
  min-height: 96px;
  background: var(--field);
  border: 1px solid #dde2e6;
  border-radius: 2px;
  padding: 11px 12px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
}

.yesno {
  display: flex;
  gap: 22px;
  margin: 10px 0 14px;
}

.yesno label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.inline-options {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 10px 0 0;
}

/* ---------- footer ---------- */

.form-footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--grey);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.form-footer strong {
  color: var(--ink);
}

.disclaimer {
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  line-height: 1.6;
  color: var(--grey);
}

.disclaimer p {
  margin: 0 0 9px;
}

.disclaimer p:last-child {
  margin: 0;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 22px 0 0;
  flex-wrap: wrap;
}

.footer-logos img {
  height: 34px;
  width: auto;
  opacity: 0.9;
}

/* ---------- utility ---------- */

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media print {
  body {
    background: #fff;
  }
  .sheet {
    box-shadow: none;
    max-width: none;
  }
  .nav,
  .progress,
  .email-card {
    display: none !important;
  }
}
