/**
 * Library feedback form — public-facing UI
 */
:root {
  --fb-navy: #163763;
  --fb-navy-deep: #002147;
  --fb-maroon: #800000;
  --fb-surface: #ffffff;
  --fb-bg: #eef2f8;
  --fb-text: #1e293b;
  --fb-muted: #64748b;
  --fb-border: #e2e8f0;
  --fb-radius: 18px;
  --fb-font: 'Poppins', 'Segoe UI', system-ui, sans-serif;
}

.fb-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--fb-font);
  color: var(--fb-text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(22, 55, 99, 0.18), transparent),
    linear-gradient(165deg, var(--fb-navy-deep) 0%, #0f2847 42%, #3d1520 100%);
}

.fb-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) 1.15rem 3rem;
}

.fb-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none !important;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s, color 0.2s;
}

.fb-back:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.18);
}

.fb-card {
  background: var(--fb-surface);
  border-radius: var(--fb-radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.fb-card__hero {
  padding: clamp(1.5rem, 4vw, 2rem) 1.75rem;
  text-align: center;
  color: #fff;
  background: linear-gradient(125deg, var(--fb-navy-deep) 0%, var(--fb-navy) 72%, var(--fb-maroon) 100%);
  position: relative;
}

.fb-card__hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

.fb-card__hero > * {
  position: relative;
  z-index: 1;
}

.fb-hero-icon {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 1.5rem;
}

.fb-card__hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.2rem, 3.2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.fb-card__hero p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  opacity: 0.92;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.fb-card__body {
  padding: clamp(1.35rem, 3vw, 2rem) 1.75rem 1.75rem;
}

.fb-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fb-muted);
}

.fb-step {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fb-step__dot {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  background: var(--fb-bg);
  border: 2px solid var(--fb-border);
  color: var(--fb-muted);
  transition: all 0.25s ease;
}

.fb-step.is-active .fb-step__dot {
  background: var(--fb-navy);
  border-color: var(--fb-navy);
  color: #fff;
}

.fb-step.is-done .fb-step__dot {
  background: rgba(22, 55, 99, 0.12);
  border-color: var(--fb-navy);
  color: var(--fb-navy);
}

.fb-step__line {
  width: 1.5rem;
  height: 2px;
  background: var(--fb-border);
}

.fb-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.fb-type-card {
  position: relative;
  border: 2px solid var(--fb-border);
  border-radius: 14px;
  padding: 1.35rem 1rem;
  text-align: center;
  cursor: pointer;
  background: #fafbfd;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.fb-type-card:hover {
  border-color: rgba(22, 55, 99, 0.35);
  transform: translateY(-2px);
}

.fb-type-card.is-active {
  border-color: var(--fb-navy);
  background: #fff;
  box-shadow: 0 10px 28px rgba(22, 55, 99, 0.12);
}

.fb-type-card.is-active::after {
  content: '\f00c';
  font-family: FontAwesome;
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 1.35rem;
  height: 1.35rem;
  line-height: 1.35rem;
  font-size: 0.65rem;
  text-align: center;
  color: #fff;
  background: var(--fb-maroon);
  border-radius: 50%;
}

.fb-type-card__icon {
  margin: 0 auto 0.85rem;
  line-height: 1;
}

/* Floating emoji badge */
.fb-emoji-float {
  position: relative;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(22, 55, 99, 0.12), rgba(128, 0, 0, 0.08));
  border: 1px solid rgba(22, 55, 99, 0.16);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
  animation: fbEmojiFloat 3.6s ease-in-out infinite;
  transform-origin: 50% 70%;
  user-select: none;
}

.fb-emoji-float__base,
.fb-emoji-float__hover {
  font-size: 1.65rem;
  transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
  line-height: 1;
}

.fb-emoji-float__hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(6px) scale(0.92);
}

.fb-type-card:hover .fb-emoji-float,
.fb-type-card:focus-visible .fb-emoji-float {
  animation-play-state: paused;
  transform: translateY(-2px) rotate(-3deg);
}

.fb-type-card:hover .fb-emoji-float__base,
.fb-type-card:focus-visible .fb-emoji-float__base {
  opacity: 0;
  transform: translateY(-6px) scale(0.92);
}

.fb-type-card:hover .fb-emoji-float__hover,
.fb-type-card:focus-visible .fb-emoji-float__hover {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.12));
}

@keyframes fbEmojiFloat {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(1.5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.fb-type-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fb-navy);
}

.fb-type-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--fb-muted);
}

.fb-section-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--fb-border);
}

.fb-section-head i {
  color: var(--fb-maroon);
  font-size: 1.1rem;
}

.fb-section-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fb-navy);
  letter-spacing: 0.02em;
}

.fb-field {
  margin-bottom: 1.15rem;
}

.fb-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--fb-navy);
}

.fb-label i {
  color: var(--fb-maroon);
  margin-right: 0.35rem;
  width: 1em;
  text-align: center;
}

.fb-label .req {
  color: #dc3545;
}

.fb-control {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--fb-font);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--fb-text);
  background: #fff;
  border: 1.5px solid var(--fb-border);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.fb-control:focus {
  border-color: var(--fb-navy);
  outline: none;
  box-shadow: 0 0 0 3px rgba(22, 55, 99, 0.12);
}

.fb-control[readonly] {
  background: var(--fb-bg);
  color: var(--fb-muted);
}

textarea.fb-control {
  min-height: 130px;
  resize: vertical;
}

input[type="file"].fb-control {
  height: auto;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.fb-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--fb-muted);
}

.fb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--fb-border);
}

.fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.4rem;
  font-family: var(--fb-font);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.fb-btn--primary {
  background: linear-gradient(135deg, var(--fb-navy) 0%, var(--fb-maroon) 100%);
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(22, 55, 99, 0.25);
}

.fb-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(22, 55, 99, 0.32);
  color: #fff !important;
}

.fb-btn--secondary {
  background: #fff;
  color: var(--fb-navy) !important;
  border-color: var(--fb-border);
}

.fb-btn--secondary:hover {
  background: var(--fb-bg);
  color: var(--fb-navy-deep) !important;
}

.fb-btn--ghost {
  background: transparent;
  color: var(--fb-muted) !important;
  border-color: transparent;
}

.fb-btn--ghost:hover {
  color: var(--fb-navy) !important;
  background: var(--fb-bg);
}

.hidden-step {
  display: none !important;
}

.fb-star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.15rem;
}

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

.fb-star-rating label {
  margin: 0;
  padding: 0.15rem 0.2rem;
  font-size: 1.85rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.fb-star-rating label:hover,
.fb-star-rating label:hover ~ label,
.fb-star-rating input:checked ~ label {
  color: #d97706;
}

.fb-star-rating label:hover {
  transform: scale(1.08);
}

@media (max-width: 540px) {
  .fb-type-grid {
    grid-template-columns: 1fr;
  }

  .fb-card__body {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .fb-step__label {
    display: none;
  }
}
