html {
  scrollbar-gutter: stable;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.feedback-modal.is-open {
  pointer-events: auto;
}

.feedback-modal__backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 12%, rgba(96, 165, 250, 0.22), transparent 36%),
    rgba(15, 23, 42, 0.54);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition:
    opacity 160ms ease-out,
    -webkit-backdrop-filter 180ms cubic-bezier(0.22, 1, 0.36, 1),
    backdrop-filter 180ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, backdrop-filter;
}

.feedback-modal.is-open .feedback-modal__backdrop {
  opacity: 1;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.feedback-modal__dialog {
  position: relative;
  display: grid;
  gap: 20px;
  width: min(760px, 100%);
  max-height: calc(100svh - 48px);
  padding: 28px;
  overflow: auto;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.96)),
    #ffffff;
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition:
    opacity 160ms ease-out,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.feedback-modal.is-open .feedback-modal__dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.feedback-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #5f718b;
  cursor: pointer;
  background: rgba(248, 251, 255, 0.86);
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: 12px;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.feedback-modal__close:hover,
.feedback-modal__close:focus-visible {
  color: #991b1b;
  background: #fef2f2;
  border-color: rgba(248, 113, 113, 0.78);
  outline: none;
}

.feedback-modal__close svg,
.feedback-form__success-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feedback-modal__header {
  display: grid;
  gap: 8px;
  padding-right: 54px;
}

.feedback-modal__kicker {
  color: #1267d8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.feedback-modal__header h2 {
  margin: 0;
  color: #172033;
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", Arial, sans-serif;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.feedback-form {
  display: grid;
  gap: 16px;
}

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

.feedback-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feedback-form__field,
.feedback-form__file {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.feedback-form__field > span,
.feedback-form__file-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.feedback-form__field strong,
.feedback-form__file-label strong {
  color: #172033;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.feedback-form__field em,
.feedback-form__file-label em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.3;
}

.feedback-form input[type="text"],
.feedback-form input[type="email"],
.feedback-form textarea {
  width: 100%;
  min-width: 0;
  color: #172033;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 14px;
  outline: none;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.feedback-form input[type="text"],
.feedback-form input[type="email"] {
  height: 46px;
  padding: 0 14px;
}

.feedback-form textarea {
  min-height: 150px;
  padding: 13px 14px;
  resize: vertical;
}

.feedback-form input:focus-visible,
.feedback-form textarea:focus-visible {
  background: #ffffff;
  border-color: rgba(26, 115, 232, 0.72);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
}

.feedback-form__file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 46px;
}

.feedback-form__file-button,
.feedback-form__file-remove,
.feedback-form__submit,
.feedback-form__secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 999px;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.feedback-form__file-button {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  min-width: min(220px, 100%);
  padding: 0 15px;
  color: #1267d8;
  background: rgba(239, 246, 255, 0.86);
  border: 1px solid rgba(147, 197, 253, 0.78);
}

.feedback-form__file-button[hidden],
.feedback-form__file-remove[hidden],
.feedback-form__file-name[hidden] {
  display: none !important;
}

.feedback-form__file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.feedback-form__button-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feedback-form__file-button:hover,
.feedback-form__file-button:focus-within,
.feedback-form__file-remove:hover,
.feedback-form__file-remove:focus-visible,
.feedback-form__secondary:hover,
.feedback-form__secondary:focus-visible {
  background: #dbeafe;
  border-color: rgba(96, 165, 250, 0.82);
  outline: none;
  transform: translateY(-1px);
}

.feedback-form__file-name {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-form__file-remove,
.feedback-form__secondary {
  padding: 0 14px;
  color: #1267d8;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(191, 219, 254, 0.86);
}

.feedback-form__file-remove {
  grid-column: 1;
  grid-row: 1;
  min-width: min(220px, 100%);
  color: #991b1b;
  background: rgba(254, 242, 242, 0.92);
  border-color: rgba(248, 113, 113, 0.78);
}

.feedback-form__file-remove:hover,
.feedback-form__file-remove:focus-visible {
  color: #ffffff;
  background: #991b1b;
  border-color: #7f1d1d;
  box-shadow: 0 14px 28px rgba(153, 27, 27, 0.2);
}

.feedback-form__status {
  min-height: 20px;
  color: #475569;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.feedback-form__status.is-error {
  color: #dc2626;
}

.feedback-form__status.is-success {
  color: #16803d;
}

.feedback-form__actions {
  display: flex;
  justify-content: flex-end;
}

.feedback-form__submit {
  min-width: 190px;
  min-height: 48px;
  padding: 0 22px;
  color: #ffffff;
  background: #1267d8;
  border: 1px solid rgba(18, 103, 216, 0.7);
  box-shadow: 0 14px 28px rgba(18, 103, 216, 0.24);
}

.feedback-form__submit:hover,
.feedback-form__submit:focus-visible {
  background: #0f5fc9;
  box-shadow: 0 18px 38px rgba(18, 103, 216, 0.34);
  outline: none;
  transform: translateY(-1px);
}

.feedback-form__submit:disabled,
.feedback-form.is-submitting .feedback-form__file-button,
.feedback-form__file-remove:disabled {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

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

.feedback-form__success {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 18px 6px;
  text-align: center;
}

.feedback-form__success[hidden] {
  display: none;
}

.feedback-modal.is-feedback-sent .feedback-modal__dialog {
  gap: 0;
  width: min(560px, 100%);
  padding: 38px 32px 34px;
}

.feedback-modal.is-feedback-sent .feedback-modal__header {
  display: none;
}

.feedback-modal.is-feedback-sent .feedback-form__success {
  align-content: center;
  min-height: 330px;
  padding: 42px 18px 10px;
}

.feedback-modal.is-feedback-sent .feedback-form__success-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
}

.feedback-modal.is-feedback-sent .feedback-form__success h3 {
  font-size: 28px;
}

.feedback-modal.is-feedback-sent .feedback-form__secondary {
  min-width: 132px;
}

.feedback-form__success-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #ffffff;
  background: #19a55a;
  border-radius: 18px;
  box-shadow:
    0 16px 32px rgba(25, 165, 90, 0.24),
    0 0 0 8px rgba(34, 197, 94, 0.1);
}

.feedback-form__success h3 {
  margin: 0;
  color: #172033;
  font-size: 24px;
  line-height: 1.18;
}

.feedback-form__success p {
  max-width: 460px;
  margin: 0;
  color: #475569;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.5;
}

html.is-feedback-modal-open,
html.is-feedback-modal-open body {
  overflow: hidden;
}

[data-theme="dark"] .feedback-modal__backdrop {
  background:
    radial-gradient(circle at 50% 12%, rgba(96, 165, 250, 0.18), transparent 36%),
    rgba(2, 6, 23, 0.72);
}

[data-theme="dark"] .feedback-modal__dialog {
  background:
    linear-gradient(145deg, rgba(19, 28, 44, 0.98), rgba(15, 23, 42, 0.96)),
    #0f172a;
  border-color: rgba(96, 165, 250, 0.24);
  box-shadow: 0 32px 84px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .feedback-modal__close {
  color: #c9d8ef;
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.24);
}

[data-theme="dark"] .feedback-modal__close:hover,
[data-theme="dark"] .feedback-modal__close:focus-visible {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.48);
  border-color: rgba(248, 113, 113, 0.42);
}

