/* ═══════════════════════════════════════════════════════════
   FEEDBACK — pulsante sotto il logo + pannello con il form
   ═══════════════════════════════════════════════════════════ */

:root {
  --fb-logo-w: min(60vw, 460px);
  --fb-ink: #ffffff;
  --fb-muted: rgba(255, 255, 255, 0.62);
  --fb-line: rgba(255, 255, 255, 0.16);
  --fb-field: rgba(255, 255, 255, 0.07);
  --fb-panel: rgba(10, 16, 24, 0.78);
  --fb-font: Inter, "Helvetica Neue", Arial, sans-serif;
}

@media (min-width: 769px) and (orientation: landscape) {
  :root { --fb-logo-w: 280px; }
}

/* ── Pulsante sotto il logo ─────────────────────────────── */
.fb-cta {
  position: fixed;
  z-index: 3;
  top: calc(50% + var(--fb-logo-w) * 0.157 + 40px);
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  color: var(--fb-ink);
  font-family: var(--fb-font);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
  transition: background 180ms ease, border-color 180ms ease;
}

.fb-cta span { transition: transform 180ms ease; }

.fb-cta:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.8);
}

.fb-cta:hover span { transform: translateX(3px); }

.fb-cta:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 4px;
}

/* ── Overlay e pannello ─────────────────────────────────── */
.fb-overlay {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(5, 8, 12, 0.45);
  opacity: 0;
  transition: opacity 220ms ease;
}

.fb-overlay[hidden] { display: none; }
.fb-overlay.is-open { opacity: 1; }

.fb-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: auto 0;
  padding: 30px 24px 26px;
  color: var(--fb-ink);
  font-family: var(--fb-font);
  background: var(--fb-panel);
  border: 1px solid var(--fb-line);
  border-radius: 20px;
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transform: translateY(12px);
  transition: transform 260ms ease;
}

.fb-overlay.is-open .fb-panel { transform: none; }

.fb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--fb-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 50%;
}

.fb-close:hover { color: var(--fb-ink); background: var(--fb-field); }

/* ── Testi ──────────────────────────────────────────────── */
.fb-eyebrow {
  color: var(--fb-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fb-title {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.fb-lead {
  margin-top: 8px;
  color: var(--fb-muted);
  font-size: 14px;
  line-height: 1.45;
}

/* ── Campi ──────────────────────────────────────────────── */
.fb-form { display: flex; flex-direction: column; gap: 18px; }
.fb-form[hidden] { display: none; }
.fb-form > .fb-lead { margin-bottom: 4px; }

.fb-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border: 0;
}

.fb-field legend,
.fb-label {
  padding: 0;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.fb-label { margin-bottom: 0; }

.fb-field textarea,
.fb-field input[type="text"],
.fb-field input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  color: var(--fb-ink);
  font-family: var(--fb-font);
  font-size: 16px; /* 16px: evita lo zoom automatico su iPhone */
  line-height: 1.4;
  background: var(--fb-field);
  border: 1px solid var(--fb-line);
  border-radius: 12px;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.fb-field textarea { resize: vertical; min-height: 82px; }

.fb-field textarea:focus,
.fb-field input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.fb-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* chip selezionabili (ruolo e voto) */
.fb-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.fb-chips label { position: relative; cursor: pointer; }

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

.fb-chips span {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  background: var(--fb-field);
  border: 1px solid var(--fb-line);
  border-radius: 999px;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.fb-chips input:checked + span {
  color: #0a1018;
  font-weight: 600;
  background: var(--fb-ink);
  border-color: var(--fb-ink);
}

.fb-chips input:focus-visible + span {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.fb-scale { flex-wrap: nowrap; gap: 6px; }
.fb-scale label { flex: 1; }
.fb-scale span { width: 100%; padding: 0; }

.fb-scale-hint {
  display: flex;
  justify-content: space-between;
  color: var(--fb-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.fb-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}

.fb-check input {
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: #ffffff;
}

.fb-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.fb-privacy {
  color: var(--fb-muted);
  font-size: 12px;
  line-height: 1.4;
}

.fb-submit {
  width: 100%;
  min-height: 50px;
  color: #0a1018;
  font-family: var(--fb-font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: var(--fb-ink);
  border: 0;
  border-radius: 999px;
  transition: opacity 160ms ease;
}

.fb-submit:hover { opacity: 0.88; }
.fb-submit:disabled { opacity: 0.5; cursor: wait; }

.fb-status {
  min-height: 1em;
  color: var(--fb-muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.fb-status.is-error { color: #ffb4a8; }
.fb-status a { color: var(--fb-ink); }

.fb-done { display: flex; flex-direction: column; gap: 4px; }
.fb-done[hidden] { display: none; }
.fb-done .fb-submit { margin-top: 22px; }

/* quando il pannello è aperto il logo e il pulsante si fanno da parte */
body.fb-is-open .fb-cta { opacity: 0; pointer-events: none; }

@media (max-width: 480px) {
  .fb-cta { font-size: 13px; padding: 12px 18px; }
  .fb-panel { padding: 26px 18px 22px; border-radius: 18px; }
  .fb-title { font-size: 22px; }
  .fb-row { grid-template-columns: 1fr; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .fb-cta { top: auto; bottom: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .fb-overlay, .fb-panel, .fb-cta, .fb-cta span { transition: none; }
}
