.contact-modal-overlay {
  --contact-ink: #0f1313;
  --contact-text: #42474d;
  --contact-muted: #777e82;
  --contact-line: #e4e6e8;
  --contact-coral: #ea7f53;
  --contact-coral-soft: rgba(234, 127, 83, 0.1);
  --contact-error: #d94b4b;
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 19, 19, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.contact-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.contact-modal {
  width: min(536px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  border-radius: 16px;
  background: #fff;
  color: var(--contact-ink);
  box-shadow: 0 24px 80px rgba(15, 19, 19, 0.18);
  opacity: 0.98;
  transform: translateY(10px) scale(0.985);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
  overscroll-behavior: contain;
}

.contact-modal-overlay.is-open .contact-modal {
  opacity: 1;
  transform: none;
}

.contact-modal *,
.contact-modal *::before,
.contact-modal *::after {
  box-sizing: border-box;
}

.contact-modal button,
.contact-modal input,
.contact-modal textarea {
  font: inherit;
}

.contact-modal button {
  cursor: pointer;
}

.contact-modal-inner {
  position: relative;
  padding: 32px;
}

.contact-modal-close {
  position: absolute;
  top: 22px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #60676b;
  font-size: 24px;
  line-height: 1;
}

.contact-modal-close:hover {
  background: #f4f5f6;
  color: var(--contact-ink);
}

.contact-modal-close:focus-visible,
.contact-modal-done:focus-visible {
  outline: 2px solid var(--contact-coral);
  outline-offset: 2px;
}

.contact-modal-head {
  margin-bottom: 26px;
  padding-right: 40px;
}

.contact-modal-title {
  margin: 0 0 6px;
  color: var(--contact-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
}

.contact-modal-subtitle {
  margin: 0;
  color: var(--contact-muted);
  font-size: 14px;
  line-height: 1.7;
}

.contact-form-grid {
  display: grid;
  gap: 18px;
}

.contact-field {
  min-width: 0;
}

.contact-field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 8px;
  color: #555c60;
  font-size: 14px;
  font-weight: 500;
}

.contact-required {
  color: var(--contact-error);
}

.contact-control {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--contact-line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--contact-ink);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.contact-control::placeholder {
  color: #a4aaae;
}

.contact-control:hover:not(:disabled) {
  border-color: #c8cdd0;
}

.contact-control:focus {
  border-color: var(--contact-coral);
  box-shadow: 0 0 0 3px var(--contact-coral-soft);
}

.contact-control[aria-invalid="true"] {
  border-color: var(--contact-error);
  box-shadow: 0 0 0 3px rgba(217, 75, 75, 0.08);
}

.contact-control:disabled {
  background: #f7f8f8;
  color: #999;
  cursor: not-allowed;
}

.contact-error {
  min-height: 16px;
  margin-top: 6px;
  color: var(--contact-error);
  font-size: 12px;
  line-height: 1.35;
}

.contact-select {
  position: relative;
}

.contact-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.contact-select-value.is-placeholder {
  color: #a4aaae;
}

.contact-select-chevron {
  width: 8px;
  height: 8px;
  flex: none;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: #62696d;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 180ms ease;
}

.contact-select.is-open .contact-select-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.contact-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  padding: 6px;
  border: 1px solid #eceeef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 19, 19, 0.13);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.contact-select.is-open .contact-select-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.contact-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #333a3e;
  font-size: 14px;
  text-align: left;
}

.contact-select-option:hover,
.contact-select-option[data-highlighted="true"] {
  background: #faf7f5;
}

.contact-select-option[aria-selected="true"] {
  color: var(--contact-coral);
  font-weight: 600;
}

.contact-select-check {
  position: relative;
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0;
}

.contact-select-option[aria-selected="true"] .contact-select-check {
  opacity: 1;
}

.contact-select-check::before {
  position: absolute;
  top: 3px;
  left: 2px;
  width: 9px;
  height: 5px;
  border-bottom: 1.8px solid var(--contact-coral);
  border-left: 1.8px solid var(--contact-coral);
  content: "";
  transform: rotate(-45deg);
}

.contact-textarea-wrap {
  position: relative;
}

textarea.contact-control {
  min-height: 108px;
  height: 108px;
  padding: 12px 14px 28px;
  resize: vertical;
  line-height: 1.6;
}

.contact-char-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: #a4aaae;
  font-size: 11px;
  pointer-events: none;
}

.contact-form-error {
  display: none;
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(217, 75, 75, 0.07);
  color: var(--contact-error);
  font-size: 13px;
  line-height: 1.45;
}

.contact-form-error.is-visible {
  display: block;
}

.contact-submit {
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  background: var(--contact-coral);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  transition: filter 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.contact-submit:hover:not(:disabled) {
  filter: brightness(0.97);
}

.contact-submit:active:not(:disabled) {
  transform: translateY(1px);
}

.contact-submit:focus-visible {
  outline: 2px solid var(--contact-ink);
  outline-offset: 2px;
}

.contact-submit:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.contact-button-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.contact-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: contact-spin 720ms linear infinite;
}

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

.contact-success {
  display: none;
  padding: 38px 8px 18px;
  text-align: center;
}

.contact-modal[data-view="success"] .contact-form-view {
  display: none;
}

.contact-modal[data-view="success"] .contact-success {
  display: block;
}

.contact-success-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #fcefea;
  color: var(--contact-coral);
}

.contact-success-icon::before {
  width: 21px;
  height: 11px;
  border-bottom: 3px solid currentColor;
  border-left: 3px solid currentColor;
  content: "";
  transform: rotate(-45deg) translate(1px, -2px);
}

.contact-success-title {
  margin: 0 0 10px;
  color: var(--contact-ink);
  font-size: 24px;
  font-weight: 700;
}

.contact-success-copy {
  max-width: 340px;
  margin: 0 auto 28px;
  color: var(--contact-muted);
  font-size: 14px;
  line-height: 1.8;
}

.contact-modal-done {
  width: 160px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--contact-ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .contact-modal-overlay {
    align-items: flex-start;
    padding: 20px;
  }

  .contact-modal {
    width: 100%;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    margin: auto 0;
  }

  .contact-modal-inner {
    padding: 26px 20px 22px;
  }

  .contact-modal-close {
    top: 14px;
    right: 14px;
  }

  .contact-modal-head {
    margin-bottom: 22px;
  }

  .contact-modal-title {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-modal-overlay,
  .contact-modal,
  .contact-control,
  .contact-select-chevron,
  .contact-select-menu,
  .contact-submit {
    transition: none;
  }

  .contact-spinner {
    animation-duration: 1.2s;
  }
}
