/* Client wizard validation presentation.
   Scoped to the client portal so shared staff workflows remain untouched. */
.client-portal-page .vp-field-error {
  border-color: #a83d45 !important;
  outline: 2px solid #a83d45;
  outline-offset: 2px;
  background-color: #fff1f0 !important;
  color: #54272b;
}

.client-portal-page .vp-field-error:focus,
.client-portal-page .vp-field-error:focus-visible {
  outline-color: #8e2631;
  outline-width: 3px;
}

/* Also make controls inside an errored fieldset/group legible without
   replacing their native focus indicators. */
.client-portal-page .vp-field-error :is(input, select, textarea) {
  border-color: #a83d45;
  background-color: #fff8f7;
}

.client-portal-page .vp-field-error :is(input, select, textarea):focus-visible {
  outline: 3px solid #8e2631;
  outline-offset: 2px;
}

.client-portal-page .vp-field-error-message {
  display: block;
  margin: 4px 0 0;
  color: #9b3039;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.client-portal-page .vp-required-marker {
  display: inline !important;
  font-size: inherit;
  margin-inline-start: 3px;
  color: #a3303a;
  font-weight: 800;
}

.client-portal-page .vp-validation-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
  grid-column: 1 / -1;
  margin-top: 5px;
}

.client-portal-page .vp-validation-choice {
  flex: 1 1 130px;
  max-width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid #a83d45;
  border-radius: 4px;
  background: #fffdfc;
  color: #54272b;
  font: inherit;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.client-portal-page .vp-validation-choice:focus-visible {
  outline: 3px solid #8e2631;
  outline-offset: 2px;
}

.client-portal-page .vp-validation-summary {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  max-height: min(19dvh, 132px);
  flex: 1 1 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px 10px;
  border: 1px solid #d69a9c;
  border-inline-start: 3px solid #a83d45;
  border-radius: 4px;
  background: #fff4f2;
  color: #54272b;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.client-portal-page .vp-field-error-message {
  grid-column: 1 / -1;
  flex-basis: 100%;
  width: 100%;
}

.client-portal-page .vp-validation-summary > strong {
  display: block;
  margin: 0 0 4px;
  color: #812b34;
  font-size: 13px;
  line-height: 1.3;
}

.client-portal-page .vp-validation-summary ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.client-portal-page .vp-validation-summary li {
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

.client-portal-page .vp-validation-link {
  display: inline-flex;
  min-height: 36px;
  max-width: 100%;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid #e0b4b4;
  border-radius: 4px;
  background: #fffdfc;
  color: #872d37;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.client-portal-page .vp-validation-link:hover {
  border-color: #a83d45;
  background: #fff;
}

.client-portal-page .vp-validation-link:focus-visible,
.client-portal-page .vp-validation-retry:focus-visible {
  outline: 3px solid #8e2631;
  outline-offset: 2px;
}

.client-portal-page .vp-validation-retry {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  margin: 5px 0 0;
  padding: 7px 11px;
  border: 1px solid #a83d45;
  border-radius: 4px;
  background: #fffdfc;
  color: #872d37;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.client-portal-page .vp-validation-retry:hover {
  background: #fce7e5;
}

/* The compact wizard keeps navigation docked; allow a longer validation
   list to scroll inside its own panel rather than widening or hiding controls. */
.client-portal-page.vpc-compact-wizard :is(.wizard-actions, .flow-actions) {
  box-sizing: border-box;
  min-width: 0;
  max-width: calc(100vw - 20px);
  flex-wrap: wrap;
}

.client-portal-page.vpc-compact-wizard :is(.wizard-actions, .flow-actions) .vp-validation-summary {
  width: 100%;
  max-width: 100%;
}

.client-portal-page.vpc-compact-wizard .uk-dependent-navigation .vp-validation-summary {
  flex-basis: 100%;
}

.client-portal-page .usa-page-actions {
  flex-wrap: wrap;
}

.client-portal-page .usa-page-actions .vp-validation-summary {
  flex-basis: 100%;
  width: 100%;
}

.client-portal-page :is(.usa-page-actions,.uk-dependent-navigation).vp-has-validation {
  position: sticky;
  z-index: 65;
  bottom: 8px;
  padding: 8px;
  border: 1px solid #d69a9c;
  background: #fffdfc;
}

@media (max-width: 600px) {
  .client-portal-page .vp-validation-summary {
    max-height: min(17dvh, 112px);
    padding: 7px 8px;
  }

  .client-portal-page .vp-validation-summary ul {
    gap: 3px 5px;
  }

  .client-portal-page .vp-validation-link {
    min-height: 40px;
    padding: 6px 8px;
  }

  .client-portal-page.vpc-compact-wizard :is(.wizard-actions, .flow-actions) {
    max-height: calc(100dvh - 24px - env(safe-area-inset-top));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .client-portal-page.vpc-compact-wizard :is(.wizard-actions, .flow-actions):has(.vp-validation-summary:not([hidden])) {
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 128px);
  }

  .client-portal-page :is(.usa-page-actions,.uk-dependent-navigation).vp-has-validation {
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 128px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .client-portal-page .vp-validation-link,
  .client-portal-page .vp-validation-retry {
    scroll-behavior: auto;
    transition: none;
  }
}
