:root {
  --orange: #ff7a18;
  --coral: #ff4d6d;
  --purple: #7b2ff7;
  --purple-dark: #4a1d96;
  --ink: #2d2440;
  --ink-soft: #6f6584;
  --bg: #faf7ff;
  --card: #ffffff;
  --line: #eee6fa;
  --gradient: linear-gradient(120deg, var(--orange), var(--coral) 45%, var(--purple));
  --shadow: 0 10px 30px rgba(123, 47, 247, 0.10);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--gradient);
  color: #fff;
  padding: 3.2rem 1.2rem 4.2rem;
  clip-path: ellipse(140% 100% at 50% 0%);
}
.hero-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  text-decoration: none;
  padding: 0.3rem 0.95rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  margin: 0.9rem 0 0.5rem;
  text-shadow: 0 2px 14px rgba(74, 29, 150, 0.35);
}
.hero-sub {
  max-width: 560px;
  margin: 0 auto 1.4rem;
  font-size: 1.05rem;
  opacity: 0.95;
}
.hero-nav { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }
.hero-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: background 0.2s, transform 0.2s;
}
.hero-nav a:hover { background: rgba(255, 255, 255, 0.28); transform: translateY(-2px); }

/* ---------- Layout ---------- */
.container { max-width: 760px; margin: -2.2rem auto 3rem; padding: 0 1.2rem; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 1.4rem 1.5rem;
}

/* ---------- Compose form ---------- */
.compose h2 { margin: 0 0 1rem; font-size: 1.25rem; }
.field { margin-bottom: 0.9rem; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
input[type="text"], input[type="password"], textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font: inherit;
  color: var(--ink);
  background: #fdfcff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(123, 47, 247, 0.12);
}
textarea { resize: vertical; min-height: 90px; }
.char-count { text-align: right; font-size: 0.75rem; color: var(--ink-soft); margin-top: 0.2rem; }

.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.form-hint { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }
.form-error {
  margin-top: 0.8rem;
  background: #fff1f2;
  border: 1px solid #ffd0d6;
  color: #c2183b;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

.btn {
  font: inherit;
  font-weight: 800;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.btn-primary {
  background: var(--gradient);
  color: #fff;
  padding: 0.7rem 1.6rem;
  box-shadow: 0 6px 18px rgba(255, 77, 109, 0.35);
}
.btn-small {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  background: var(--purple);
  color: #fff;
}
.btn-approve { background: #16a34a; }
.btn-reject { background: #dc2626; }

/* ---------- Feed ---------- */
.feed { margin-top: 2rem; }
.feed-title { font-size: 1.25rem; margin-bottom: 1rem; }
.post { margin-bottom: 1.1rem; animation: fadeIn 0.4s ease both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.post-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.avatar {
  width: 42px; height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.avatar-host { background: linear-gradient(120deg, var(--purple), var(--purple-dark)); width: 34px; height: 34px; font-size: 0.9rem; }
.post-name { font-weight: 800; display: block; }
.post-date { font-size: 0.75rem; color: var(--ink-soft); display: block; }
.post-content { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- Replies ---------- */
.replies { margin-top: 0.4rem; }
.reply {
  margin-top: 0.8rem;
  margin-left: 1.4rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(120deg, rgba(255, 122, 24, 0.06), rgba(123, 47, 247, 0.08));
  border-left: 3px solid var(--purple);
  border-radius: 0 12px 12px 0;
}
.reply-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; flex-wrap: wrap; }
.reply .post-name, .reply .post-date { display: inline; }
.badge-host {
  background: var(--purple);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.reply-form { display: flex; gap: 0.6rem; margin-top: 0.9rem; }
.reply-form input { flex: 1; }

.empty-state { text-align: center; color: var(--ink-soft); }

/* ---------- Flash & login ---------- */
.flash-messages { margin-bottom: 1rem; }
.flash {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}
.login-card { max-width: 420px; margin: 2rem auto; }
.login-card h2 { margin-top: 0; }

/* ---------- Moderation ---------- */
.mod-section { margin-top: 2rem; }
.mod-section h2 { font-size: 1.15rem; }
.count {
  background: var(--purple);
  color: #fff;
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0.1rem 0.6rem;
  vertical-align: middle;
}
.mod-post { margin-bottom: 0.9rem; }
.mod-post .post-head { justify-content: flex-start; }
.status-pill {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}
.pill-pending { background: #fef3c7; color: #92400e; }
.pill-approved { background: #dcfce7; color: #166534; }
.pill-review { background: #ede9fe; color: #5b21b6; }
.pill-rejected { background: #fee2e2; color: #991b1b; }
.mod-actions { display: flex; gap: 0.6rem; margin-top: 0.8rem; }
.mod-empty { color: var(--ink-soft); font-size: 0.9rem; }
.mod-hint { color: var(--ink-soft); font-size: 0.82rem; margin: 0.2rem 0 0.8rem; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 2rem 1rem 2.5rem;
}

@media (max-width: 540px) {
  .container { margin-top: -1.6rem; }
  .card { padding: 1.1rem 1rem; }
  .reply { margin-left: 0.6rem; }
}
