/* UTKAST-ONLY: remove before go-live. Tilbakemelding on the draft preview. */

.fb-host { position: relative; }

.fb-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 32px;
  padding: 0.2rem 0.6rem;
  border: 1px solid rgba(7, 30, 51, 0.3);
  border-radius: 999px;
  background: #fff;
  color: var(--navy, #071e33);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s, background-color 0.15s, color 0.15s;
}
.fb-trigger:hover,
.fb-trigger:focus-visible { opacity: 1; background: var(--navy, #071e33); color: #fff; border-color: var(--navy, #071e33); }
.fb-trigger:focus-visible { outline: 2px solid var(--navy, #071e33); outline-offset: 2px; }

.fb-on-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.fb-on-dark:hover,
.fb-on-dark:focus-visible { background: #fff; color: var(--navy, #071e33); border-color: #fff; outline-color: #fff; }

.fb-icon { width: 14px; height: 14px; flex: none; }

.fb-corner { position: absolute; top: 0.75rem; right: max(0.75rem, calc((100% - 1160px) / 2 + 1.25rem)); z-index: 1; }
.fb-inline { margin-top: 0.6rem; align-self: flex-start; }
.person-card-body .fb-inline { margin-top: 0.35rem; }

.fb-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 50;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: var(--navy, #071e33);
  color: #fff;
  border-color: #fff;
  box-shadow: 0 4px 14px rgba(4, 20, 33, 0.3);
  opacity: 1;
}
.fb-fab .fb-icon { width: 16px; height: 16px; }
.fb-fab:hover,
.fb-fab:focus-visible { background: #fff; color: var(--navy, #071e33); border-color: var(--navy, #071e33); }

/* Leave room so the fixed button never covers the footer text. */
.site-footer { padding-bottom: 4.5rem; }

.fb-open { overflow: hidden; }
.fb-dialog [hidden] { display: none !important; }

.fb-dialog {
  width: min(28rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  margin: auto;
  padding: 1.25rem;
  border: 1px solid var(--navy, #071e33);
  border-top: 4px solid var(--navy, #071e33);
  background: #fff;
  color: var(--navy, #071e33);
  font-family: inherit;
  box-shadow: 0 18px 50px rgba(4, 20, 33, 0.35);
  overflow: auto;
}
.fb-dialog::backdrop { background: rgba(4, 20, 33, 0.55); }
.fb-dialog[open]:not(:modal) { position: fixed; inset: 0; z-index: 100; }

.fb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.fb-heading {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}
.fb-x {
  flex: none;
  width: 36px;
  height: 36px;
  margin: -0.4rem -0.4rem 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.fb-x:hover { background: var(--mist, #e6eef5); }

.fb-form { display: flex; flex-direction: column; gap: 0.35rem; }
.fb-label { font-weight: 600; font-size: 0.95rem; }
.fb-text,
.fb-input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid rgba(7, 30, 51, 0.45);
  border-radius: 0;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 1rem; /* 16px avoids iOS zoom */
}
.fb-text { min-height: 7.5rem; resize: vertical; }
.fb-text:focus,
.fb-input:focus { outline: 2px solid var(--navy, #071e33); outline-offset: 1px; }
.fb-text[aria-invalid="true"] { border-color: #a4262c; }
.fb-count { margin: 0 0 0.5rem; color: var(--muted, #3c5164); font-size: 0.8rem; text-align: right; }
.fb-status { margin: 0.25rem 0 0; color: #a4262c; font-size: 0.9rem; }
.fb-status:empty { display: none; }

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

.fb-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.9rem; }
.fb-btn {
  min-height: 44px;
  padding: 0.5rem 1.2rem;
  border: 1.5px solid var(--navy, #071e33);
  background: var(--navy, #071e33);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.fb-btn:hover { background: #fff; color: var(--navy, #071e33); }
.fb-btn-ghost { background: #fff; color: var(--navy, #071e33); }
.fb-btn-ghost:hover { background: var(--mist, #e6eef5); }
.fb-btn:disabled { opacity: 0.6; cursor: wait; }
.fb-btn:focus-visible,
.fb-x:focus-visible { outline: 2px solid var(--navy, #071e33); outline-offset: 2px; }

.fb-thanks { padding: 0.25rem 0 0; outline: none; }
.fb-thanks-big { font-family: "Source Serif 4", Georgia, serif; font-size: 1.15rem; font-weight: 600; margin: 0 0 0.3rem; }
.fb-thanks-small { margin: 0; color: var(--muted, #3c5164); }


/* Attachments */
.fb-files { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; margin-top: 0.5rem; }
.fb-hint { margin: -0.2rem 0 0.15rem; color: var(--muted, #3c5164); font-size: 0.85rem; line-height: 1.4; }
.fb-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.fb-choose { display: inline-flex; align-items: center; gap: 0.45rem; }
.fb-choose .fb-icon { width: 18px; height: 18px; }
.fb-file-list { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 0.35rem; }
.fb-file-list:empty { display: none; }
.fb-file {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.3rem 0.3rem 0.3rem 0.65rem;
  border: 1px solid var(--line, rgba(7, 30, 51, 0.16));
  background: var(--mist, #e6eef5);
  font-size: 0.9rem;
}
.fb-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fb-file-size { flex: none; color: var(--muted, #3c5164); font-size: 0.8rem; }
.fb-file-rm {
  flex: none; min-height: 36px; padding: 0.2rem 0.7rem;
  border: 1px solid rgba(7, 30, 51, 0.35); background: #fff; color: inherit;
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.fb-file-rm:hover { background: var(--navy, #071e33); color: #fff; }
.fb-file-rm:focus-visible { outline: 2px solid var(--navy, #071e33); outline-offset: 2px; }
.fb-file-rm:disabled, .fb-choose:disabled { opacity: 0.5; cursor: not-allowed; }
.fb-progress { margin-top: 0.6rem; }
.fb-progress progress { width: 100%; height: 0.6rem; accent-color: var(--navy, #071e33); }
.fb-progress-text { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--muted, #3c5164); }
.fb-thanks-time { margin: 0 0 0.4rem; font-weight: 600; }
.fb-thanks-warn { margin: 0.6rem 0 0; padding: 0.5rem 0.7rem; border-left: 3px solid #a4262c; background: #fbeeee; font-size: 0.9rem; }

@media (max-width: 600px) {
  .fb-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    max-height: 90%;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }
  .fb-actions .fb-btn { flex: 1; }
  .fb-fab span { font-size: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .fb-trigger { transition: none; }
}
