/* Niksoft shared contact layer 1.7 — native dialog and contact form. */

body.contact-dialog-open {
  overflow: hidden;
}

.contact-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(calc(100% - 2rem), 51rem);
  max-width: none;
  max-height: calc(100dvh - 2rem);
  margin: 0;
  padding: 0;
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0c1415;
}

.contact-dialog:not([open]) {
  display: none;
}

.contact-dialog[data-fallback-open] {
  z-index: 1000;
}

.contact-dialog::backdrop {
  background: rgba(12, 20, 21, 0.72);
  animation: contact-backdrop-in 180ms ease-out both;
}

.contact-dialog__surface {
  position: relative;
  max-height: calc(100dvh - 2rem);
  padding: clamp(1.35rem, 3vw, 2.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(12, 20, 21, 0.2);
  background: #fbfaf7;
  box-shadow: 0 2rem 6rem rgba(12, 20, 21, 0.28);
  animation: contact-dialog-in 220ms cubic-bezier(0.2, 0.72, 0.2, 1) both;
}

.contact-dialog__close {
  position: absolute;
  z-index: 2;
  top: 1rem;
  right: 1rem;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(12, 20, 21, 0.24);
  border-radius: 0;
  background: transparent;
  color: #0c1415;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.contact-dialog__close:hover,
.contact-dialog__close:focus-visible {
  border-color: #0c1415;
  background: #0c1415;
  color: #fff;
}

.contact-dialog__header {
  padding-right: 3.75rem;
}

.contact-dialog__header h2 {
  max-width: 18ch;
  margin: 0 0 0.6rem;
  color: #0c1415;
  font-size: clamp(1.9rem, 4vw, 2.65rem);
  font-weight: 520;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.contact-dialog__header p {
  max-width: 38rem;
  margin: 0;
  color: #626b69;
  font-size: 1rem;
  line-height: 1.55;
}

.contact-dialog__channels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-block: 1.35rem;
  border-block: 1px solid rgba(12, 20, 21, 0.22);
}

.contact-dialog__channels > div {
  min-width: 0;
  padding: 0.8rem 1.25rem 0.8rem 0;
}

.contact-dialog__channels > div + div {
  padding-left: 1.25rem;
  border-left: 1px solid rgba(12, 20, 21, 0.18);
}

.contact-dialog__channels span,
.contact-dialog__channels a {
  display: block;
}

.contact-dialog__channels span {
  margin-bottom: 0.25rem;
  color: #8f4f2f;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-dialog__channels a {
  min-height: 2.75rem;
  padding-block: 0.45rem;
  overflow-wrap: anywhere;
  color: #0c1415;
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.45;
  text-decoration-color: #b56d44;
  text-underline-offset: 0.28rem;
}

.contact-dialog__status {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid #8f4f2f;
  background: #f1eee7;
  color: #4c2720;
  font-size: 0.9rem;
  line-height: 1.5;
}

.contact-dialog__status.is-success {
  border-left-color: #2e6b57;
  color: #1f5847;
}

.contact-dialog__status[hidden] {
  display: none;
}

.contact-form {
  position: relative;
}

.contact-form__trap {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.contact-form__trap[hidden] {
  display: none !important;
}

.contact-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.1rem;
}

.contact-field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.contact-field label {
  color: #303a38;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
}

.contact-field label span {
  color: #8f4f2f;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(12, 20, 21, 0.3);
  border-radius: 0;
  background: #fff;
  color: #0c1415;
  font-size: 1rem;
  line-height: 1.45;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.contact-field textarea {
  min-height: 7rem;
  resize: vertical;
}

.contact-field input:hover,
.contact-field textarea:hover {
  border-color: rgba(12, 20, 21, 0.58);
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-color: #8f4f2f;
  box-shadow: inset 0 0 0 1px #8f4f2f;
}

.contact-form__help {
  margin: 0.4rem 0 0.8rem;
  color: #626b69;
  font-size: 0.76rem;
  line-height: 1.45;
}

.contact-form__error {
  margin: -0.55rem 0 0.8rem;
  color: #a4362d;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
}

.contact-form__error[hidden] {
  display: none;
}

.contact-field--message {
  margin-top: 0.15rem;
}

.contact-consent {
  display: grid;
  min-height: 2.75rem;
  grid-template-columns: 1.3rem 1fr;
  gap: 0.75rem;
  align-items: start;
  margin-top: 0.8rem;
  padding-block: 0.35rem;
  color: #4b5654;
  font-size: 0.78rem;
  line-height: 1.5;
  cursor: pointer;
}

.contact-consent input {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.1rem 0 0;
  accent-color: #8f4f2f;
}

.contact-consent a {
  display: inline;
  color: #0c1415;
}

.contact-form__footer {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(12, 20, 21, 0.18);
}

.contact-dialog .contact-form__submit {
  min-height: 3rem;
  flex: 0 0 auto;
  border-color: #0c1415;
  border-radius: 0;
  background: #0c1415;
  color: #fff;
  font-weight: 620;
}

.contact-dialog .contact-form__submit:hover,
.contact-dialog .contact-form__submit:focus-visible {
  border-color: #8f4f2f;
  background: #8f4f2f;
}

.contact-dialog .contact-form__submit[disabled] {
  border-color: #d7d5cc;
  background: #d7d5cc;
  color: #626b69;
}

.contact-form__footer p {
  max-width: 23rem;
  margin: 0;
  color: #626b69;
  font-size: 0.74rem;
  line-height: 1.45;
  text-align: right;
}

body.niksoft-internal .contact-channel__links {
  display: grid;
  gap: 0.3rem;
}

body.niksoft-internal .contact-channel__links a {
  width: fit-content;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
}

@keyframes contact-dialog-in {
  from {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.985);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes contact-backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .contact-dialog {
    inset: auto 0 0;
    width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top));
    transform: none;
  }

  .contact-dialog__surface {
    max-height: calc(100dvh - env(safe-area-inset-top));
    padding: 1.15rem 1.25rem calc(1.15rem + env(safe-area-inset-bottom));
    border-inline: 0;
    border-bottom: 0;
  }

  .contact-dialog__close {
    top: 0.75rem;
    right: 0.75rem;
  }

  .contact-dialog__header {
    padding-right: 3.25rem;
  }

  .contact-dialog__header h2 {
    font-size: clamp(1.75rem, 8vw, 2.1rem);
  }

  .contact-dialog__channels,
  .contact-form__grid {
    grid-template-columns: 1fr;
  }

  .contact-dialog__channels {
    margin-block: 1rem;
  }

  .contact-dialog__channels > div {
    padding: 0.65rem 0;
  }

  .contact-dialog__channels > div + div {
    padding-left: 0;
    border-top: 1px solid rgba(12, 20, 21, 0.18);
    border-left: 0;
  }

  .contact-form__grid {
    gap: 0.7rem;
  }

  .contact-form__footer {
    align-items: stretch;
    flex-direction: column;
    gap: 0.6rem;
  }

  .contact-dialog .contact-form__submit {
    width: 100%;
  }

  .contact-form__footer p {
    max-width: none;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-dialog::backdrop,
  .contact-dialog__surface {
    animation: none;
  }
}

@media print {
  .contact-dialog {
    display: none !important;
  }
}
