/* The feedback form (js/feedback.js): a slip taped onto the page, with lines to write on. Used on the notebook's last
   page (index.html, page 4) and on the page of its own (feedback/). */

.fb {
  --fb-text: #16223f; --fb-soft: #3a4566; --fb-pen: #1b2a6b; --fb-ball: #2a47b0; --fb-line: rgba(29, 47, 107, 0.45); --fb-bad: #a3271b;
  position: relative; box-sizing: border-box; width: min(100% - 32px, 49.5rem); margin: 0 auto; color-scheme: light;
  padding: clamp(28px, 4vw, 44px) clamp(20px, 4vw, 44px);
  color: var(--fb-text); background: #fcf9f1; border-radius: 3px;
  box-shadow: 0 1px 2px rgba(22, 34, 63, 0.12), 0 22px 44px -20px rgba(22, 34, 63, 0.5);
  font: 400 1.04rem/1.5 "Libre Caslon Text", Georgia, serif;
}
.fb::before {
  content: ""; position: absolute; top: -13px; left: 50%; width: 104px; height: 26px; translate: -50% 0; rotate: -2deg;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 6px), rgba(233, 223, 191, 0.86);
  clip-path: polygon(3% 0, 97% 3%, 100% 26%, 97% 50%, 100% 76%, 97% 100%, 3% 97%, 0 74%, 3% 50%, 0 24%);
}
.fb *, .fb *::before { box-sizing: border-box; }
.fb [hidden] { display: none; }
.fb a { color: var(--fb-ball); text-underline-offset: 0.2em; }
.fb p { max-width: none; margin: 0; font-size: inherit; line-height: inherit; }
.fb :focus-visible { outline: 2px solid var(--fb-ball); outline-offset: 2px; border-radius: 6px; }

.fb__kinds { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
.fb__kinds legend, .fb__field label { display: block; padding: 0; margin: 0 0 6px; }
.fb__field label span { color: var(--fb-soft); font-style: italic; }
.fb__row { display: flex; flex-wrap: wrap; gap: 8px; }
.fb__kind { position: relative; display: flex; align-items: center; min-height: 48px; padding: 0 16px 0 14px; border: 1px solid var(--fb-line); border-radius: 999px; transition: border-color 0.2s ease, background-color 0.2s ease; }
.fb__kind:hover { border-color: var(--fb-ball); }
.fb__kind.is-on { border-color: var(--fb-ball); background: rgba(42, 71, 176, 0.08); }
.fb__kind input { width: 18px; height: 18px; margin: 0 9px 0 0; accent-color: var(--fb-ball); }
.fb__kind label { cursor: pointer; }
.fb__kind label::after { content: ""; position: absolute; inset: 0; }   /* the whole pill is its label */
.fb__kind input:focus-visible { border-radius: 50%; }

.fb .fb__hint { margin: -3px 0 8px; font-size: 0.92rem; line-height: 1.4; color: var(--fb-soft); }
.fb__field { margin: 0 0 20px; }
.fb__field textarea, .fb__field input, .fb__field select {
  display: block; width: 100%; min-height: 48px; padding: 8px 12px;
  font: 400 1.04rem/1.3 "Libre Caslon Text", Georgia, serif; color: var(--fb-text);
  background-color: #fff; border: 1px solid var(--fb-line); border-radius: 6px;
}
/* lines to write on: they move with the words */
.fb__field textarea {
  min-height: calc(32px * 6 + 10px); padding: 0 14px 8px; line-height: 32px; resize: vertical;
  background-image: linear-gradient(transparent 31px, rgba(110, 150, 205, 0.42) 31px); background-size: 100% 32px; background-attachment: local;
}
.fb__field select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%232a47b0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: right 13px center;
}
.fb__field :is(textarea, input, select):focus-visible { outline: 2px solid var(--fb-ball); outline-offset: 1px; border-color: transparent; }
.fb__field [aria-invalid] { border-color: var(--fb-bad); }
.fb__two { display: grid; grid-template-columns: 1fr 1.25fr; gap: 0 20px; align-items: end; }
.fb__two .fb__field { margin-bottom: 0; align-self: start; display: grid; grid-template-rows: subgrid; grid-row: span 3; }
.fb .fb__err { margin: 5px 0 0; font-size: 0.94rem; line-height: 1.4; color: var(--fb-bad); }
.fb .fb__left { margin: 5px 0 0; font-size: 0.9rem; color: var(--fb-soft); text-align: right; }
.fb :is(.fb__err, .fb__left, .fb__msg):empty { display: none; }
.fb .fb__msg { margin: 18px 0 0; color: var(--fb-bad); }
.fb__trap { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.fb__row--send { align-items: center; flex-wrap: nowrap; gap: 12px 24px; margin-top: 24px; }
.fb__send {
  flex: none; min-height: 48px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer;
  font: 400 1.04rem/1 "Libre Caslon Text", Georgia, serif; color: #f7f1e3; background: #1f3a8a; white-space: nowrap;
  transition: background-color 0.2s ease;
}
.fb__send:hover { background: #2a47b0; }
.fb__send:disabled { opacity: 0.65; cursor: progress; }
.fb .fb__send:focus-visible { outline-offset: 3px; border-radius: 999px; }
.fb .fb__small { font-size: 0.9rem; line-height: 1.45; color: var(--fb-soft); }

.fb__thanks { padding: 12px 0 4px; text-align: center; }
.fb__thanks h2.pen { margin: 0 0 0.1em; font-size: clamp(2.6rem, 5vw, 3.8rem); color: var(--fb-pen); outline: none; }
.fb__again { margin-top: 14px; padding: 12px 10px; border: 0; background: none; cursor: pointer; font: italic 400 1.02rem/1.2 "Libre Caslon Text", Georgia, serif; color: var(--fb-ball); }
.fb__again:hover { text-decoration: underline; text-underline-offset: 0.25em; }

/* on the notebook's page 4 */
.home #p4 .home__intro { padding-bottom: clamp(34px, 6vh, 60px); }
.home #p4 h1.pen { font-size: clamp(2.9rem, 6.6vw, 5rem); margin-top: clamp(20px, 4vh, 44px); }

@media (max-width: 639px) {
  .fb__two { grid-template-columns: 1fr; gap: 20px; }
  .fb__two .fb__field { display: block; grid-row: auto; }
  .fb__row:not(.fb__row--send) { display: grid; grid-template-columns: 1fr; }
  .fb__row--send { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .fb * { transition: none !important; } }
