/* ============================================================
   Replyzen — base stylesheet (public site + shared components)
   Theme via [data-theme="light"|"dark"] on <html>.
   ============================================================ */

:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", "Hind Siliguri", sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.18s ease;
}

html[data-theme="light"] {
  --bg: #f8f6f1;
  --bg-alt: #f1eee5;
  --card: #ffffff;
  --card-alt: #f5f2ea;
  --text: #161311;
  --muted: #726c61;
  --border: #e5e0d5;
  --primary: #2e5cea;
  --primary-hover: #2449c4;
  --primary-soft: rgba(46, 92, 234, 0.1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, 0.12);
  --info: #0d7ec4;
  --info-soft: rgba(13, 126, 196, 0.1);
  --green: #b4f461;
  --orange: #fb923c;
  --violet: #7c3aed;
  --teal: #14b8a6;
  --pink: #ec4899;
  --shadow: 0 1px 3px rgba(22, 19, 17, 0.06);
  --shadow-lg: 0 12px 32px rgba(22, 19, 17, 0.12);
  --scrollbar: #d8d2c4;
}

html[data-theme="dark"] {
  --bg: #161311;
  --bg-alt: #1d1916;
  --card: #201c19;
  --card-alt: #282320;
  --text: #f2eee8;
  --muted: #a29a8e;
  --border: #322c27;
  --primary: #4d76ff;
  --primary-hover: #6586ff;
  --primary-soft: rgba(77, 118, 255, 0.16);
  --danger: #ef5350;
  --danger-soft: rgba(239, 83, 80, 0.15);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.15);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.12);
  --green: #b4f461;
  --orange: #fb923c;
  --violet: #8b5cf6;
  --teal: #2dd4bf;
  --pink: #f472b6;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
  --scrollbar: #4a4238;
}

/* ------------------------------------------------- reset & base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
img { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0.4em 0; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.1rem; }
p { margin: 0.5em 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mt { margin-top: 1rem; }
.error-text { color: var(--danger); }
.break-all { word-break: break-all; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--primary); color: #fff; padding: 8px 16px; z-index: 99; }
.skip-link:focus { left: 0; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.section { padding: 3.2rem 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2rem; }
.section-head-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head-row p { margin: 0; }
.section-title { font-size: 1.25rem; margin: 1.6rem 0 0.8rem; }
.comparison-title { margin-top: 2.5rem; }

/* ------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background var(--transition), border-color var(--transition), transform 0.06s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--card-alt); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-light { background: #fff; color: #111; }
.btn-light:hover { background: #eee; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }
.link { font-weight: 600; display: inline-flex; align-items: center; gap: 0.2rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border); color: var(--text);
  cursor: pointer; text-decoration: none; transition: background var(--transition);
}
.icon-btn:hover { background: var(--card-alt); text-decoration: none; }
.icon-btn-relative { position: relative; }
.icon-btn-relative .badge-dot {
  position: absolute; top: -6px; right: -6px;
  background: var(--danger); color: #fff; font-size: 0.62rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0 3px;
}

/* ------------------------------------------------- icon base */
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }

