.tp-form-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.tp-form-main {
  flex: 1;
  padding: clamp(1.25rem, 5vw, 4.5rem) max(1rem, env(safe-area-inset-right)) clamp(2rem, 5vw, 4rem) max(1rem, env(safe-area-inset-left));
  background: #e3edeb;
}
.tp-form-card {
  --tp-ink: #192e32;
  --tp-muted: #425957;
  --tp-paper: #f8f6ec;
  --tp-line: #8a9d98;
  --tp-accent: #256372;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border-top: .34rem solid var(--tp-ink);
  background: var(--tp-paper);
  color: var(--tp-ink);
  font: 400 1rem/1.5 Montserrat, 'Avenir Next', Arial, sans-serif;
}
.tp-form-main > .tp-form-card {
  max-width: 38rem;
  margin-inline: auto;
  box-shadow: 0 .5rem 2.5rem #172a2e13;
}
.tp-form-card .tp-title {
  width: fit-content;
  margin: 0 0 .55rem;
  font: 600 clamp(1.8rem, 4vw, 2.45rem)/1.15 Montserrat, 'Avenir Next', Arial, sans-serif;
  letter-spacing: -.055em;
  color: var(--tp-ink);
}
.tp-form-card .tp-intro { margin: 0 0 1.4rem; max-width: 44ch; }
.tp-form-card .tp-fields { display: grid; gap: .9rem; margin: 0; }
.tp-form-card [hidden] { display: none !important; }
.tp-form-card label { display: grid; gap: .25rem; font-weight: 600; }
.tp-form-card .tp-optional { font-size: .875rem; font-weight: 400; color: var(--tp-muted); }
.tp-form-card input, .tp-form-card textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: .6rem .75rem;
  min-height: 2.75rem;
  border: 1px solid var(--tp-line);
  border-radius: .25rem;
  background: #fffef9;
  color: var(--tp-ink);
  font: 400 1rem/1.4 Montserrat, 'Avenir Next', Arial, sans-serif;
}
.tp-form-card textarea { min-height: 5rem; resize: vertical; }
.tp-form-card .tp-help { display: block; margin-top: .25rem; font-size: .875rem; color: var(--tp-muted); }
.tp-form-card .tp-send, .tp-form-card .tp-close {
  box-sizing: border-box;
  border: 0;
  min-height: 2.75rem;
  cursor: pointer;
  font: 600 1rem/1.3 Montserrat, 'Avenir Next', Arial, sans-serif;
}
.tp-form-card .tp-send {
  justify-self: start;
  padding: .65rem 1.25rem;
  margin-top: .15rem;
  border-radius: .15rem;
  color: white;
  background: #1b3639;
  box-shadow: .18rem .18rem 0 #cb6c53;
}
.tp-form-card .tp-send:hover { background: #284e52; }
.tp-form-card .tp-send:disabled { cursor: wait; opacity: .72; }
.tp-form-card .tp-close {
  position: absolute;
  top: .55rem;
  right: .55rem;
  min-width: 2.75rem;
  border-radius: 50%;
  background: transparent;
  color: var(--tp-ink);
  font-family: Arial, sans-serif;
  font-size: 1.7rem;
  font-weight: 400;
}
.tp-form-card .tp-close:hover { background: #e1e7df; }
.tp-form-card :is(button, input, textarea, a):focus-visible,
.tp-form-card .tp-status:focus-visible { outline: 3px solid var(--tp-accent); outline-offset: 3px; }
.tp-form-card .tp-status { margin: 1rem 0 0; color: var(--tp-ink); }
.tp-form-card .tp-status:empty { margin: 0; }
.tp-form-card .tp-status[data-state=error] { color: #852d25; }
.tp-form-card .tp-status[data-state=success] { padding: .85rem 1rem; background: #e1ecdf; }
.tp-form-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(36rem, calc(100% - 1.5rem));
  max-width: none;
  max-height: calc(100vh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: .28rem;
  box-shadow: 0 1.3rem 5rem #081b2666;
  background: #f8f6ec;
}
.tp-form-dialog:not([open]) { display: none; }
.tp-form-dialog::backdrop { background: #0e2229b8; }
.tp-form-dialog .tp-title { padding-right: 2rem; }
html.tp-dialog-open { overflow: hidden; }
