/* FAQ and feedback. Depends on base.css tokens. */

.faq {
  padding: calc(var(--nav-height) + 40px) 0 96px;
}

.faq__inner {
  max-width: 760px;
}

.faq__head {
  margin-bottom: 40px;
  text-align: center;
}

.faq__title {
  margin: 0;
  color: var(--text);
  font-size: clamp(32px, 4.7vw, 47px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.faq__i {
  position: relative;
  display: inline-block;
}

.faq__i::after,
.faq__dot {
  width: 0.21em;
  height: 0.21em;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6d5bd0);
}

.faq__i::after {
  content: "";
  position: absolute;
  left: calc(0.14em - 0.105em);
  top: calc(0.8833em - 0.7em - 0.105em);
}

.faq__dot {
  display: inline-block;
  margin-left: 0.07em;
}

.faq__sub {
  max-width: 460px;
  margin: 16px auto 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.55;
}

.faq__jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.faq__jump:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* Accordion: one card, hairline dividers, a plus that turns into a cross. */

.faq__list {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--bg);
  box-shadow:
    0 1px 2px rgba(22, 22, 26, 0.04),
    0 12px 36px -18px rgba(22, 22, 26, 0.14);
  overflow: hidden;
  interpolate-size: allow-keywords;
}

.q + .q {
  border-top: 1px solid var(--border);
}

.q summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  color: var(--text);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
  list-style: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.q summary::-webkit-details-marker {
  display: none;
}

.q summary:hover {
  background: var(--surface);
}

.q summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
  border-radius: 16px;
}

.q summary::after {
  content: "";
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    linear-gradient(var(--text-secondary), var(--text-secondary)) center / 11px 1.6px no-repeat,
    linear-gradient(var(--text-secondary), var(--text-secondary)) center / 1.6px 11px no-repeat,
    var(--surface);
  transition: transform 0.25s ease, background-color 0.2s ease;
}

.q[open] summary::after {
  transform: rotate(45deg);
  background-color: var(--accent-soft);
}

.q p {
  margin: 0;
  padding: 0 64px 22px 24px;
  color: var(--text-secondary);
  font-size: 15.5px;
  line-height: 1.65;
}

.q p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.q::details-content {
  height: 0;
  overflow: clip;
  transition: height 0.3s ease, content-visibility 0.3s allow-discrete;
}

.q[open]::details-content {
  height: auto;
}

/* Feedback card */

.fb {
  position: relative;
  margin-top: 56px;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    radial-gradient(100% 80% at 100% 100%, color-mix(in srgb, #6d5bd0 8%, transparent), transparent 60%),
    var(--bg);
  box-shadow:
    0 1px 2px rgba(22, 22, 26, 0.04),
    0 24px 60px -28px rgba(22, 22, 26, 0.22);
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.fb__title {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.fb__sub {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.fb__rate {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0 16px;
  padding: 0;
  border: 0;
}

.fb__face {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.fb__face input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fb__face span {
  font-size: 28px;
  line-height: 1;
  filter: grayscale(0.7);
  transition: filter 0.2s ease, transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.fb__face em {
  color: var(--text-muted);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 500;
}

.fb__face:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.fb__face:hover span {
  filter: none;
  transform: scale(1.12);
}

.fb__face:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.fb__face:has(input:checked) span {
  filter: none;
  transform: scale(1.18);
}

.fb__face:has(input:checked) em {
  color: var(--text);
}

.fb__face:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.fb__input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.fb__input::placeholder {
  color: var(--text-muted);
}

.fb__input:hover {
  background: var(--surface-alt);
}

.fb__input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.fb__text {
  display: block;
  min-height: 110px;
  resize: vertical;
  line-height: 1.55;
}

/* Message box: a white sheet with a gradient edge that wakes up on focus */
.fb__box {
  position: relative;
  padding: 1.5px;
  border-radius: 18px;
  background: linear-gradient(120deg, var(--border), var(--border));
  box-shadow: 0 10px 28px -20px rgba(22, 22, 26, 0.3);
  transition: box-shadow 0.3s ease;
}

.fb__box::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--accent), #6d5bd0 50%, #22d3ee, var(--accent));
  background-size: 250% 100%;
  opacity: 0;
  transition: opacity 0.35s ease;
  animation: fb-edge 6s linear infinite;
}

.fb__box:focus-within::before,
.fb__box.is-filled::before {
  opacity: 1;
}

.fb__box:focus-within {
  box-shadow:
    0 0 0 5px color-mix(in srgb, #6d5bd0 10%, transparent),
    0 18px 40px -22px color-mix(in srgb, #6d5bd0 55%, transparent);
}

@keyframes fb-edge {
  to { background-position: 250% 0; }
}

.fb__box .fb__text {
  position: relative;
  z-index: 1;
  min-height: 130px;
  padding: 18px 20px 34px;
  overflow: hidden;
  border: 0;
  border-radius: 16.5px;
  background: var(--bg);
  font-size: 15.5px;
  resize: none;
}

.fb__box .fb__text:hover,
.fb__box .fb__text:focus {
  border: 0;
  background: var(--bg);
  box-shadow: none;
}

.fb__count {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 2;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  transition: color 0.2s;
}

.fb__count.is-near {
  color: #c2410c;
}

@media (prefers-reduced-motion: reduce) {
  .fb__box::before { animation: none; }
}

.fb__row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.fb__row .fb__input {
  flex: 1 1 auto;
  height: 48px;
  border-radius: var(--radius-pill);
}

.fb__send {
  flex: none;
  height: 48px;
  padding: 0 22px;
}

.fb__error {
  margin: 12px 0 0;
  color: #c2410c;
  font-size: 14px;
}

.fb__done {
  display: grid;
  justify-items: center;
  padding: 20px 0 8px;
  text-align: center;
  outline: none;
  animation: fb-in 0.45s ease both;
}

.fb__done[hidden] {
  display: none;
}

.fb__check {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 10px 28px -10px rgba(34, 197, 94, 0.7);
}

.fb__check svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: fb-tick 0.45s ease 0.2s forwards;
}

@keyframes fb-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
}

@keyframes fb-tick {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .q::details-content,
  .fb__done,
  .fb__check svg {
    transition: none;
    animation: none;
    stroke-dashoffset: 0;
  }
}

@media (max-width: 640px) {
  .faq {
    padding-top: calc(var(--nav-height) + 24px);
  }

  .q summary {
    padding: 18px 18px;
    font-size: 15.5px;
  }

  .q p {
    padding: 0 18px 20px;
  }

  .fb {
    padding: 24px 18px;
  }

  .fb__rate {
    gap: 6px;
  }

  .fb__face {
    padding: 12px 2px 10px;
  }

  .fb__face span {
    font-size: 24px;
  }

  .fb__face em {
    font-size: 11px;
  }

  .fb__row {
    flex-direction: column;
  }

  .fb__send {
    width: 100%;
  }
}
