:root {
  --modal-blue: #171b83;
  --modal-green: #53cf5d;
  --modal-line: rgba(255, 255, 255, 0.88);
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 46px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.success-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 46px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.contact-modal:target,
.success-modal:target {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(23, 27, 131, 0.82), rgba(23, 27, 131, 0.88)),
    url("assets/icons/BG.png") center / cover fixed;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  border: 1px solid var(--modal-line);
  background: var(--modal-blue) url("assets/icons/BG.png") center / cover;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.modal-panel::before {
  content: "";
  position: absolute;
  right: -82px;
  bottom: -110px;
  width: clamp(260px, 30vw, 460px);
  height: clamp(190px, 24vw, 330px);
  background: url("assets/icons/Layer 19@2x.png") right bottom / contain no-repeat;
  pointer-events: none;
  opacity: 0.95;
}

.modal-brand {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: clamp(30px, 5vw, 56px);
  border-right: 1px solid var(--modal-line);
}

.modal-brand::before {
  content: "";
  position: absolute;
  left: -110px;
  top: -74px;
  width: clamp(260px, 26vw, 390px);
  height: clamp(180px, 20vw, 280px);
  background: url("assets/icons/Layer 18@2x.png") left top / contain no-repeat;
  pointer-events: none;
}

.modal-brand img {
  position: relative;
  width: min(280px, 72%);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--modal-line);
  color: #fff;
  font: 34px/1 Arial, Helvetica, sans-serif;
  text-decoration: none;
  background: rgba(23, 27, 131, 0.78);
  transition: background 180ms ease, transform 180ms ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: rgba(83, 207, 93, 0.22);
  transform: scale(1.06);
  outline: none;
}

.modal-form {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 18px;
  padding: clamp(30px, 5vw, 58px);
}

.modal-form h2 {
  margin: 0 0 4px;
  color: var(--modal-green);
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}

.modal-intro {
  margin: -4px 0 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.45;
}

.modal-form label {
  display: grid;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0;
}

.modal-form span {
  color: rgba(255, 255, 255, 0.86);
}

.modal-form strong,
.interest-group strong {
  color: var(--modal-green);
  font-weight: 700;
}

.modal-form input,
.modal-form textarea {
  width: 100%;
  border: 1px solid var(--modal-line);
  border-radius: 0;
  padding: 13px 14px;
  color: #fff;
  background: rgba(23, 27, 131, 0.54);
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.modal-form textarea {
  resize: vertical;
  min-height: 132px;
}

.modal-form input:focus,
.modal-form textarea:focus {
  border-color: var(--modal-green);
  background: rgba(23, 27, 131, 0.76);
  box-shadow: 0 0 0 3px rgba(83, 207, 93, 0.22);
}

.interest-group {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--modal-line);
  color: #fff;
  background: rgba(23, 27, 131, 0.38);
}

.interest-group legend {
  padding: 0 8px;
  color: #fff;
  font-size: 14px;
}

.interest-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.interest-group input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--modal-green);
  cursor: pointer;
}

.interest-group span {
  color: rgba(255, 255, 255, 0.9);
}

.modal-form button {
  justify-self: start;
  border: 0;
  padding: 13px 26px;
  color: var(--modal-blue);
  background: var(--modal-green);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: filter 180ms ease, transform 180ms ease;
}

.modal-form button:disabled {
  cursor: wait;
  filter: saturate(0.7);
  opacity: 0.72;
}

.modal-form button:hover,
.modal-form button:focus-visible {
  filter: brightness(1.12);
  transform: translateY(-2px);
  outline: none;
}

.form-status {
  min-height: 20px;
  margin: -4px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  line-height: 1.4;
}

.form-status[data-type="error"] {
  color: #ffd6d6;
}

.form-status:empty {
  display: none;
}

.success-panel {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: clamp(34px, 6vw, 64px);
  border: 1px solid var(--modal-line);
  color: #fff;
  text-align: center;
  background: var(--modal-blue) url("assets/icons/BG.png") center / cover;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.success-panel::before,
.success-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.success-panel::before {
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(255, 255, 255, 0.28) 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, rgba(255, 255, 255, 0.28) 50%, transparent 50.2%);
  opacity: 0.5;
}

.success-panel::after {
  right: -110px;
  bottom: -130px;
  width: 360px;
  height: 260px;
  background: url("assets/icons/Layer 19@2x.png") right bottom / contain no-repeat;
}

.success-panel > :not(.modal-close) {
  position: relative;
  z-index: 1;
}

.success-panel .modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  left: auto;
  z-index: 3;
}

.success-panel img {
  width: min(280px, 72vw);
}

.success-mark {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 1px solid var(--modal-green);
  color: var(--modal-blue);
  background: var(--modal-green);
  font-size: 44px;
  font-weight: 700;
  box-shadow: 0 0 34px rgba(83, 207, 93, 0.5);
  animation: successPulse 2.4s ease-in-out infinite;
}

.success-panel h2 {
  margin: 0;
  color: var(--modal-green);
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1;
}

.success-panel p {
  max-width: 460px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.5;
}

.success-action {
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  padding: 0 24px;
  color: var(--modal-blue);
  background: var(--modal-green);
  font-weight: 700;
  text-decoration: none;
  transition: filter 180ms ease, transform 180ms ease;
}

.success-action:hover,
.success-action:focus-visible {
  filter: brightness(1.12);
  transform: translateY(-2px);
  outline: none;
}

@keyframes successPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@media (max-width: 760px) {
  .contact-modal {
    align-items: start;
    overflow-y: auto;
  }

  .modal-panel {
    grid-template-columns: 1fr;
  }

  .modal-brand {
    min-height: 150px;
    border-right: 0;
    border-bottom: 1px solid var(--modal-line);
  }

  .modal-brand img {
    width: min(270px, 72vw);
  }

  .interest-group {
    padding: 16px;
  }
}
