/* Feedback widget — self-contained, responsive contact form. */
.feedback {
  width: 100%;
}

.feedback__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.feedback__row {
  display: flex;
  gap: 16px;
}

.feedback__row > .feedback__field {
  flex: 1 1 0;
  min-width: 0;
}

.feedback__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback__label {
  font-weight: 600;
  font-size: 0.95rem;
}

.feedback__req {
  color: #d6336c;
  font-weight: 700;
}

.feedback__optional {
  color: #131313;
  font-weight: 400;
  font-size: 0.85rem;
}

.feedback__field input[type='text'],
.feedback__field input[type='email'],
.feedback__field input[type='tel'],
.feedback__field select,
.feedback__field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d0d0d8;
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: #131313;
}

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

/* Native select renders its own chrome — a different text inset and an arrow
   crammed against the right edge. Strip it and draw our own chevron so the
   dropdown matches the text inputs: the content keeps the inputs' 13px left
   padding, and the arrow sits with a larger right offset (text clears it via
   the wider right padding). */
.feedback__field select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 42px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.feedback__field input:focus,
.feedback__field select:focus,
.feedback__field textarea:focus {
  outline: none;
  border-color: #e106a4;
  box-shadow: 0 0 0 3px rgba(225, 6, 164, 0.15);
}

.feedback__hint {
  color: #131313;
  font-size: 0.82rem;
}

/* File drop zone — replaces the native file input. The real <input type='file'>
   is visually hidden; this styled box proxies clicks and accepts drag-and-drop. */
.feedback__dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 128px;
  padding: 20px;
  border: 2px dashed #c9c9d4;
  border-radius: 10px;
  background: #fafafb;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.feedback__dropzone:hover {
  border-color: #e106a4;
  background: #fdf3fa;
}

.feedback__dropzone.is-dragover {
  border-color: #e106a4;
  background: #fce6f5;
}

.feedback__dropzone.is-filled {
  cursor: default;
}

/* Real input, kept in the DOM so the file still posts, but out of sight. */
.feedback__dropzone-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

/* The hidden attribute must win over the explicit display values below, so an
   empty zone never leaks the selected/remove UI and vice-versa. */
.feedback__dropzone [hidden] {
  display: none;
}

.feedback__dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.feedback__dropzone-icon {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: #e106a4;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feedback__dropzone-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #131313;
}

.feedback__dropzone-browse {
  font-size: 0.85rem;
  color: #e106a4;
  text-decoration: underline;
}

.feedback__dropzone-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
}

/* Uploaded image preview — fits inside the zone without cropping. */
.feedback__dropzone-preview {
  display: block;
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  object-fit: contain;
}

.feedback__dropzone-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #131313;
  word-break: break-all;
}

/* Sits in the zone's top-right corner, overlaying the preview. */
.feedback__dropzone-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f9d6ee;
  color: #e106a4;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: background 0.15s ease, color 0.15s ease;
}

.feedback__dropzone-remove:hover {
  background: #e106a4;
  color: #fff;
}

.feedback__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  line-height: 1.4;
}

.feedback__consent input {
  margin-top: 3px;
  flex: 0 0 auto;
}

.feedback__button {
  position: relative;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 12rem;
  padding: 12px 28px;
  border: 0;
  border-radius: var(--btn-radius, 8px);
  background: #e106a4;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.15s ease;
}

/* The button doubles as a determinate upload progress bar: a darker fill
   layer grows left→right beneath the caption as bytes are sent. Hidden until
   the JS adds --uploading; caption/spinner ride above it via z-index. */
.feedback__button-fill {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  background: #8a0466;
  transition: width 0.2s ease;
}

.feedback__button--uploading .feedback__button-fill {
  display: block;
}

.feedback__button-label {
  position: relative;
  z-index: 1;
}

.feedback__button:hover {
  background: #c1058c;
}

.feedback__button:disabled {
  opacity: 0.75;
  cursor: default;
}

/* Busy state — mirrors the certificate download button: an indeterminate
   spinner shown only while the submit is in flight (toggled via
   .feedback__button--busy), hidden otherwise. */
.feedback__button-spinner {
  display: none;
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  animation: feedback-button-spin 0.9s linear infinite;
}

.feedback__button--busy .feedback__button-spinner {
  display: inline-block;
}

/* While uploading, the button shows the determinate fill + percentage caption,
   so the indeterminate spinner is suppressed even though --busy is also set. */
.feedback__button--uploading .feedback__button-spinner {
  display: none;
}

@keyframes feedback-button-spin {
  to { transform: rotate(360deg); }
}

/* Leave-page warning — shown (via JS un-hiding) alongside the progress bar
   only while a file upload is in flight. Reinforces the beforeunload guard for
   visitors on a slow connection sending a large file: a visible, calm block
   asking them to stay on the page until the upload finishes. */
.feedback__upload-note {
  margin: 0;
  padding: 11px 14px;
  border-radius: 8px;
  border-left: 3px solid #e106a4;
  background: #fdeef7;
  color: #131313;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.4;
}

.feedback__upload-note[hidden] {
  display: none;
}

.feedback__status {
  margin: 0;
  padding: 11px 14px;
  border-radius: 8px;
  font-weight: 600;
}

/* After a successful submit the form collapses to just its status toast. */
.feedback__form.is-submitted > *:not(.feedback__status) {
  display: none;
}

/* On a dedicated feedback page a successful submit sweeps out only the page
   *content* — the CMS body above the form; the form has already collapsed to its
   toast via the rule above. The heading chrome (breadcrumbs + page title) and the
   right promo banner deliberately stay put. The body class is only set by a
   page-hosted feedback form, never the floating support launcher. */
body.feedback-swept .feedback-page__body {
  display: none;
}
/* The form is capped at 720px and centred by default; once swept, drop that cap
   so the remaining success toast spans the full container width. */
body.feedback-swept .feedback__form {
  max-width: none;
}
body.feedback-swept .feedback__status {
  margin-top: 8px;
}

.feedback__status.is-ok {
  background: #e7f6ec;
  color: #1b7e3c;
}

.feedback__status.is-error {
  background: #fdecef;
  color: #c2255c;
}

.feedback__recaptcha-note {
  margin: 0;
  color: #131313;
  font-size: 0.75rem;
}

.feedback__recaptcha-note a {
  color: #131313;
  text-decoration: underline;
}

/* Honeypot — kept in the DOM + accessibility tree off, but visually gone and
   out of the tab order. Bots fill it; humans never see it. */
.feedback__hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 560px) {
  .feedback__row {
    flex-direction: column;
    gap: 16px;
  }

  .feedback__button {
    align-self: stretch;
    text-align: center;
  }
}
