/* RessursAgent – kort kontaktskjema (dialog). Bruker variablene fra styles.css. */

.contact-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--paper, #f5f5f0);
  color: var(--ink, #202626);
  font-family: var(--font, system-ui, sans-serif);
  box-shadow: 0 24px 80px rgba(20, 26, 26, 0.35);
  overflow: auto;
  overscroll-behavior: contain;
}

.contact-dialog::backdrop {
  background: rgba(20, 26, 26, 0.62);
}

html.contact-open {
  overflow: hidden;
}

.contact-body {
  padding: 36px 36px 32px;
}

.contact-eyebrow {
  margin-bottom: 14px;
  color: var(--accent, #fb6b32);
}

.contact-dialog h2 {
  font-size: clamp(28px, 4vw, 38px);
  padding-right: 36px;
}

.contact-regarding {
  display: inline-block;
  margin: 14px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line, #dddfd8);
  font-size: 14px;
  font-weight: 600;
}

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

.contact-intro {
  margin: 14px 0 26px;
  color: var(--muted, #666d6b);
  font-size: 16px;
  line-height: 1.55;
}

.contact-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink, #202626);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.contact-close:hover,
.contact-close:focus-visible {
  background: #e9eae4;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 14px;
}

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

.contact-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.contact-field-wide,
.contact-actions,
.contact-status {
  grid-column: 1 / -1;
}

.contact-field label {
  font-size: 14px;
  font-weight: 600;
}

.contact-optional {
  color: var(--muted, #666d6b);
  font-weight: 400;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #c2c7c2;
  border-radius: 4px;
  background: #fff;
  color: var(--ink, #202626);
  font: inherit;
  font-size: 16px; /* 16px hindrer automatisk zoom på iPhone */
  line-height: 1.4;
}

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

.contact-field input:focus-visible,
.contact-field textarea:focus-visible {
  outline: 2px solid var(--accent, #fb6b32);
  outline-offset: 1px;
  border-color: var(--accent, #fb6b32);
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: #8d9390;
}

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

.contact-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 6px;
}

.contact-actions .button {
  flex: none;
  min-width: 150px;
  cursor: pointer;
  font-family: inherit;
}

.contact-actions .button:disabled {
  opacity: 0.7;
  cursor: progress;
  transform: none;
}

.contact-privacy {
  color: var(--muted, #666d6b);
  font-size: 14px;
  line-height: 1.45;
}

.contact-privacy a,
.contact-status a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-status {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #b3261e;
}

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

.contact-success {
  padding: 8px 0 4px;
  font-size: 17px;
  line-height: 1.55;
  outline: none;
}

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

.contact-success-title {
  margin-bottom: 6px;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink, #202626);
}

@media (max-width: 560px) {
  .contact-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .contact-body {
    padding: 24px 16px 24px;
  }

  .contact-intro {
    margin: 10px 0 18px;
  }

  .contact-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .contact-field textarea {
    min-height: 76px;
  }

  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-actions .button {
    width: 100%;
  }
}
