/* The feedback page: a calm intro beside one card, big targets for one thumb, the site's colours in
   both themes. Served as a file, never inline, because this page has a strict CSP. */

#feedback-main [hidden] {
  display: none !important;
}

.feedback-layout {
  display: grid;
  gap: 36px;
  padding: calc(var(--header) + 48px) 0 110px;
}

.feedback-intro {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}

.feedback-intro .label {
  justify-content: center;
}

.feedback-intro .title {
  font-size: clamp(2.3rem, 8.6vw, 4.2rem);
}

.feedback-intro .lead {
  margin-inline: auto;
}

.feedback-notes {
  display: grid;
  width: fit-content;
  max-width: 100%;
  gap: 14px;
  margin: 28px auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.feedback-notes li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-2);
  font-size: 0.98rem;
}

.feedback-notes .icon {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: var(--blue);
}

.feedback-notes a,
.feedback-alt a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--blue) 40%, transparent);
}

.feedback-forms {
  width: min(640px, 100%);
  margin-inline: auto;
}

.feedback-card {
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 40px 100px -40px var(--device-shadow);
  text-align: start;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.feedback-kinds {
  min-width: 0;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.feedback-kinds legend,
.feedback-field label {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.feedback-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.feedback-pill {
  position: relative;
  display: flex;
}

.feedback-pill input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.feedback-pill span {
  display: grid;
  width: 100%;
  min-height: 76px;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 10px 6px;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.2;
  text-align: center;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease, transform 300ms var(--ease);
}

.feedback-pill .icon {
  width: 24px;
  height: 24px;
}

.feedback-pill b {
  font-weight: 700;
}

.feedback-pill:hover span {
  transform: translateY(-1px);
}

.feedback-pill input:checked + span {
  border-color: var(--blue);
  background: color-mix(in oklab, var(--blue) 14%, transparent);
  color: var(--text);
}

.feedback-pill input:checked + span .icon {
  color: var(--blue);
}

.feedback-pill input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.feedback-field {
  margin-bottom: 20px;
}

.feedback-field textarea,
.feedback-field input {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--field);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.5;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.feedback-field textarea {
  min-height: 168px;
  resize: vertical;
}

.feedback-field textarea::placeholder,
.feedback-field input::placeholder {
  color: var(--text-3);
}

.feedback-field textarea:focus-visible,
.feedback-field input:focus-visible {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--blue) 22%, transparent);
}

.feedback-field [aria-invalid="true"] {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--coral) 16%, transparent);
}

/* A problem with a field, said right under it, calmly. */
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 2px 0;
  color: var(--coral);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.4;
}

.field-error .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.feedback-hint,
.feedback-count {
  margin: 8px 2px 0;
  color: var(--text-3);
  font-size: 0.9rem;
}

.feedback-count {
  text-align: end;
}

.feedback-pot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.feedback-send,
.feedback-again {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--ink-1);
  font: inherit;
  font-size: 1.08rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 200ms ease, transform 300ms var(--ease);
}

.feedback-send::after {
  content: "→";
  font-weight: 400;
}

.feedback-send:hover,
.feedback-again:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
}

.feedback-send:focus-visible,
.feedback-again:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.feedback-send[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.feedback-send[disabled]::after {
  content: none;
}

.feedback-status {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: var(--text-2);
  font-size: 0.95rem;
  text-align: center;
}

.feedback-status.is-problem {
  color: var(--coral);
  font-weight: 700;
}

.feedback-done {
  display: grid;
  justify-items: center;
  padding: 44px 26px;
  text-align: center;
}

.feedback-done-mark {
  display: grid;
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in oklab, var(--mint) 16%, transparent);
  color: var(--mint);
}

.feedback-done-mark .icon {
  width: 38px;
  height: 38px;
}

.feedback-done h2 {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 420;
}

.feedback-done p {
  color: var(--text-2);
}

.feedback-done .feedback-again {
  width: auto;
  min-height: 48px;
  margin-top: 10px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
}

@media (prefers-reduced-motion: no-preference) {
  .feedback-done:not([hidden]) .feedback-done-mark {
    animation: done-pop 600ms var(--ease);
  }
}

@keyframes done-pop {
  from { opacity: 0; transform: scale(0.6); }
}

@media (min-width: 760px) {
  .feedback-card {
    padding: 34px 36px;
  }
}

@media (min-width: 1100px) {
  .feedback-layout {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
    gap: 80px;
    padding: calc(var(--header) + 100px) 0 140px;
  }

  .feedback-intro {
    position: sticky;
    top: calc(var(--header) + 60px);
    margin: 0;
    text-align: left;
  }

  .feedback-intro .label {
    justify-content: flex-start;
  }

  .feedback-intro .lead {
    margin-inline: 0;
  }

  .feedback-notes {
    margin-left: 0;
  }

  .feedback-forms {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .feedback-pill span {
    min-height: 70px;
    font-size: 0.84rem;
  }
}
