/* Scoped form styles. Load after the existing landing/revision styles. */
html.demo-modal-open {
  overflow: hidden;
  scrollbar-gutter: stable;
}

.demo-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(680px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 24px;
  border: 1px solid #d6e0ed;
  border-radius: 12px;
  background: #fff;
  color: #243b59;
  box-shadow: 0 20px 70px #102c4826;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}

.demo-dialog:not([open]),
.demo-dialog [hidden] {
  display: none !important;
}

.demo-dialog::backdrop {
  background: #10263e75;
}

.demo-dialog *,
.demo-dialog *::before,
.demo-dialog *::after {
  box-sizing: border-box;
}

.demo-dialog-inner {
  position: relative;
  padding: 32px 34px 30px;
}

.demo-dialog-close {
  display: grid;
  place-items: center;
  position: absolute;
  top: 15px;
  right: 15px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4b6380;
  font: 30px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.demo-dialog-close:hover {
  background: #f0f4f9;
  color: #2c4c7e;
}

.demo-dialog-header {
  padding-right: 25px;
  margin-bottom: 25px;
}

.demo-dialog-eyebrow {
  margin: 0 0 10px;
  color: #617895;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1.5;
}

.demo-dialog-header h2 {
  margin: 0;
  color: #2c4c7e;
  font-family: Rubik, Arial, Helvetica, sans-serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.6px;
}

.demo-dialog-header > p:last-child {
  max-width: 55ch;
  margin: 13px 0 0;
  color: #5a6c82;
  font-size: 14px;
  line-height: 1.65;
}

.demo-form-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.demo-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.demo-field {
  min-width: 0;
}

.demo-field-wide {
  grid-column: 1 / -1;
}

.demo-field label {
  display: block;
  margin-bottom: 7px;
  color: #314b6d;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

.demo-field input,
.demo-field select,
.demo-field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #b8c8dc;
  border-radius: 4px;
  background: #fff;
  color: #233d60;
  font: 16px/1.4 Arial, Helvetica, sans-serif;
  box-shadow: none;
}

.demo-field select {
  padding-right: 26px;
}

.demo-field textarea {
  min-height: 92px;
  resize: vertical;
}

.demo-field :is(input, select, textarea):focus {
  outline: 2px solid #2c4c7e;
  outline-offset: 2px;
  border-color: #2c4c7e;
}

.demo-field [aria-invalid="true"] {
  border-color: #9d3939;
}

.demo-field :disabled {
  background: #f4f6f9;
  color: #536b86;
}

.demo-field-error {
  margin: 7px 0 0;
  color: #8d3030;
  font-size: 13px;
  line-height: 1.5;
}

.demo-optional {
  margin-top: 23px;
  border-top: 1px solid #dce5ef;
  border-bottom: 1px solid #dce5ef;
}

.demo-optional > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding-block: 12px;
  color: #2c4c7e;
  font-size: 14px;
  line-height: 1.5;
  list-style: none;
  cursor: pointer;
}

.demo-optional > summary::marker,
.demo-optional > summary::-webkit-details-marker {
  display: none;
  content: '';
}

.demo-optional-note {
  color: #62758e;
}

.demo-optional-indicator {
  position: relative;
  width: 12px;
  height: 12px;
  flex: none;
}

.demo-optional-indicator::before,
.demo-optional-indicator::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 0;
  width: 12px;
  height: 1px;
  background: currentColor;
}

.demo-optional-indicator::after {
  transform: rotate(90deg);
}

.demo-optional[open] .demo-optional-indicator::after {
  transform: none;
}

.demo-optional-content {
  padding: 5px 0 20px;
}

.demo-form-purpose {
  margin: 18px 0;
  color: #627189;
  font-size: 13px;
  line-height: 1.65;
}

.demo-form-submit,
.demo-form-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 46px;
  padding: 12px 20px;
  border: 1px solid #2c4c7e;
  border-radius: 4px;
  background: #2c4c7e;
  color: #fff;
  font: 600 14px/1.5 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.demo-form-submit:hover:not(:disabled),
.demo-form-done:hover {
  background: #213e6a;
}

.demo-form-submit:disabled {
  border-color: #7287a6;
  background: #7287a6;
  cursor: wait;
}

.demo-form-submit-arrow {
  font-size: 19px;
  line-height: 1;
}

.demo-form-progress {
  margin: 11px 0 0;
  color: #526c8b;
  font-size: 13px;
  line-height: 1.5;
}

.demo-form-progress:empty {
  display: none;
}

.demo-form-feedback {
  margin: 0 0 17px;
  padding: 12px 14px;
  border-left: 2px solid #9d3939;
  background: #fbf5f4;
  color: #793333;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.demo-form-feedback[data-state="info"] {
  border-color: #6d88ac;
  background: #f2f6fb;
  color: #385779;
}

.demo-form-success {
  padding-top: 5px;
}

.demo-form-success h3 {
  margin: 0 0 15px;
  color: #2c4c7e;
  font-family: Rubik, Arial, Helvetica, sans-serif;
  font-size: 23px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.3px;
}

.demo-form-success p {
  margin: 0 0 17px;
  color: #536b85;
  font-size: 15px;
  line-height: 1.65;
}

.demo-form-success .demo-form-reference {
  margin-bottom: 24px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.demo-dialog :is(button, summary):focus-visible,
.demo-form-feedback:focus-visible {
  outline: 2px solid #2c4c7e;
  outline-offset: 4px;
}

.demo-dialog :is(h2, h3)[tabindex="-1"]:focus {
  outline: none;
}

.demo-visually-hidden,
.demo-form-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.demo-form-fallback {
  max-width: 60ch;
  margin: 18px auto;
  padding-inline: 22px;
  font: 14px/1.65 Arial, Helvetica, sans-serif;
}

.demo-action[data-demo-open]:not(:disabled) {
  background: #fff;
  color: #2c4c7e;
  cursor: pointer;
}

@media (max-width: 560px) {
  .demo-dialog { width: calc(100% - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 9px; scroll-padding-block: 18px; }
  .demo-dialog-inner { padding: 25px 20px 23px; }
  .demo-dialog-close { top: 7px; right: 7px; }
  .demo-dialog-header { margin-bottom: 21px; padding-right: 18px; }
  .demo-dialog-eyebrow { margin-bottom: 10px; font-size: 9px; }
  .demo-dialog-header h2 { font-size: 25px; line-height: 1.24; letter-spacing: -.5px; }
  .demo-dialog-header > p:last-child { margin-top: 11px; font-size: 13px; line-height: 1.6; }
  .demo-form-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .demo-field label { margin-bottom: 6px; font-size: 13px; }
  .demo-field input, .demo-field select, .demo-field textarea { padding: 9px 11px; }
  .demo-optional { margin-top: 19px; }
  .demo-optional > summary { min-height: 44px; font-size: 13px; }
  .demo-optional-content { padding-top: 5px; padding-bottom: 17px; }
  .demo-form-purpose { margin-block: 15px; font-size: 12px; line-height: 1.65; }
  .demo-form-submit { width: 100%; justify-content: space-between; padding-inline: 17px; }
  .demo-form-feedback { padding: 11px 12px; font-size: 13px; }
  .demo-form-success h3 { font-size: 22px; }
}

/* The dialog uses no entrance, progress or exit animation. */
@media (prefers-reduced-motion: reduce) {
  .demo-dialog { scroll-behavior: auto; }
}
