:root {
  --primary: #7f5bd6;
  --primary-dark: #6745bf;
  --primary-soft: #efe8ff;

  --bg: #faf7fd;
  --bg-soft: #f6f1fb;
  --card: #ffffff;

  --text: #463b67;
  --text-soft: #7d7394;
  --text-muted: #9a91ad;

  --border: #e7def5;
  --border-strong: #d9ccf0;

  --success-bg: #e9f8ef;
  --success-text: #237548;
  --danger-bg: #fdeaea;
  --danger-text: #b23a3a;
  --warning-bg: #fff4df;
  --warning-text: #9b6d05;

  --shadow-sm: 0 6px 18px rgba(93, 66, 155, 0.06);
  --shadow-md: 0 14px 34px rgba(103, 76, 168, 0.10);
  --shadow-lg: 0 22px 60px rgba(103, 76, 168, 0.12);

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --topbar-height: 88px;
  --content-width: 980px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(214, 194, 250, 0.25), transparent 22%),
    radial-gradient(circle at bottom right, rgba(241, 223, 255, 0.20), transparent 22%),
    linear-gradient(180deg, #fcfafe 0%, #f6f2fb 100%);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Topbar ===== */
.topbar {
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: linear-gradient(135deg, #eadcf8 0%, #dfd0f4 100%);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.topbar-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #ece3f8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(114, 83, 181, 0.08);
  flex-shrink: 0;
}

.brand-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-kicker {
  font-size: 0.84rem;
  font-weight: 600;
  color: #8a7fa6;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 1.65rem;
  line-height: 1.08;
  color: #5d36a8;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.menu {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.menu-link {
  height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.96rem;
  color: #6a4cbc;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #dccdf2;
  transition: 0.2s ease;
  white-space: nowrap;
}

.menu-link:hover {
  background: #fff;
  color: #56369f;
  transform: translateY(-1px);
}

.menu-link--ghost {
  background: transparent;
}

.menu-link--highlight {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 24px rgba(111, 79, 176, 0.16);
}

.menu-link--highlight:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  filter: brightness(1.03);
}

/* ===== Main ===== */
.main-content {
  flex: 1;
  width: 100%;
  padding: 34px 18px 38px;
  position: relative;
}

/* ===== Hero ===== */
.hero {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto 20px;
}

.hero-card {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid #eee6fa;
  border-radius: 24px;
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero-text {
  max-width: 720px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 2.4rem;
  color: var(--primary-dark);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.hero-action {
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.96rem;
  transition: 0.2s ease;
  white-space: nowrap;
}

.hero-action--primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 14px 24px rgba(111, 79, 176, 0.18);
}

.hero-action--primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.hero-action--secondary {
  background: #fff;
  border: 1px solid #e2d6f5;
  color: #6544bd;
}

.hero-action--secondary:hover {
  background: #faf6ff;
}

/* ===== Flash ===== */
.flash-messages {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto 18px;
}

.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-weight: 600;
  text-align: center;
  border: 1px solid transparent;
}

.alert.success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #cfe9d9;
}

.alert.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: #f2c7c7;
}

.alert.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: #efd9a9;
}

/* ===== Feed ===== */
.feed-shell {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ===== States ===== */
.public-state {
  margin-bottom: 20px;
}

.state-card {
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid #ece3f8;
  border-radius: 24px;
  padding: 34px 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.state-card h2 {
  margin: 12px 0 8px;
  font-size: 1.45rem;
  color: var(--text);
}

.state-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.state-icon {
  font-size: 2rem;
  color: #8a75c7;
}

#public-error {
  background: #fdeaea;
  color: #b23a3a;
  border: 1px solid #f2c7c7;
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 600;
}

.loader {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid #eadfff;
  border-top-color: var(--primary-dark);
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Posts ===== */
.post {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  border: 1px solid #ece3f8;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .25s ease, transform .25s ease, box-shadow .25s ease;
}

.post.show {
  opacity: 1;
  transform: translateY(0);
}

.post:hover {
  box-shadow: var(--shadow-lg);
}

.post-image-wrap {
  width: 100%;
  background: #f7f2ff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  border-bottom: 1px solid #efe6fb;
}

.post-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.post-content-wrap {
  padding: 22px 24px 20px;
}

.post-header {
  margin-bottom: 10px;
}

.post-title {
  margin: 0;
  font-size: 1.45rem;
  color: #4c3391;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.post-content {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.75;
  word-break: break-word;
}

.post-content a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}

.post-content a:hover {
  text-decoration: underline;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #7a7390;
  font-size: 0.88rem;
  margin-bottom: 18px;
}

.post-author strong {
  color: #655a80;
}

.post-category {
  background: #efe9ff;
  color: #5b3ec4;
  border: 1px solid #e1d7ff;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}

.post-date {
  color: #8f84a8;
}

/* ===== Actions ===== */
.post-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.like-btn,
.comment-btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.like-btn {
  background: #f7f2ff;
  color: #6b4dc0;
}

.like-btn:hover {
  background: #eee5ff;
}

.like-btn.liked {
  background: #ffe6ee;
  color: #cc476e;
}

.like-btn .like-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.like-btn .like-icon i {
  font-size: 0.95rem;
}

.like-count,
.comment-count {
  background: rgba(255, 255, 255, 0.75);
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
}

.comment-btn {
  background: #efe9ff;
  color: #5b3ec4;
}

.comment-btn:hover:not(:disabled) {
  background: #e6dcff;
}

.comment-btn.disabled,
.comment-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ===== Comments ===== */
.comments {
  margin-top: 16px;
  border-top: 1px solid #f0eaf8;
  padding-top: 16px;
  display: none;
}

.comments.open {
  display: block;
}

.comment-form {
  background: #faf7ff;
  border: 1px solid #ece2fb;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
}

.comment-form-row {
  margin-bottom: 12px;
}

.comment-name,
.comment-text {
  width: 100%;
  border: 1px solid #ddd0f3;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
  transition: 0.2s ease;
}

.comment-name:focus,
.comment-text:focus {
  border-color: #b79cf0;
  box-shadow: 0 0 0 4px rgba(127, 91, 214, 0.12);
}

.comment-text {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.comment-counter {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.comment-submit {
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: 0.2s ease;
}

.comment-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.comment-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-item {
  background: #faf8fd;
  border: 1px solid #f1eaff;
  border-radius: 12px;
  padding: 12px 14px;
}

.comment-item.pending {
  opacity: 0.72;
}

.comment-item.failed {
  border-color: #f0c9c9;
  background: #fff6f6;
}

.comment-meta {
  font-size: 0.78rem;
  color: #7a7390;
  margin-bottom: 6px;
}

.comment-body {
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}

.comment-body a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}

.comment-body a:hover {
  text-decoration: underline;
}

.comments-loading,
.comments-error,
.empty {
  color: #8a82a0;
  font-size: 0.94rem;
}

.comments-error {
  color: #c11;
}

/* ===== Pagination ===== */
.public-pagination {
  margin-top: 26px;
}

.pagination-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.page-btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #dfd3f3;
  background: #fff;
  color: #6849bf;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  background: #faf6ff;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-info {
  color: var(--text-soft);
  font-weight: 500;
}

/* ===== WhatsApp ===== */
.whatsapp-btn {
  position: fixed;
  right: 22px;
  bottom: 24px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2ad06f 0%, #17b957 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.9rem;
  box-shadow: 0 18px 30px rgba(23, 185, 87, 0.28);
  z-index: 1000;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.whatsapp-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.whatsapp-tooltip {
  position: fixed;
  right: 96px;
  bottom: 40px;
  background: rgba(70, 59, 103, 0.95);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.3;
  box-shadow: var(--shadow-md);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 0.2s ease;
}

.whatsapp-btn:hover + .whatsapp-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(70, 59, 103, 0.95);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 1200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Footer ===== */
.site-footer {
  flex-shrink: 0;
  background: #f7f2ff;
  border-top: 1px solid #e5d7ff;
  color: #6C4EB6;
  padding: 14px 0;
}

.site-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.6;
  font-size: 13.5px;
  text-align: center;
}

.site-footer .brand {
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.site-footer .sep {
  opacity: .6;
  color: #6C4EB6;
  padding: 0 4px;
}

.site-footer em {
  color: #8a78d1;
  font-style: normal;
  font-weight: 600;
}

/* ===== Responsivo ===== */
@media (max-width: 980px) {
  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .hero h1 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 16px 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .menu {
    width: 100%;
  }

  .main-content {
    padding: 24px 12px 28px;
  }

  .hero-card {
    padding: 22px 18px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .brand-text strong {
    font-size: 1.35rem;
  }

  .post-content-wrap {
    padding: 18px;
  }

  .post-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .like-btn,
  .comment-btn,
  .hero-action {
    width: 100%;
    justify-content: center;
  }

  .comment-form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .comment-submit {
    width: 100%;
  }

  .whatsapp-btn {
    width: 58px;
    height: 58px;
    right: 16px;
    bottom: 20px;
    font-size: 1.7rem;
  }

  .whatsapp-tooltip {
    display: none;
  }
}

@media (max-width: 520px) {
  .site-footer .footer-inner {
    font-size: 12.5px;
  }

  .site-footer .sep {
    display: none;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand-logo img {
    width: 28px;
    height: 28px;
  }

  .menu-link {
    width: 100%;
    justify-content: center;
  }
}