/* ============================================================
   Bangla Kobita Official — styles
   Warm paper palette, Noto Serif Bengali headings,
   Hind Siliguri body text. Mobile-first, responsive.
   ============================================================ */

:root {
  --paper: #faf5ea;
  --paper-deep: #f3ead7;
  --card: #fffdf7;
  --ink: #2b2118;
  --ink-soft: #5d4c3a;
  --ink-faint: #8a7a66;
  --line: #e5d9c3;
  --accent: #8c2f39;
  --accent-dark: #6e242c;
  --accent-soft: #f6e3e0;
  --gold: #c9a227;
  --gold-soft: #f7ecd0;
  --green: #2e6b34;
  --red: #b3261e;
  --shadow: 0 2px 10px rgba(60, 40, 20, 0.08);
  --shadow-lg: 0 8px 28px rgba(60, 40, 20, 0.14);
  --radius: 14px;
  --font-serif: "Noto Serif Bengali", "Hind Siliguri", serif;
  --font-body: "Hind Siliguri", "Noto Serif Bengali", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.4; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
button { font-family: var(--font-body); cursor: pointer; }
input, textarea, select { font-family: var(--font-body); font-size: 1rem; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 245, 234, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.5rem; font-weight: 800;
  box-shadow: var(--shadow);
}
.brand small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.main-nav { display: flex; gap: 4px; margin-left: 6px; flex-wrap: wrap; }
.main-nav a {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 7px 11px;
  border-radius: 999px;
}
.main-nav a:hover { background: var(--paper-deep); text-decoration: none; }
.main-nav a.active { background: var(--accent-soft); color: var(--accent); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Language switcher */
.lang-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}
.lang-switch button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.lang-switch button.active { background: var(--accent); color: #fff; }

/* Buttons */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  text-align: center;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-outline {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}
.btn-outline:hover { background: var(--accent-soft); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn-ghost:hover { background: var(--paper-deep); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #8f1d17; }
.btn-block { display: block; width: 100%; }

/* Google button — label stays in English by design */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.btn-google:hover { background: #f8f9fa; }
.btn-google svg { flex: 0 0 auto; }

/* User chip */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}
.user-chip .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.user-menu { position: relative; }
.user-menu .menu {
  position: absolute;
  right: 0; top: calc(100% + 6px);
  min-width: 190px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 60;
}
.user-menu.open .menu { display: block; }
.user-menu .menu a, .user-menu .menu button {
  display: block; width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 0; background: none;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
}
.user-menu .menu a:hover, .user-menu .menu button:hover {
  background: var(--paper-deep);
  text-decoration: none;
}

/* ---------- Config banner ---------- */
.config-banner {
  background: #fff3cd;
  color: #664d03;
  border-bottom: 1px solid #ffecb5;
  padding: 9px 18px;
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- Main / hero ---------- */
.view { min-height: 60vh; padding: 26px 0 60px; }
.hero {
  background: linear-gradient(135deg, var(--accent-soft), var(--gold-soft));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 38px 30px;
  text-align: center;
  margin-bottom: 28px;
}
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin-bottom: 8px; }
.hero p { color: var(--ink-soft); max-width: 640px; margin: 0 auto 20px; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-stats { margin-top: 20px; }
.stat-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 20px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 1.45rem;
  margin: 26px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Search & categories ---------- */
.toolbar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.search-box { position: relative; }
.search-box input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  outline: none;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box .search-icon {
  position: absolute; left: 15px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 1.05rem;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 0.9rem;
  font-weight: 600;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-count { opacity: 0.75; font-weight: 600; }

/* ---------- Featured poem ---------- */
.featured {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.featured .quote-mark {
  font-family: var(--font-serif);
  font-size: 3rem;
  line-height: 0.6;
  color: var(--gold);
  display: block;
  margin-bottom: 6px;
}
.featured h2 { font-size: 1.6rem; margin-bottom: 4px; }
.featured .poem-meta { color: var(--ink-faint); font-size: 0.9rem; margin-bottom: 12px; }
.featured .poem-excerpt {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  color: var(--ink-soft);
  white-space: pre-line;
  margin-bottom: 16px;
}

/* ---------- Poem cards ---------- */
.poem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.poem-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.poem-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.poem-card h3 { font-size: 1.22rem; margin-bottom: 2px; }
.poem-card h3 a { color: var(--ink); }
.poem-card h3 a:hover { color: var(--accent); }
.poem-card .poet-line { color: var(--ink-faint); font-size: 0.88rem; margin-bottom: 10px; }
.poem-card .poet-line a { color: var(--ink-soft); font-weight: 600; }
.poem-card .excerpt {
  font-family: var(--font-serif);
  color: var(--ink-soft);
  font-size: 0.98rem;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-bottom: 14px;
}
.card-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 0.86rem;
  color: var(--ink-faint);
}
.card-foot .stat { display: inline-flex; align-items: center; gap: 4px; }
.card-foot .spacer { flex: 1; }
.cat-badge {
  display: inline-block;
  background: var(--gold-soft);
  color: #7a5c00;
  border-radius: 999px;
  padding: 2px 11px;
  font-size: 0.78rem;
  font-weight: 700;
}
.cat-badge.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Poem detail ---------- */
.poem-detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
  max-width: 760px;
  margin: 0 auto;
}
.poem-detail h1 { font-size: 1.9rem; text-align: center; margin-bottom: 4px; }
.poem-detail .poem-meta { text-align: center; color: var(--ink-faint); font-size: 0.92rem; margin-bottom: 22px; }
.poem-detail .poem-meta a { color: var(--ink-soft); font-weight: 600; }
.poem-body {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  line-height: 2.1;
  text-align: center;
  white-space: pre-line;
  padding: 10px 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.poem-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.like-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.like-btn .heart { font-size: 1.15rem; color: #c4b8a6; transition: color 0.15s; }
.like-btn.liked { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.like-btn.liked .heart { color: var(--accent); }

.comment { border-bottom: 1px solid var(--line); padding: 14px 0; }
.comment:last-child { border-bottom: 0; }
.comment-head { font-size: 0.88rem; color: var(--ink-faint); margin-bottom: 3px; }
.comment-head strong { color: var(--ink); font-size: 0.95rem; }
.comment-body { white-space: pre-line; }
.comment-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.comment-form textarea { min-height: 90px; }

/* ---------- Poets ---------- */
.poet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.poet-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.poet-card .avatar-lg {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.9rem; font-weight: 800;
  margin: 0 auto 12px;
}
.poet-card h3 { font-size: 1.15rem; margin-bottom: 0; }
.poet-card .username { color: var(--ink-faint); font-size: 0.88rem; margin-bottom: 8px; }
.poet-card .count { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 14px; }

.profile-head {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.profile-head .avatar-lg {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 2.4rem; font-weight: 800;
  margin: 0 auto 12px;
}
.profile-head h1 { font-size: 1.7rem; margin-bottom: 0; }
.profile-head .username { color: var(--ink-faint); margin-bottom: 6px; }
.profile-head .joined { color: var(--ink-faint); font-size: 0.9rem; }

/* ---------- Forms / auth ---------- */
.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px 28px;
  box-shadow: var(--shadow);
  max-width: 520px;
  margin: 0 auto;
}
.form-card.wide { max-width: 720px; }
.form-card h1 { font-size: 1.55rem; text-align: center; }
.form-card .subtitle { text-align: center; color: var(--ink-faint); font-size: 0.94rem; margin-bottom: 20px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-weight: 600; font-size: 0.93rem; margin-bottom: 5px; }
.field label .optional { color: var(--ink-faint); font-weight: 400; font-size: 0.85rem; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .hint { font-size: 0.82rem; color: var(--ink-faint); margin-top: 4px; }
.field .error { font-size: 0.85rem; color: var(--red); margin-top: 4px; display: none; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--red); }
.field.invalid .error { display: block; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error {
  background: #fdecea;
  color: var(--red);
  border: 1px solid #f5c6cb;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.92rem;
  margin-bottom: 15px;
  display: none;
}
.form-error.show { display: block; }
.form-success {
  background: #e6f4ea;
  color: var(--green);
  border: 1px solid #a3d9a5;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.92rem;
  margin-bottom: 15px;
  display: none;
}
.form-success.show { display: block; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 0.94rem; color: var(--ink-soft); }
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-faint);
  font-size: 0.86rem;
  margin: 20px 0;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--accent); font-weight: 600; font-size: inherit;
}
.link-btn:hover { text-decoration: underline; }

/* OTP */
.otp-input {
  width: 100%;
  text-align: center;
  font-size: 1.6rem !important;
  letter-spacing: 0.5em;
  font-weight: 700;
  font-family: var(--font-serif);
}
.otp-timer { text-align: center; color: var(--ink-faint); font-size: 0.9rem; margin-top: 10px; }

/* ---------- Lists, empty states, misc ---------- */
.empty {
  text-align: center;
  color: var(--ink-faint);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 20px;
}
.empty .big { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.loading { text-align: center; color: var(--ink-faint); padding: 40px 0; }
.my-poem-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.my-poem-row h3 { margin: 0; font-size: 1.1rem; flex: 1; min-width: 180px; }
.my-poem-row h3 a { color: var(--ink); }
.my-poem-row .row-meta { color: var(--ink-faint); font-size: 0.86rem; }
.row-actions { display: flex; gap: 8px; }

.settings-grid { display: grid; gap: 20px; max-width: 720px; margin: 0 auto; }
.settings-grid .form-card { margin: 0; max-width: none; }

/* Toast */
.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translate(-50%, 80px);
  background: var(--ink);
  color: #fff;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
  padding: 34px 0 26px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 0 18px; text-align: center; }
.footer-inner .brand { justify-content: center; margin-bottom: 8px; }
.footer-inner p { max-width: 560px; margin: 0 auto 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .header-inner { gap: 8px; }
  .brand { font-size: 1.05rem; }
  .brand small { display: none; }
  .main-nav { order: 3; width: 100%; margin-left: 0; }
  .main-nav a { padding: 6px 9px; font-size: 0.88rem; }
  .hero { padding: 28px 18px; }
  .poem-detail { padding: 24px 18px; }
  .poem-body { font-size: 1.08rem; }
  .field-row { grid-template-columns: 1fr; }
  .form-card { padding: 24px 18px; }
}
