/* AdSafePC site: the contact dialog (index.html <dialog class="contact">).
   Tokens and primitives live in base.css. */

.contact {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* the scrolling happens inside: a click on this box's scrollbar is a click on
   the box, never on the dialog itself (which would read as the backdrop) */
.contact-body {
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.contact::backdrop {
  background: rgba(11, 15, 20, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.contact[open] {
  animation: contact-in var(--dur) var(--ease-out);
}

@keyframes contact-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.contact-form,
.contact-done {
  display: grid;
  gap: 14px;
  padding: clamp(22px, 5vw, 36px);
}

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

.contact .h3 {
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-right: 44px;
}

.contact-lead {
  color: var(--text-2);
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  transition: border-color var(--dur), box-shadow var(--dur);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field [aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--danger);
}

/* the honeypot: off-screen for people, present for bots */
.contact-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-error:empty {
  display: none;
}

.contact-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.9375rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.contact-actions .btn[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.contact-done {
  text-align: center;
  justify-items: center;
}

.contact-done .done-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.contact-done .done-icon .icon {
  width: 28px;
  height: 28px;
}

.contact-done p {
  color: var(--text-2);
  max-width: 40ch;
}