[data-theme="dark"] .feedback-modal__kicker {
  color: #8ec5ff;
}

[data-theme="dark"] .feedback-modal__header h2,
[data-theme="dark"] .feedback-form__field strong,
[data-theme="dark"] .feedback-form__file-label strong,
[data-theme="dark"] .feedback-form__success h3 {
  color: #eef4ff;
}

[data-theme="dark"] .feedback-form__field em,
[data-theme="dark"] .feedback-form__file-label em,
[data-theme="dark"] .feedback-form__file-name,
[data-theme="dark"] .feedback-form__success p {
  color: #aabbd2;
}

[data-theme="dark"] .feedback-form input[type="text"],
[data-theme="dark"] .feedback-form input[type="email"],
[data-theme="dark"] .feedback-form textarea {
  color: #eef4ff;
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.26);
}

[data-theme="dark"] .feedback-form input:focus-visible,
[data-theme="dark"] .feedback-form textarea:focus-visible {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(96, 165, 250, 0.56);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14);
}

[data-theme="dark"] .feedback-form__file-button,
[data-theme="dark"] .feedback-form__file-remove,
[data-theme="dark"] .feedback-form__secondary {
  color: #8ec5ff;
  background: rgba(30, 64, 120, 0.28);
  border-color: rgba(96, 165, 250, 0.28);
}

[data-theme="dark"] .feedback-form__file-button:hover,
[data-theme="dark"] .feedback-form__file-button:focus-within,
[data-theme="dark"] .feedback-form__file-remove:hover,
[data-theme="dark"] .feedback-form__file-remove:focus-visible,
[data-theme="dark"] .feedback-form__secondary:hover,
[data-theme="dark"] .feedback-form__secondary:focus-visible {
  background: rgba(30, 64, 120, 0.46);
  border-color: rgba(96, 165, 250, 0.42);
}

[data-theme="dark"] .feedback-form__file-remove {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.3);
  border-color: rgba(248, 113, 113, 0.42);
}

[data-theme="dark"] .feedback-form__file-remove:hover,
[data-theme="dark"] .feedback-form__file-remove:focus-visible {
  color: #ffffff;
  background: #991b1b;
  border-color: #ef4444;
  box-shadow: 0 14px 30px rgba(127, 29, 29, 0.34);
}

[data-theme="dark"] .feedback-form__status {
  color: #aabbd2;
}

[data-theme="dark"] .feedback-form__status.is-error {
  color: #ff8a8a;
}

[data-theme="dark"] .feedback-form__status.is-success {
  color: #74e3a1;
}

@media (prefers-reduced-motion: reduce) {
  .feedback-modal__backdrop,
  .feedback-modal__dialog {
    transition-duration: 0.01ms;
  }
}

@media (max-width: 760px) {
  .feedback-modal {
    align-items: end;
    padding: 10px;
  }

  .feedback-modal__dialog {
    width: 100%;
    max-height: calc(100svh - 20px);
    padding: 22px 16px 18px;
    border-radius: 20px;
  }

  .feedback-modal__close {
    top: 14px;
    right: 14px;
  }

  .feedback-modal__header {
    padding-right: 46px;
  }

  .feedback-modal__header h2 {
    font-size: 28px;
  }

  .feedback-form__grid {
    grid-template-columns: 1fr;
  }

  .feedback-form__file-row {
    grid-template-columns: 1fr;
  }

  .feedback-form__file-name {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .feedback-form__file-button,
  .feedback-form__file-remove {
    width: 100%;
  }

  .feedback-form__actions,
  .feedback-form__submit,
  .feedback-form__secondary {
    width: 100%;
  }

  .feedback-modal.is-feedback-sent .feedback-modal__dialog {
    width: min(420px, 100%);
    padding: 34px 18px 24px;
  }

  .feedback-modal.is-feedback-sent .feedback-form__success {
    min-height: 300px;
    padding: 38px 8px 10px;
  }
}
