.ftf-dialog-open {
  overflow: hidden;
}

.ftf-dialog {
  --ftf-ink: #27133f;
  --ftf-soft: #625a6b;
  --ftf-rule: #dfd9df;
  --ftf-purple: #34145a;
  --ftf-teal: #006b64;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(38rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid #ddd1e2;
  border-radius: 1.3rem;
  background: #fffdfa;
  color: var(--ftf-ink);
  box-shadow: 0 1.8rem 5.5rem #130b2140;
  overflow: auto;
  overscroll-behavior: contain;
  font: inherit;
  text-align: start;
  line-height: 1.65;
}

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

.ftf-dialog [hidden] {
  display: none !important;
}

.ftf-dialog::backdrop {
  background: rgb(25 9 47 / 70%);
}

.ftf-dialog__panel {
  padding: clamp(1.2rem, 4vw, 2.3rem);
}

.ftf-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.ftf-dialog__header h2 {
  margin: 0;
  color: var(--ftf-ink);
  font: inherit;
  font-size: clamp(1.55rem, 4.5vw, 2.05rem);
  font-weight: 700;
  line-height: 1.45;
}

.ftf-dialog__header h2:focus,
.ftf-success h3:focus {
  outline: none;
}

.ftf-dialog__close {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 2.75rem;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ftf-rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ftf-ink);
  cursor: pointer;
}

.ftf-dialog__close:hover,
.ftf-action--secondary:hover {
  background: #efe9f2;
}

.ftf-dialog__intro {
  margin: 0.45rem 0 1rem;
  color: var(--ftf-soft);
  font-size: 1rem;
}

.ftf-dialog__event {
  margin: 0.3rem 0 1.15rem;
  padding: 0.55rem 0.8rem;
  border-inline-start: 3px solid #51aaa1;
  background: #edf5f1;
  color: #214f4b;
  font-size: 0.88rem;
}

.ftf-form {
  display: grid;
  gap: 0.95rem;
  margin: 0;
}

.ftf-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.ftf-form label {
  display: block;
  color: var(--ftf-ink);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 600;
}

.ftf-form small {
  color: var(--ftf-soft);
  font-size: 0.81rem;
  font-weight: 400;
}

.ftf-form :is(input:not([type="checkbox"]), select) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.85rem;
  margin: 0.3rem 0 0;
  padding: 0.52rem 0.7rem;
  border: 1px solid #c6becb;
  border-radius: 0.5rem;
  background: white;
  color: var(--ftf-ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
}

.ftf-form select {
  appearance: auto;
}

.ftf-form input::placeholder {
  color: #736e78;
  opacity: 1;
}

.ftf-dialog :is(input, select, button, summary):focus-visible {
  outline: 3px solid var(--ftf-teal);
  outline-offset: 3px;
}

.ftf-form__options {
  display: grid;
  gap: 0.6rem;
  padding-block: 0.25rem;
}

.ftf-form__options label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-weight: 400;
  cursor: pointer;
}

.ftf-form input[type="checkbox"] {
  width: 1.13rem;
  height: 1.13rem;
  flex: 0 0 1.13rem;
  margin: 0.27rem 0 0;
  appearance: auto;
  accent-color: var(--ftf-teal);
  cursor: pointer;
}

.ftf-form__note {
  margin: 0.15rem 0 0;
  color: var(--ftf-soft);
  font-size: 0.83rem;
}

.ftf-link-option {
  border-block: 1px solid var(--ftf-rule);
}

.ftf-link-option summary {
  display: flex;
  align-items: center;
  gap: .3rem;
  min-height: 44px;
  padding-block: .65rem;
  color: var(--ftf-teal);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}

.ftf-link-option summary::after {
  content: "";
  width: .48rem;
  height: .48rem;
  flex: none;
  margin-inline: auto .3rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.ftf-link-option[open] summary::after {
  transform: rotate(225deg);
}

.ftf-link-option[open] {
  padding-bottom: .65rem;
}

.ftf-field-error {
  margin: .3rem 0 0;
  color: #8e313b;
  font-size: .83rem;
}

.ftf-form [aria-invalid="true"] {
  border-color: #a03e48;
}

.ftf-preview {
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--ftf-rule);
  border-inline-start: 3px solid #49a79e;
  border-radius: 0.55rem;
  background: #f6f4ef;
}

.ftf-preview h3 {
  margin: 0 0 0.5rem;
  color: var(--ftf-teal);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
}

.ftf-preview p {
  margin: 0;
  color: var(--ftf-ink);
  overflow-wrap: anywhere;
  white-space: pre-line;
  font-size: 0.93rem;
}

.ftf-form__feedback {
  margin: 0;
  color: var(--ftf-teal);
  font-size: 0.91rem;
  font-weight: 600;
}

.ftf-form__feedback:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.ftf-form__feedback--error {
  color: #8e313b;
}

.ftf-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.ftf-action {
  display: inline-flex;
  min-height: 2.85rem;
  justify-self: start;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.3rem;
  border: 1px solid var(--ftf-purple);
  border-radius: 999px;
  background: var(--ftf-purple);
  color: white;
  font: inherit;
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.6;
  cursor: pointer;
}

.ftf-action:hover {
  background: #24103b;
}

.ftf-action:disabled {
  opacity: 0.65;
  cursor: wait;
}

.ftf-action--secondary {
  border-color: var(--ftf-rule);
  background: transparent;
  color: var(--ftf-purple);
}

.ftf-action.ftf-action--secondary:hover {
  background: #efe9f2;
}

.ftf-success {
  padding-block: 0.5rem;
}

.ftf-success__mark {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 50%;
  background: #d9f0e8;
  color: var(--ftf-teal);
  font-size: 1.4rem;
}

.ftf-success h3 {
  margin: 0.7rem 0 0.2rem;
  font-size: 1.35rem;
}

.ftf-success p {
  margin: 0 0 1.2rem;
  color: var(--ftf-soft);
}

@media (max-width: 35rem) {
  .ftf-dialog {
    width: calc(100% - 1rem);
    max-height: calc(100dvh - 1rem);
  }
  .ftf-form__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: .65rem;
  }
  .ftf-form {
    gap: .8rem;
  }
  .ftf-dialog__panel {
    padding: 1rem;
  }
  .ftf-dialog__event {
    margin-block: .25rem .85rem;
  }
  .ftf-form[data-registration] > .ftf-action {
    justify-self: stretch;
  }
  .ftf-dialog :is(input, select, summary, button) {
    scroll-margin-block: 1rem;
  }
  .ftf-form__actions .ftf-action {
    flex: 1 1 auto;
  }
}
