/* The modal and the fields inside it - the one stylesheet a dialog needs,
   loaded by BOTH layouts. It lived in site.css until the Submit Feedback
   dialog was found unstyled under the footer of every ported page (UAT
   A8): the legacy layout loads legacy/styles.css and never site.css, so
   the overlay had no rules at all there.

   Every rule is scoped to .po-modal, because on a legacy page the vendor's
   element rules are already in force - label is small caps with a margin,
   h2 is 2.25rem, input fills its width in Open Sans, and button and
   .button carry their own padding and border. A rule here either sets
   what it needs outright or out-specifies the vendor's, so the dialog
   looks the same on both layouts. Reads tokens.css for every value */

/* A div overlay rather than <dialog> - see layout/_modal.php for why.
   z-index clears the legacy header (1000) and its mobile nav (995) */
.po-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(18, 25, 29, 0.42);
  color: var(--po-text);
  font-family: var(--po-font);
  font-size: 17px;
  line-height: 1.6;
}

.po-modal__panel {
  display: flex;
  flex-direction: column;
  width: min(30rem, 100%);
  max-height: 100%;
  overflow: hidden;
  background: var(--po-surface);
  border-radius: var(--po-radius);
  box-shadow: 0 12px 34px rgba(18, 25, 29, 0.28);
  text-align: left;
}

.po-modal__panel p {
  margin: 0;
}

.po-modal__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0;
}

.po-modal__head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: left;
  color: var(--po-ink);
}

.po-modal .po-modal__x {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border: 0;
  border-radius: var(--po-radius);
  background: transparent;
  color: var(--po-text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.po-modal__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.po-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0 1.5rem 1.25rem;
}

/* The dialog's own buttons. site.css styles .button for the new layout
   and legacy/styles.css styles it differently for the old one, so the
   dialog carries its own copy rather than inheriting whichever loaded */
.po-modal .button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--po-radius);
  background: var(--po-primary);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: none;
  box-shadow: var(--po-shadow);
  cursor: pointer;
}

.po-modal .button:hover,
.po-modal .button:focus-visible {
  background: var(--po-ink);
  outline: 2px solid var(--po-accent);
  outline-offset: 2px;
}

.po-modal .button--quiet {
  background: transparent;
  color: var(--po-primary);
  box-shadow: none;
  border-color: var(--po-border);
}

.po-modal .button--quiet:hover,
.po-modal .button--quiet:focus-visible {
  background: var(--po-primary);
  color: #fff;
}

/* Fields. The note line is always present and usually empty, so a
   refusal SUBSTITUTES rather than growing the dialog and shifting the
   buttons under the pointer that is about to click them */
.po-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.po-modal .po-field__label {
  display: block;
  margin: 0;
  font-variant: normal;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--po-ink);
}

.po-modal .po-field__input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--po-border);
  border-radius: var(--po-radius);
  background: var(--po-surface);
  color: var(--po-text);
  font-family: inherit;
  font-size: 1rem;
}

.po-modal .po-field__input:focus-visible {
  outline: 2px solid var(--po-accent);
  outline-offset: 1px;
}

.po-field__note {
  min-height: 1.1rem;
  font-size: 0.82rem;
  color: var(--po-text-muted);
}

.po-field__note.is-error {
  color: var(--po-warn);
}

/* The honeypot. Hidden from sight and from assistive technology, but
   NOT with display:none or hidden - some bots skip those deliberately,
   and a field that is merely off-screen is the one they still fill */
.po-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
