:root {
  --opc-flow-blue: #0052d9;
  --opc-flow-blue-hover: #003cab;
  --opc-flow-text: #17233d;
  --opc-flow-muted: #5f6f89;
  --opc-flow-border: #d9e1ec;
  --opc-flow-surface: #ffffff;
  --opc-flow-subtle: #f5f7fa;
  --opc-flow-danger: #c62828;
}

body.opc-flow-lock {
  overflow: hidden;
  overscroll-behavior: none;
}

.opc-flow-dialog {
  width: min(960px, calc(100vw - 48px));
  max-width: none;
  max-height: min(900px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--opc-flow-text);
  background: var(--opc-flow-surface);
  border: 1px solid var(--opc-flow-border);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgb(20 39 74 / 24%);
}

.opc-flow-dialog[open] {
  display: grid;
}

.opc-flow-dialog::backdrop {
  background: rgb(8 18 38 / 58%);
  backdrop-filter: blur(2px);
}

.opc-flow-dialog__shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: inherit;
  min-height: min(680px, calc(100dvh - 48px));
}

.opc-flow-dialog__header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px 18px;
  background: #fff;
  border-bottom: 1px solid var(--opc-flow-border);
}

.opc-flow-dialog__heading {
  min-width: 0;
}

.opc-flow-dialog__kicker {
  margin: 0 0 6px;
  color: var(--opc-flow-blue);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.opc-flow-dialog__title {
  margin: 0;
  color: var(--opc-flow-text);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 650;
  line-height: 1.25;
}

.opc-flow-dialog__description {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--opc-flow-muted);
  font-size: 14px;
  line-height: 1.65;
}

.opc-flow-dialog__close,
.opc-flow-button {
  min-height: 44px;
  padding: 0 20px;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  background: var(--opc-flow-blue);
  border: 1px solid var(--opc-flow-blue);
  border-radius: 4px;
  cursor: pointer;
}

.opc-flow-dialog__close {
  flex: 0 0 auto;
  min-width: 64px;
  color: var(--opc-flow-text);
  background: #fff;
  border-color: var(--opc-flow-border);
}

.opc-flow-dialog__close:hover,
.opc-flow-button--secondary:hover {
  color: var(--opc-flow-blue);
  border-color: var(--opc-flow-blue);
}

.opc-flow-button:hover {
  background: var(--opc-flow-blue-hover);
  border-color: var(--opc-flow-blue-hover);
}

.opc-flow-button--secondary {
  color: var(--opc-flow-text);
  background: #fff;
  border-color: var(--opc-flow-border);
}

.opc-flow-dialog__close:focus-visible,
.opc-flow-button:focus-visible,
.opc-flow-field input:focus-visible,
.opc-flow-field select:focus-visible,
.opc-flow-field textarea:focus-visible,
.opc-flow-dialog__frame:focus-visible {
  outline: 3px solid rgb(0 82 217 / 24%);
  outline-offset: 2px;
}

.opc-flow-dialog__body {
  min-height: 0;
  overflow: auto;
  background: var(--opc-flow-subtle);
}

.opc-flow-dialog__body--form {
  padding: 24px 26px 28px;
}

.opc-flow-dialog__body--route {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
}

.opc-flow-dialog__progress {
  margin: 0 0 14px;
  color: var(--opc-flow-blue);
  font-size: 13px;
  font-weight: 600;
}

.opc-flow-form__notice {
  margin: 0 0 20px;
  padding: 12px 14px;
  color: #3d4f6c;
  font-size: 13px;
  line-height: 1.6;
  background: #eef4ff;
  border-left: 3px solid var(--opc-flow-blue);
}

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

.opc-flow-field {
  min-width: 0;
}

.opc-flow-field--full {
  grid-column: 1 / -1;
}

.opc-flow-field > label {
  display: block;
  margin-bottom: 7px;
  color: #263652;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.opc-flow-field input,
.opc-flow-field select,
.opc-flow-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--opc-flow-text);
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  background: #fff;
  border: 1px solid #b8c4d6;
  border-radius: 4px;
}

.opc-flow-field textarea {
  min-height: 118px;
  resize: vertical;
}

.opc-flow-field input[readonly] {
  color: #44536b;
  background: #edf1f7;
}

.opc-flow-field input:hover,
.opc-flow-field select:hover,
.opc-flow-field textarea:hover {
  border-color: #7e8da6;
}

.opc-flow-field input:focus,
.opc-flow-field select:focus,
.opc-flow-field textarea:focus {
  border-color: var(--opc-flow-blue);
}

.opc-flow-field input[aria-invalid="true"],
.opc-flow-field select[aria-invalid="true"],
.opc-flow-field textarea[aria-invalid="true"] {
  border-color: var(--opc-flow-danger);
}

.opc-flow-field--check {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--opc-flow-border);
  border-radius: 4px;
}

.opc-flow-field--check > label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

.opc-flow-field--check input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  accent-color: var(--opc-flow-blue);
}

