html:has(.mf-contact-dialog[open]) {
  overflow: hidden;
}

.mf-contact-dialog,
.mf-contact-dialog * {
  box-sizing: border-box;
}

.mf-contact-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  margin: auto;
  padding: 28px;
  border: 1px solid #c8d6e1;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(3, 16, 34, 0.38);
  color: #0a2448;
  font: inherit;
  overscroll-behavior: contain;
}

.mf-contact-dialog::backdrop {
  background: rgba(3, 16, 34, 0.78);
  backdrop-filter: blur(5px);
}

.mf-contact-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.mf-contact-heading h2 {
  margin: 0;
  color: #0a2448;
  font-size: clamp(1.75rem, 5vw, 2.15rem);
  line-height: 1.05;
}

.mf-contact-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #c8d6e1;
  border-radius: 50%;
  background: #eef5f8;
  color: #0a2448;
  font: inherit;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}

.mf-contact-intro {
  margin: 0 0 22px;
  color: #4d6882;
  line-height: 1.55;
}

.mf-contact-form {
  display: grid;
  gap: 15px;
}

.mf-contact-field {
  display: grid;
  gap: 7px;
  color: #0a2448;
  font-size: 0.82rem;
  font-weight: 800;
}

.mf-contact-field input,
.mf-contact-field select,
.mf-contact-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #9fb1c1;
  border-radius: 11px;
  background: #fff;
  color: #0a2448;
  font: inherit;
  font-size: 1rem;
}

.mf-contact-field textarea {
  min-height: 130px;
  resize: vertical;
}

.mf-contact-field input:focus,
.mf-contact-field select:focus,
.mf-contact-field textarea:focus {
  border-color: #1769aa;
  outline: 3px solid rgba(23, 105, 170, 0.18);
}

.mf-contact-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: #5d748b;
  font-size: 0.74rem;
}

.mf-contact-meta output {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.mf-contact-privacy,
.mf-contact-note {
  margin: 0;
  color: #4d6882;
  font-size: 0.82rem;
  line-height: 1.55;
}

.mf-contact-dialog a {
  color: #145d9a;
  font-weight: 750;
}

.mf-contact-note {
  padding: 12px 14px;
  border-left: 3px solid #f1cd28;
  background: #f4f8fa;
}

.mf-contact-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 2px;
}

.mf-contact-actions p {
  margin: 0;
  color: #4d6882;
  font-size: 0.78rem;
}

.mf-contact-actions button {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 21px;
  border: 0;
  border-radius: 999px;
  background: #f1cd28;
  color: #0a2448;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  cursor: pointer;
}

.mf-contact-actions button:not(:disabled):hover {
  background: #ffdf43;
}

.mf-contact-actions button:disabled {
  background: #d9e1e7;
  color: #6b7d8d;
  box-shadow: none;
  cursor: not-allowed;
}

@media (max-width: 560px) {
  .mf-contact-dialog {
    padding: 20px;
    border-radius: 18px;
  }

  .mf-contact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .mf-contact-actions button {
    width: 100%;
  }
}
