/* Feedback SPA styles. Shares the visual language of /q/ (quick-questions):
   Inter, gradient hero (#00AAEB -> #97C539), card components. Adds the feedback
   form pieces: blue section bars (like the paper form), likert rows, boolean
   rows, text/name inputs, and the anonymous toggle + explainer. */

:root { color-scheme: light; }
html, body { margin: 0; padding: 0; background: #f5f7fa; -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #0f172a;
  line-height: 1.4;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

#root {
  max-width: 620px;
  margin: 0 auto;
  padding: 8px;
}

/* screen reader only */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- screens ---------- */
.screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- hero (intro / message / done) ---------- */
.hero {
  background: linear-gradient(135deg, #00AAEB 0%, #97C539 100%);
  padding: 18px 18px 20px;
  border-radius: 16px;
  color: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
}
.hero.hero-success {
  background: linear-gradient(135deg, #97C539 0%, #5fb45a 100%);
}
.hero-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.hero-subtitle {
  margin-top: 8px;
  font-size: 14.5px;
  opacity: 0.96;
  white-space: pre-wrap;
}

/* ---------- generic card ---------- */
.card {
  border: 1px solid #e2e8f0;
  padding: 14px;
  border-radius: 14px;
  background: white;
}
.card-title {
  font-weight: 800;
  font-size: 15px;
  color: #0f172a;
}
.card-body {
  margin-top: 6px;
  font-size: 13.5px;
  color: #334155;
}
.card.warning {
  background: #fff1f2;
  border-color: #fecdd3;
}
.warning-title {
  font-weight: 800;
  font-size: 15px;
  color: #b91c1c;
}
.warning-body {
  margin-top: 4px;
  font-size: 13.5px;
  color: #7f1d1d;
}

/* ---------- identity fields (name / trainer) ---------- */
.fields-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: opacity 140ms ease;
}
.field.is-dimmed {
  opacity: 0.5;
}
.field label {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}
.field label .opt {
  font-weight: 500;
  color: #94a3b8;
}
.fb-input {
  width: 100%;
  padding: 11px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  color: #0f172a;
  background: white;
}
.fb-input:focus-visible {
  outline: none;
  border-color: #00AAEB;
  box-shadow: 0 0 0 3px rgba(0, 170, 235, 0.18);
}
.fb-input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

/* ---------- anonymous toggle + explainer ---------- */
.anon-card {
  background: #f8fafc;
}
.anon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.anon-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  color: #0f172a;
}
.anon-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #00AAEB;
  cursor: pointer;
  flex: 0 0 auto;
}
.info-btn {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: white;
  color: #475569;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.info-btn:hover { border-color: #00AAEB; color: #00AAEB; }
.info-btn:focus-visible {
  outline: none;
  border-color: #00AAEB;
  box-shadow: 0 0 0 3px rgba(0, 170, 235, 0.20);
}
.anon-explainer {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #eef6fc;
  border: 1px solid #cfe8f7;
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}

/* ---------- questions + section bars ---------- */
.questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* blue section header, like the paper form's blue bars */
.section-bar {
  background: linear-gradient(90deg, #00AAEB, #0095cc);
  color: white;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 4px;
}
.section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fb-question {
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fb-prompt {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.fb-prompt .req { color: #ef4444; margin-left: 2px; }

/* info block (input_type=info) — a plain callout, no input */
.fb-info {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.fb-info-text {
  font-size: 13.5px;
  color: #334155;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- likert row ---------- */
.likert-row {
  display: flex;
  gap: 6px;
}
.likert-cell {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 4px 8px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 60ms ease;
  min-height: 78px;
}
.likert-cell:hover { border-color: #cbd5e1; background: #f8fafc; }
.likert-cell:active { transform: scale(0.97); }
.likert-cell:focus-visible {
  outline: none;
  border-color: #00AAEB;
  box-shadow: 0 0 0 3px rgba(0, 170, 235, 0.18);
}
.likert-cell.selected {
  border-color: #00AAEB;
  background: linear-gradient(90deg, rgba(0, 170, 235, 0.07), rgba(151, 197, 57, 0.07));
}
.likert-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: white;
  position: relative;
  flex: 0 0 auto;
}
.likert-cell.selected .likert-dot { border-color: #00AAEB; }
.likert-cell.selected .likert-dot::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 9px; height: 9px;
  border-radius: 999px;
  background: #00AAEB;
}
.likert-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-align: center;
  line-height: 1.2;
}
.likert-cell.selected .likert-label { color: #0f172a; }

/* ---------- choice option cards ---------- */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.4;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 60ms ease, box-shadow 140ms ease;
  min-height: 50px;
}
.option-card:hover { border-color: #cbd5e1; background: #f8fafc; }
.option-card:active { transform: scale(0.985); }
.option-card:focus-visible {
  outline: none;
  border-color: #00AAEB;
  box-shadow: 0 0 0 3px rgba(0, 170, 235, 0.18);
}
.option-card.selected {
  border-color: #00AAEB;
  background: linear-gradient(90deg, rgba(0, 170, 235, 0.07), rgba(151, 197, 57, 0.07));
  box-shadow: 0 2px 6px rgba(0, 170, 235, 0.10);
}
.option-radio {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: white;
  position: relative;
  transition: border-color 140ms ease;
}
.option-card.selected .option-radio { border-color: #00AAEB; }
.option-card.selected .option-radio::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  border-radius: 999px;
  background: #00AAEB;
}
.option-text {
  flex: 1 1 auto;
  font-weight: 500;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- boolean row ---------- */
.bool-row {
  display: flex;
  gap: 10px;
}
.bool-btn {
  flex: 1 1 0;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 60ms ease;
  min-height: 48px;
}
.bool-btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.bool-btn:active { transform: scale(0.985); }
.bool-btn:focus-visible {
  outline: none;
  border-color: #00AAEB;
  box-shadow: 0 0 0 3px rgba(0, 170, 235, 0.18);
}
.bool-btn.selected {
  border-color: #00AAEB;
  color: #00AAEB;
  background: linear-gradient(90deg, rgba(0, 170, 235, 0.07), rgba(151, 197, 57, 0.07));
}

/* ---------- textarea ---------- */
.fb-textarea {
  width: 100%;
  padding: 11px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  color: #0f172a;
  background: white;
  resize: vertical;
  min-height: 92px;
  line-height: 1.45;
}
.fb-textarea:focus-visible {
  outline: none;
  border-color: #00AAEB;
  box-shadow: 0 0 0 3px rgba(0, 170, 235, 0.18);
}

/* ---------- buttons ---------- */
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.btn {
  flex: 1 1 0;
  padding: 13px 16px;
  border-radius: 12px;
  border: none;
  font-size: 15.5px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: background 140ms ease, opacity 140ms ease, transform 60ms ease;
  min-height: 48px;
}
.btn:active { transform: scale(0.985); }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 170, 235, 0.30);
}
.btn-lg { padding: 14px 18px; font-size: 16px; }
.btn-primary { background: #00AAEB; color: white; }
.btn-primary:hover { background: #0095cc; }
.btn:disabled {
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------- footer hint ---------- */
.footer-hint {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

/* ---------- spinner ---------- */
@keyframes fb-spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(0, 170, 235, 0.25);
  border-top-color: #00AAEB;
  border-radius: 50%;
  animation: fb-spin 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

/* ---------- narrow phones: stack likert labels ---------- */
@media (max-width: 420px) {
  .likert-row { gap: 4px; }
  .likert-cell { padding: 8px 2px 6px; min-height: 72px; }
  .likert-label { font-size: 10px; }
}