.opc-flow-field__help {
  display: block;
  margin-top: 6px;
  color: var(--opc-flow-muted);
  font-size: 12px;
  line-height: 1.55;
}

.opc-flow-field__error {
  margin: 6px 0 0;
  color: var(--opc-flow-danger);
  font-size: 12px;
  line-height: 1.5;
}

.opc-flow-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--opc-flow-border);
}

.opc-flow-confirmation__title,
.opc-flow-result__title {
  margin: 0;
  color: var(--opc-flow-text);
  font-size: 24px;
  line-height: 1.35;
}

.opc-flow-confirmation__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 20px 0 0;
  overflow: hidden;
  background: var(--opc-flow-border);
  border: 1px solid var(--opc-flow-border);
  border-radius: 6px;
}

.opc-flow-confirmation__summary > div {
  min-width: 0;
  padding: 14px 16px;
  background: #fff;
}

.opc-flow-confirmation__summary dt {
  margin: 0 0 5px;
  color: var(--opc-flow-muted);
  font-size: 12px;
}

.opc-flow-confirmation__summary dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--opc-flow-text);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.opc-flow-confirmation__boundary,
.opc-flow-result__note {
  margin: 18px 0 0;
  padding: 13px 15px;
  color: #3d4f6c;
  font-size: 13px;
  line-height: 1.6;
  background: #eef4ff;
  border-left: 3px solid var(--opc-flow-blue);
}

.opc-flow-result {
  max-width: 680px;
  margin: 36px auto;
  padding: 34px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--opc-flow-border);
  border-radius: 8px;
}

.opc-flow-result__status {
  display: inline-flex;
  margin: 0 0 14px;
  padding: 5px 10px;
  color: #137333;
  font-size: 12px;
  font-weight: 600;
  background: #eaf7ee;
  border-radius: 2px;
}

.opc-flow-result__copy {
  margin: 14px 0 0;
  color: var(--opc-flow-muted);
  font-size: 14px;
  line-height: 1.75;
}

.opc-flow-result__reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 0;
  padding: 13px 15px;
  text-align: left;
  background: var(--opc-flow-subtle);
  border: 1px solid var(--opc-flow-border);
  border-radius: 4px;
}

.opc-flow-result__reference strong {
  color: var(--opc-flow-muted);
  font-size: 13px;
  font-weight: 500;
}

.opc-flow-result__reference span {
  overflow-wrap: anywhere;
  color: var(--opc-flow-text);
  font-size: 14px;
  font-weight: 650;
}

.opc-flow-result__note {
  text-align: left;
}

.opc-flow-dialog__route-note {
  margin: 0;
  padding: 10px 18px;
  color: #3d4f6c;
  font-size: 12px;
  line-height: 1.5;
  background: #eef4ff;
  border-bottom: 1px solid #dce7f7;
}

.opc-flow-dialog__loading {
  margin: 0;
  padding: 10px 18px;
  color: var(--opc-flow-muted);
  font-size: 13px;
  border-bottom: 1px solid var(--opc-flow-border);
}

.opc-flow-dialog__frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 560px;
  background: var(--opc-flow-subtle);
  border: 0;
}

body.opc-flow-embed {
  min-width: 0;
  background: var(--opc-flow-subtle);
}

.opc-flow-embed .opc-secondary-header,
.opc-flow-embed .opc-secondary-hero,
.opc-flow-embed .opc-secondary-footer,
.opc-flow-embed .opc-footer,
.opc-flow-embed .opc-mobile-dock,
.opc-flow-embed .opc-reading-progress,
.opc-flow-embed .tcwf-skip-link {
  display: none !important;
}

.opc-flow-embed .opc-secondary-page,
.opc-flow-embed .opc-product-page {
  min-height: 0;
  padding-top: 0 !important;
}

.opc-flow-embed #main-content {
  min-height: 0;
}

.opc-flow-embed #main-content > .tcwf-section {
  padding-block: 24px;
}

.opc-flow-embed #main-content > .tcwf-section > .tcwf-section__inner {
  width: min(1120px, calc(100% - 32px));
}

@media (max-width: 720px) {
  .opc-flow-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 8px;
  }

  .opc-flow-dialog__shell {
    min-height: calc(100dvh - 20px);
  }

  .opc-flow-dialog__header {
    gap: 14px;
    padding: 18px 16px 14px;
  }

  .opc-flow-dialog__description {
    font-size: 13px;
  }

  .opc-flow-dialog__close {
    min-width: 58px;
    padding-inline: 14px;
  }

  .opc-flow-dialog__body--form {
    padding: 20px 16px 24px;
  }

  .opc-flow-form__grid,
  .opc-flow-confirmation__summary {
    grid-template-columns: 1fr;
  }

  .opc-flow-dialog__actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .opc-flow-button {
    width: 100%;
  }

  .opc-flow-result {
    margin: 10px auto;
    padding: 24px 18px;
  }

  .opc-flow-dialog__frame {
    min-height: 500px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .opc-flow-dialog *,
  .opc-flow-dialog *::before,
  .opc-flow-dialog *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
