.er-contact-modal {
  --er-modal-navy: #123b61;
  --er-modal-navy-dark: #0d3152;
  --er-modal-blue: #255782;
  --er-modal-line: #dfe4e9;
  --er-modal-muted: #7e8791;
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .24s ease, visibility .24s ease;
}

.er-contact-modal[aria-hidden="false"] {
  visibility: visible;
  opacity: 1;
}

.er-contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 22, 30, .69);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.er-contact-modal__dialog {
  position: relative;
  width: min(1120px, 100%);
  min-height: 530px;
  max-height: calc(100svh - 64px);
  overflow: hidden;
  border-radius: 18px;
  color: #101820;
  background:
    radial-gradient(circle at 76% 18%, rgba(31, 84, 126, .05), transparent 32%),
    #f9f9f8;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .34);
  transform: translateY(20px) scale(.985);
  transition: transform .28s cubic-bezier(.2, .72, .2, 1);
}

.er-contact-modal[aria-hidden="false"] .er-contact-modal__dialog {
  transform: translateY(0) scale(1);
}

.er-contact-modal__close {
  position: absolute;
  z-index: 4;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #737b82;
  background: transparent;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.er-contact-modal__close::before,
.er-contact-modal__close::after {
  content: "";
  position: absolute;
  top: 23px;
  left: 11px;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.er-contact-modal__close::before { transform: rotate(45deg); }
.er-contact-modal__close::after { transform: rotate(-45deg); }
.er-contact-modal__close:hover,
.er-contact-modal__close:focus-visible { color: #172c3f; background: rgba(18, 59, 97, .08); transform: rotate(4deg); }

.er-contact-modal__content {
  position: relative;
  z-index: 2;
  width: 64%;
  min-height: 530px;
  padding: 72px 50px 62px 70px;
}

.er-contact-modal__eyebrow {
  margin: 0 0 14px;
  color: #222b33;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.er-contact-modal__title {
  max-width: 650px;
  margin: 0 0 34px;
  font-size: clamp(32px, 3.1vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.025em;
}

.er-contact-modal__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.er-contact-modal__field {
  width: 100%;
  height: 58px;
  padding: 0 20px;
  border: 1px solid var(--er-modal-line);
  border-radius: 3px;
  color: #16283a;
  background: #fff;
  box-shadow: 0 4px 16px rgba(27, 46, 62, .05);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.er-contact-modal__field::placeholder { color: #979fa7; opacity: 1; }
.er-contact-modal__field:hover { border-color: #bcc8d2; }
.er-contact-modal__field:focus { border-color: var(--er-modal-blue); box-shadow: 0 0 0 3px rgba(37, 87, 130, .13); }

.er-contact-modal__policy {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 27px 0 24px;
  color: #727b84;
  font-size: 15px;
  line-height: 1.45;
  cursor: pointer;
}

.er-contact-modal__policy input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.er-contact-modal__check {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin-top: -1px;
  border: 2px solid #2d64a6;
  background: #fff;
  transition: background .2s ease, box-shadow .2s ease;
}

.er-contact-modal__policy input:checked + .er-contact-modal__check {
  background-color: var(--er-modal-blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='m5 12 4 4 10-10'/%3E%3C/svg%3E");
}

.er-contact-modal__policy input:focus-visible + .er-contact-modal__check { box-shadow: 0 0 0 3px rgba(37, 87, 130, .18); }
.er-contact-modal__policy a { color: #163f72; text-decoration: none; border-bottom: 1px solid rgba(22, 63, 114, .35); }
.er-contact-modal__policy a:hover { border-color: currentColor; }

.er-contact-modal__submit {
  position: relative;
  min-width: 280px;
  min-height: 58px;
  padding: 0 28px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: linear-gradient(115deg, var(--er-modal-navy), var(--er-modal-blue));
  box-shadow: 0 12px 28px rgba(18, 59, 97, .18);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.er-contact-modal__submit:hover,
.er-contact-modal__submit:focus-visible { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(18, 59, 97, .26); filter: saturate(1.08); }
.er-contact-modal__submit:disabled { cursor: wait; opacity: .82; transform: none; }
.er-contact-modal__submit.is-loading { padding-left: 52px; }
.er-contact-modal__submit.is-loading::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: er-modal-spin .75s linear infinite;
}

.er-contact-modal__status {
  min-height: 24px;
  margin-top: 15px;
  font-size: 14px;
  line-height: 1.4;
}
.er-contact-modal__status.is-success { color: #17723d; }
.er-contact-modal__status.is-error { color: #b3203a; }

.er-contact-modal__visual {
  position: absolute;
  z-index: 1;
  top: 0;
  right: -18px;
  width: 43%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.er-contact-modal__visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f9f9f8 0%, rgba(249,249,248,.6) 15%, transparent 40%);
}

.er-contact-modal__visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
}

body.er-contact-modal-open { overflow: hidden !important; }

@keyframes er-modal-spin { to { transform: rotate(360deg); } }

@media (max-width: 850px) {
  .er-contact-modal { padding: 18px; }
  .er-contact-modal__dialog { width: min(620px, 100%); max-height: calc(100svh - 36px); overflow-y: auto; }
  .er-contact-modal__content { width: 100%; min-height: 0; padding: 64px 48px 20px; }
  .er-contact-modal__visual { position: relative; right: auto; width: 100%; height: 260px; }
  .er-contact-modal__visual::before { background: linear-gradient(180deg, #f9f9f8 0%, transparent 34%); }
  .er-contact-modal__visual img { object-position: center bottom; }
}

@media (max-width: 560px) {
  .er-contact-modal { padding: 12px; }
  .er-contact-modal__dialog { max-height: calc(100svh - 24px); border-radius: 16px; }
  .er-contact-modal__close { top: 14px; right: 12px; }
  .er-contact-modal__content { padding: 58px 24px 12px; }
  .er-contact-modal__eyebrow { margin-bottom: 13px; font-size: 13px; }
  .er-contact-modal__title { margin-bottom: 27px; font-size: clamp(30px, 9vw, 38px); }
  .er-contact-modal__fields { grid-template-columns: 1fr; gap: 13px; }
  .er-contact-modal__field { height: 56px; }
  .er-contact-modal__policy { margin: 23px 0 22px; font-size: 14px; }
  .er-contact-modal__submit { width: 100%; min-width: 0; min-height: 56px; font-size: 15px; }
  .er-contact-modal__visual { height: 245px; }
}

@media (max-height: 720px) and (min-width: 851px) {
  .er-contact-modal__dialog, .er-contact-modal__content { min-height: 480px; }
  .er-contact-modal__content { padding-top: 50px; padding-bottom: 42px; }
  .er-contact-modal__title { margin-bottom: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  .er-contact-modal,
  .er-contact-modal__dialog,
  .er-contact-modal__close,
  .er-contact-modal__field,
  .er-contact-modal__submit { transition: none !important; }
  .er-contact-modal__submit.is-loading::before { animation-duration: 1.5s; }
}
