/* Submit company / Get in touch modals */

.pm-modal {
  --pm-blue: #0196FF;
  --pm-ink: #231F20;
  --pm-muted: rgba(35, 31, 32, 0.65);
  --pm-line: #D9DEE5;
  --pm-error: #D93025;
  --pm-ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 24px 16px;
  border: 0;
  background: transparent;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--pm-ink);
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.pm-modal[open] {
  display: flex;
}

.pm-modal [hidden] {
  display: none !important;
}

.pm-modal::backdrop {
  background: rgba(13, 20, 33, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.pm-modal.is-open,
.pm-modal.is-open::backdrop {
  opacity: 1;
}

.pm-modal__panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(13, 20, 33, 0.25);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.4s var(--pm-ease);
}

.pm-modal.is-open .pm-modal__panel {
  transform: none;
}

.pm-modal__body {
  padding: 48px;
}

.pm-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--pm-ink);
}

.pm-modal__close:hover {
  background: #F1F4F8;
}

.pm-modal__close:focus-visible {
  outline: 2px solid var(--pm-blue);
  outline-offset: 2px;
}

.pm-modal__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.pm-modal__title {
  margin-bottom: 8px;
  padding-right: 32px;
}

.pm-modal__intro {
  color: var(--pm-muted);
  margin-bottom: 28px;
  line-height: 28px;
}

/* Form */
.pm-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.pm-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.pm-field > span {
  font-size: 14px;
  font-weight: 600;
}

.pm-field > span em {
  font-style: normal;
  font-weight: 400;
  color: var(--pm-muted);
}

.pm-field small {
  font-size: 13px;
  line-height: 20px;
  color: var(--pm-muted);
}

.pm-field input,
.pm-field select,
.pm-field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming in on focus */
  color: var(--pm-ink);
  background: #fff;
  border: 1px solid var(--pm-line);
  border-radius: 12px;
  padding: 12px 16px;
  line-height: 24px;
  transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
}

.pm-field textarea {
  resize: vertical;
  min-height: 96px;
}

.pm-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23231F20' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
}

.pm-field select:invalid {
  color: rgba(35, 31, 32, 0.45);
}

.pm-field select option {
  color: var(--pm-ink);
}

.pm-field input::placeholder,
.pm-field textarea::placeholder {
  color: rgba(35, 31, 32, 0.4);
}

.pm-field input:focus,
.pm-field select:focus,
.pm-field textarea:focus {
  outline: none;
  border-color: var(--pm-blue);
  box-shadow: 0 0 0 3px rgba(1, 150, 255, 0.18);
}

/* Errors show only after a submit attempt */
.pm-form.was-submitted :is(input, select, textarea):invalid {
  border-color: var(--pm-error);
}

.pm-form.was-submitted :is(input, select, textarea):invalid:focus {
  box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.15);
}

.pm-form__error {
  color: var(--pm-error);
  font-size: 14px;
  line-height: 22px;
}

.pm-form__submit {
  align-self: flex-start;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}

.pm-form__submit:hover {
  background: #0086E6;
}

.pm-form__submit[disabled] {
  opacity: 0.6;
  cursor: wait;
}

/* Honeypot: hidden from people, visible to bots */
.pm-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Success state */
.pm-success {
  text-align: center;
  padding: 24px 0 8px;
  animation: pm-fade-up 0.4s var(--pm-ease);
}

.pm-success h2 {
  margin-bottom: 8px;
}

.pm-success p {
  color: var(--pm-muted);
  margin-bottom: 28px;
}

.pm-success .btn-style-2 {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

@keyframes pm-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

body.pm-modal-open {
  overflow: hidden;
}

/* Site button styles applied to <button> elements */
button.btn-style-1,
button.btn-style-2 {
  font: inherit;
  font-weight: 600;
  line-height: inherit;
  cursor: pointer;
}

button.btn-style-1 {
  border: 0;
}

/* Phones */
@media (max-width: 640px) {
  .pm-modal {
    padding: 16px;
  }

  .pm-modal__body {
    padding: 40px 24px 28px;
  }

  .pm-modal__title.heading-2 {
    font-size: 26px;
    line-height: 36px;
  }

  .pm-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pm-form__submit {
    align-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pm-modal,
  .pm-modal::backdrop,
  .pm-modal__panel {
    transition: none;
  }

  .pm-modal__panel {
    transform: none;
  }

  .pm-success {
    animation: none;
  }
}