/* ------------------------------------------------- badges / pills */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 0.2rem 0.6rem; border-radius: 999px; text-transform: lowercase;
}
.badge-soft { background: var(--card-alt); color: var(--muted); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warning-soft); color: var(--warning); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-admin { background: var(--violet); color: #fff; }
.badge-dot { background: var(--danger); color: #fff; }
.pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.pill-on { border-color: var(--success); color: var(--success); }
.pill-on .dot { background: var(--success); }
.pill-off .dot { background: var(--muted); }
.pill:hover { text-decoration: none; }
.status-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ------------------------------------------------- cards & grids */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4, .pricing-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.empty-state {
  text-align: center; padding: 3rem 1.5rem; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.empty-state .icon { width: 34px; height: 34px; opacity: 0.6; }

/* ------------------------------------------------- forms */
.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; }
.form-group label { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.35rem; }
input, select, textarea {
  font-family: inherit; font-size: 0.95rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.6rem 0.85rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 1rem; }
.form-check { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0.8rem 0; }
.form-check input { margin-top: 0.3rem; }
.form-check label { font-size: 0.9rem; }
.form-check-switch input { width: 34px; height: 20px; appearance: none; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; transition: background var(--transition); }
.form-check-switch input::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: left var(--transition); }
.form-check-switch input:checked { background: var(--success); }
.form-check-switch input:checked::after { left: 16px; }
.inline-form { display: inline-flex; gap: 0.5rem; align-items: center; }
.auth-card { max-width: 460px; margin: 0 auto; }
.auth-card h1 { font-size: 1.5rem; }
.auth-alt { text-align: center; margin-top: 1rem; font-size: 0.9rem; }
.form-page { max-width: 900px; margin: 0 auto; }
.form-card h3 { margin-top: 0; }

/* ------------------------------------------------- alerts & toasts */
.alert {
  display: flex; gap: 0.7rem; align-items: flex-start;
  border-radius: var(--radius-sm); padding: 0.85rem 1rem;
  margin-bottom: 1rem; font-size: 0.92rem;
  border: 1px solid transparent;
}
.alert .icon { margin-top: 0.1rem; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: rgba(220, 38, 38, 0.25); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(22, 163, 74, 0.25); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(180, 83, 9, 0.25); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: rgba(13, 126, 196, 0.25); }
.alert a { color: inherit; text-decoration: underline; }
.alert .btn { margin-top: 0.4rem; }
.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0.5rem; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); border-radius: 999px; padding: 0.6rem 1.2rem;
  box-shadow: var(--shadow-lg); z-index: 60; font-size: 0.9rem;
  animation: rz-rise 0.25s ease;
}
.toast-success .icon { color: var(--success); }

/* ------------------------------------------------- Top Nav (Fixed & Polished) */
.top-nav {
  position: sticky; 
  top: 0; 
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { 
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  gap: 1rem; 
  height: 72px; 
}
.brand { 
  display: inline-flex; 
  align-items: center; 
  gap: 0.6rem; 
  font-weight: 800; 
  font-size: 1.2rem; 
  color: var(--text); 
  text-decoration: none; 
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); 
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-soft);
}
.brand-name .badge { margin-left: 0.3rem; transform: translateY(-2px); }
.nav-links { display: flex; gap: 1.4rem; margin-left: auto; margin-right: auto;}
.nav-links a { color: var(--muted); font-weight: 600; font-size: 0.95rem; transition: var(--transition); }
.nav-links a:hover { color: var(--primary); text-decoration: none; }

.nav-actions { display: flex; align-items: center; gap: 0.6rem; }
.nav-burger { display: none; }
.nav-mobile { display: flex; flex-direction: column; padding-bottom: 1rem; }
.nav-mobile a { padding: 0.5rem 0; color: var(--text); font-weight: 600; }
.theme-sun { display: none; }
html[data-theme="dark"] .theme-moon { display: none; }
html[data-theme="dark"] .theme-sun { display: inline-flex; }

