/* Rico aos Poucos — Fórum widget (aba Discussão) */
.rap-forum-root {
  width: 100%;
  padding: 12px 0 64px;
  color: #e2e8f0;
  font-family: inherit;
}
/* Neutraliza o header global do site (css/style.css) que se aplica a
   qualquer <header> da página — sem isso os headers dos widgets pegam
   background, borda e position:sticky herdados. */
.rap-forum-root header,
.rap-forum-root .rap-forum-header {
  background: transparent !important;
  border-bottom: 0 !important;
  position: static !important;
  backdrop-filter: none !important;
  padding: 0;
  margin: 0;
  top: auto;
  z-index: auto;
}
.rap-forum-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #f1f5f9;
}
.rap-forum-header .muted {
  color: #94a3b8;
  margin: 0 0 18px;
  font-size: 0.95rem;
}
.muted { color: #94a3b8; font-weight: normal; }

/* Login CTA */
.rap-forum-login {
  border: 1px dashed rgba(148,163,184,0.30);
  background: rgba(15,23,42,0.45);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  margin: 18px 0;
}
.rap-forum-login p { margin: 0 0 12px; }
.rap-forum-login p strong { color: #f1f5f9; font-size: 1.05rem; }

.rap-forum-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.rap-forum-btn:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.30);
}
.rap-forum-btn.primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  color: white;
}
.rap-forum-btn.primary:hover { filter: brightness(1.10); }
.rap-forum-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.rap-forum-link-btn {
  background: none;
  border: 0;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 6px;
  margin-top: 4px;
  text-decoration: underline;
}
.rap-forum-link-btn:hover { color: #f87171; }

/* Compose */
.rap-forum-compose {
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(15,23,42,0.55);
  border-radius: 14px;
  padding: 0;
  margin: 0 0 24px;
  overflow: hidden;
}
.rap-forum-compose summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  color: #c4b5fd;
  list-style: none;
}
.rap-forum-compose summary::-webkit-details-marker { display: none; }
.rap-forum-compose summary::before { content: '＋ '; font-weight: 700; }
.rap-forum-compose[open] summary::before { content: '× '; }
.rap-forum-compose form {
  padding: 4px 18px 18px;
  display: grid;
  gap: 12px;
}
.rap-forum-compose label,
.rap-forum-reply-form label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #cbd5e1;
}
.rap-forum-compose input,
.rap-forum-compose textarea,
.rap-forum-reply-form textarea {
  background: rgba(2,6,23,0.65);
  border: 1px solid rgba(148,163,184,0.30);
  color: #f1f5f9;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: normal;
  resize: vertical;
}
.rap-forum-compose textarea { min-height: 100px; }
.rap-forum-reply-form textarea { min-height: 80px; }
.rap-forum-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.rap-forum-form-footer .muted { font-size: 0.82rem; margin: 0; max-width: 60%; }

/* Lista de tópicos */
.rap-forum-topics {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.rap-forum-topic-item {
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(148,163,184,0.14);
  border-radius: 12px;
  transition: border-color .15s, transform .15s;
}
.rap-forum-topic-item:hover {
  border-color: rgba(196,181,253,0.45);
  transform: translateY(-1px);
}
.rap-forum-topic-open {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  color: inherit;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  padding: 16px 18px;
}
.rap-forum-topic-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: #f1f5f9;
}
.rap-forum-topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #94a3b8;
  font-size: 0.85rem;
}
.rap-forum-topic-meta strong { color: #c4b5fd; font-weight: 600; }

/* Detalhe */
.rap-forum-back {
  background: none;
  border: 0;
  color: #94a3b8;
  padding: 6px 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  margin-bottom: 12px;
}
.rap-forum-back:hover { color: #c4b5fd; }
.rap-forum-topic-full {
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 14px;
  padding: 22px 22px 18px;
  margin-bottom: 24px;
}
.rap-forum-topic-full header h2 {
  font-size: 1.4rem;
  margin: 0 0 8px;
  color: #f1f5f9;
}
.rap-forum-body {
  margin: 14px 0 8px;
  color: #e2e8f0;
  line-height: 1.55;
  font-size: 0.98rem;
  white-space: normal;
  word-break: break-word;
}
.rap-forum-body a {
  color: #c4b5fd;
  text-decoration: underline;
}
.rap-forum-owner-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148,163,184,0.18);
}
.rap-forum-owner-actions button {
  background: none;
  border: 1px solid rgba(248,113,113,0.40);
  color: #fca5a5;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}
.rap-forum-owner-actions button:hover {
  background: rgba(248,113,113,0.12);
}

.rap-forum-replies h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: #cbd5e1;
}
.rap-forum-reply {
  background: rgba(2,6,23,0.40);
  border-left: 3px solid rgba(99,102,241,0.50);
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 0 10px 10px 0;
}
.rap-forum-reply header {
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.rap-forum-reply header strong { color: #f1f5f9; }

.rap-forum-reply-form {
  margin-top: 18px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 14px;
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.rap-forum-empty {
  padding: 40px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.95rem;
}
.rap-forum-empty p { margin: 0 0 4px; }

.rap-forum-loading {
  padding: 40px;
  text-align: center;
  color: #94a3b8;
}

/* Toast */
.rap-forum-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border: 1px solid rgba(148,163,184,0.30);
  color: #f1f5f9;
  padding: 12px 20px;
  border-radius: 10px;
  z-index: 9999;
  font-size: 0.92rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.30);
  animation: rapForumToastIn .25s ease-out;
}
.rap-forum-toast.ok { border-color: rgba(34,197,94,0.50); color: #86efac; }
.rap-forum-toast.err { border-color: rgba(248,113,113,0.55); color: #fca5a5; }
@keyframes rapForumToastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 640px) {
  .rap-forum-root { padding: 8px 12px 80px; }
  .rap-forum-topic-full { padding: 16px 14px; }
  .rap-forum-topic-title { font-size: 1rem; }
}
