/* Custom visual treatment; the native dialog supplies top-layer and focus semantics. */
.urovo-webform-modal {
  width: min(800px, calc(100% - 64px));
  max-width: none;
  max-height: min(880px, calc(100dvh - 64px));
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  box-shadow: 0 24px 100px
    color-mix(in srgb, var(--foreground) 24%, transparent);
  overflow: hidden;
}
.urovo-webform-modal::backdrop {
  background: color-mix(in srgb, var(--foreground) 48%, transparent);
  backdrop-filter: blur(6px);
}
.urovo-webform-modal[open] {
  animation: urovo-form-enter 180ms ease-out;
}
.urovo-webform-modal__panel {
  display: flex;
  flex-direction: column;
  max-height: min(878px, calc(100dvh - 66px));
}
.urovo-webform-modal__header {
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 40px 24px;
  border-bottom: 1px solid var(--border);
}
.urovo-webform-modal h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.035em;
}
.urovo-webform-modal h2:focus {
  outline: none;
}
.urovo-webform-modal__close {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -8px -12px 0 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--background);
  color: var(--foreground);
  cursor: pointer;
}
.urovo-webform-modal__close:hover {
  background: var(--accent);
}
.urovo-webform-modal :is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.urovo-webform-modal__body {
  padding: 24px 40px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  min-height: 0;
}
.urovo-webform-modal__status:empty {
  display: none;
}
.urovo-webform-modal__status {
  display: grid;
  justify-items: start;
  gap: 16px;
  padding-block: 24px;
  font-size: 14px;
}
.urovo-webform-modal__status a {
  text-decoration: underline;
}
.urovo-webform-modal__retry {
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
}
.urovo-webform-modal .webform-submission-form {
  gap: 20px;
}
.urovo-webform-modal .form-item {
  margin: 0;
}
.urovo-webform-modal .form-item label,
.urovo-webform-modal .fieldset-legend {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
.urovo-webform-modal
  :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not(
        [type="hidden"]
      ),
    select,
    textarea
  ) {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
}
.urovo-webform-modal textarea {
  min-height: 112px;
  resize: vertical;
}
.urovo-webform-modal .description {
  font-size: 12px;
  line-height: 1.5;
}
.urovo-webform-modal .form-type-checkbox label {
  display: inline;
}
.urovo-webform-modal .form-type-checkbox input {
  flex: none;
  accent-color: var(--primary);
}
.urovo-webform-modal .captcha {
  margin-block: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.urovo-webform-modal .captcha img {
  max-width: 100%;
}
.urovo-webform-modal .form-actions {
  margin: 16px 0 0;
}
.urovo-webform-modal .webform-confirmation {
  padding-block: 24px;
}
/* Theme notifications normally float at the viewport bottom. Keep validation
 * feedback in the form flow so it cannot cover mobile controls. */
.urovo-webform-modal [data-drupal-messages] {
  position: static;
  max-width: none;
  margin-block: 0 20px;
  padding: 0;
}
@keyframes urovo-form-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 600px) {
  .urovo-webform-modal {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .urovo-webform-modal__panel {
    height: 100%;
    max-height: 100%;
  }
  .urovo-webform-modal__header {
    padding: max(24px, env(safe-area-inset-top)) 24px 20px;
    gap: 16px;
  }
  .urovo-webform-modal__body {
    padding: 24px 24px max(24px, env(safe-area-inset-bottom));
  }
  .urovo-webform-modal__close {
    margin-right: 0;
  }
  .urovo-webform-modal .form-actions .urovo-button {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .urovo-webform-modal[open] {
    animation: none;
  }
}