/* ------------------------------------------------- hero */
.hero { padding: 4.5rem 0 3.5rem; text-align: center; }
.hero-compact { padding: 3rem 0 2rem; }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); letter-spacing: -0.02em; }
.grad-text {
  background: linear-gradient(90deg, var(--primary), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { max-width: 640px; margin: 1rem auto 1.8rem; color: var(--muted); font-size: 1.1rem; }
.hero-cta { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.hero-badges { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }
.badge-soft { background: var(--card-alt); color: var(--muted); font-size: 0.8rem; }
.badge-soft .icon { color: var(--success); }
.cta-band {
  background: var(--primary); color: #fff;
  text-align: center; padding: 3rem 0; margin-top: 2rem;
}
.cta-band h2 { color: #fff; }

/* ------------------------------------------------- features & steps */
.feature-card h3 { margin-top: 0.8rem; }
.feature-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.feature-icon-blue { background: var(--primary-soft); color: var(--primary); }
.feature-icon-green { background: rgba(180, 244, 97, 0.25); color: #4d7c0f; }
html[data-theme="dark"] .feature-icon-green { color: #b4f461; }
.feature-icon-violet { background: rgba(124, 58, 237, 0.14); color: var(--violet); }
.feature-icon-teal { background: rgba(20, 184, 166, 0.14); color: var(--teal); }
.feature-icon-orange { background: rgba(251, 146, 60, 0.16); color: var(--orange); }
.feature-icon-pink { background: rgba(236, 72, 153, 0.14); color: var(--pink); }
.feature-icon-amber { background: rgba(245, 158, 11, 0.16); color: var(--warning); }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; counter-reset: step; }
.step-card { position: relative; }
.step-num {
  position: absolute; top: -14px; left: 1.4rem;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--primary); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.step-card h3 { margin-top: 0.4rem; }

/* ------------------------------------------------- pricing */
.plan-card { display: flex; flex-direction: column; position: relative; }
.plan-featured { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.plan-price { font-size: 1.6rem; font-weight: 800; margin: 0.4rem 0; }
.plan-price span { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.plan-yearly { margin-top: -0.6rem; }
.plan-list { list-style: none; padding: 0; margin: 0.8rem 0 1.2rem; flex: 1; }
.plan-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0; font-size: 0.9rem; }
.plan-list .icon { color: var(--success); width: 1em; height: 1em; }
.plan-current { border-color: var(--success); }

/* ------------------------------------------------- FAQ, prose */
.faq { display: flex; flex-direction: column; gap: 0.7rem; max-width: 760px; margin: 0 auto; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item summary::marker { color: var(--primary); }
.prose { max-width: 780px; }
.prose h2 { font-size: 1.2rem; margin-top: 1.6rem; }
.prose ul { padding-left: 1.2rem; }

/* ------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; padding: 2.5rem 20px 1.5rem; }
.footer-grid h4 { margin: 0 0 0.6rem; font-size: 0.95rem; }
.footer-grid nav { display: flex; flex-direction: column; gap: 0.35rem; }
.footer-grid a { color: var(--muted); font-size: 0.92rem; }
.footer-grid a:hover { color: var(--primary); }
.footer-tag { font-weight: 700; margin: 0.6rem 0 0.2rem; }
.footer-bottom { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.85rem; padding: 1rem 20px 2rem; border-top: 1px solid var(--border); }

/* ------------------------------------------------- tables & bars */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table-actions { white-space: nowrap; text-align: right; }
.bar-list { list-style: none; padding: 0; margin: 0.5rem 0; display: flex; flex-direction: column; gap: 0.55rem; }
.bar-list li { display: flex; align-items: center; gap: 0.7rem; font-size: 0.9rem; }
.bar-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 2; height: 10px; border-radius: 6px; background: var(--bg-alt); overflow: hidden; }
.bar { display: block; height: 100%; background: var(--primary); border-radius: 6px; min-width: 2px; }
.bar-cell { width: 30%; }
.bar-cell .bar { display: block; height: 8px; border-radius: 6px; }
.progress { height: 12px; border-radius: 6px; background: var(--bg-alt); overflow: hidden; margin: 0.4rem 0; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width 0.4s ease; }
.progress-row { display: flex; justify-content: space-between; font-size: 0.9rem; }

/* ------------------------------------------------- pagination */
.pagination { display: flex; gap: 0.4rem; margin: 1.2rem 0; flex-wrap: wrap; }
.pg-link {
  min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.85rem; font-weight: 600; text-decoration: none;
}
.pg-link:hover { border-color: var(--primary); text-decoration: none; }
.pg-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ------------------------------------------------- toolbar / search */
.toolbar { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 1.2rem; flex-wrap: wrap; }
.toolbar-form { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box .icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 2.2rem; }

/* ------------------------------------------------- misc */
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0.6rem 0; }
.detail-list dt { color: var(--muted); font-size: 0.85rem; display: flex; align-items: center; gap: 0.35rem; }
.detail-list dd { margin: 0; font-size: 0.92rem; word-break: break-word; }
.collapse { display: none; }
.collapse.show { display: block; }
.mt-none { margin-top: 0; }
code { background: var(--card-alt); padding: 0.1rem 0.35rem; border-radius: 6px; font-size: 0.85em; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }