/* ============================================================
   WhatsApp Marketing SaaS — Bootstrap 5.3 custom layer
   The design system is Bootstrap (dark theme) + this thin layer:
   brand tokens (deep-green accent), the gradient brand button,
   the app sidebar, the auth hero, and the few boxes Bootstrap
   has no primitive for (QR box, group checklist, paywall veil).
   Everything else — layout, cards, tables, forms, buttons,
   badges, alerts, progress — is stock Bootstrap classes.
   ============================================================ */

:root {
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --bs-primary: #12b76a;
  --bs-primary-rgb: 18, 183, 106;
  --bs-link-color: #3ed598;
  --bs-link-hover-color: #2ee6a8;
  --bs-border-radius: 0.75rem;
  --brand: #12b76a;
  --brand-deep: #0b7a55;
  --grad-brand: linear-gradient(135deg, #0b7a55 0%, #12b76a 100%);
  --grad-hero: radial-gradient(1100px 520px at 85% -10%, rgba(18, 183, 106, 0.28), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(11, 122, 85, 0.35), transparent 55%),
    linear-gradient(155deg, #04120c 0%, #06231a 42%, #0a4a34 100%);
}

[data-bs-theme="dark"] {
  --bs-body-bg: #060b13;
  --bs-body-color: #ecf2f9;
  --bs-secondary-color: #a9bcd2;
  --bs-tertiary-bg: #111e33;
  --bs-border-color: rgba(148, 178, 214, 0.16);
  --bs-card-bg: #0d1626;
  --bs-card-border-color: rgba(148, 178, 214, 0.14);
  --bs-table-border-color: rgba(148, 178, 214, 0.12);
  --bs-form-control-bg: #0a1322;
}

body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(18, 183, 106, 0.05), transparent 55%),
    linear-gradient(180deg, #081020, #060b13);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(18, 183, 106, 0.35); }

code { background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: 6px; padding: 1px 6px; font-size: 0.88em; color: inherit; }

.card { border-radius: 1.1rem; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 40px -24px rgba(0, 0, 0, 0.7); }
.table { --bs-table-bg: transparent; }
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.25rem rgba(18, 183, 106, 0.16);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: var(--brand); box-shadow: 0 0 0 0.25rem rgba(18, 183, 106, 0.16); }

/* ---------- brand button & accents ---------- */

.btn-brand {
  background-image: var(--grad-brand);
  border: 0;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 20px -8px rgba(18, 183, 106, 0.65);
}
.btn-brand:hover, .btn-brand:focus { color: #fff; filter: brightness(1.1); }
.btn-brand:active { color: #fff !important; filter: brightness(0.95); }
.btn-brand:disabled { color: #fff; opacity: 0.55; }

.bg-brand { background-color: var(--brand) !important; }
.progress-bar.bg-brand { background-image: linear-gradient(90deg, #0b7a55, #12b76a); }
.text-bg-brand { background-color: var(--brand) !important; color: #fff !important; }

/* period toggle (paywall + signup pricing): Bootstrap .btn.active
   already paints the active state; this just makes it brand-green. */
.btn-outline-success { --bs-btn-color: #7ee2b8; --bs-btn-border-color: rgba(18, 183, 106, 0.5); --bs-btn-hover-bg: rgba(18, 183, 106, 0.15); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--brand-deep); --bs-btn-active-border-color: var(--brand); }

/* ---------- brand block (sidebar / auth / landing) ---------- */

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px;
  background: var(--grad-brand); display: grid; place-items: center;
  box-shadow: 0 10px 22px -8px rgba(18, 183, 106, 0.7);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-size: 16.5px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.brand-sub { font-size: 12px; color: var(--bs-secondary-color); }

/* ---------- app shell: sidebar + main ---------- */

.sidebar {
  background: linear-gradient(180deg, rgba(18, 183, 106, 0.05), transparent 30%), #0a1424;
  border-right: 1px solid var(--bs-border-color);
  padding: 22px 16px 18px;
}
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
.side-foot { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--bs-border-color); color: var(--bs-secondary-color); font-size: 12px; }

.shell-main { min-width: 0; }
.shell-main main { width: 100%; max-width: 1160px; margin: 0 auto; padding: 22px 28px 40px; }

.topbar-blur {
  background: rgba(7, 12, 22, 0.78);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bs-border-color);
}

/* sidebar nav — keeps the .tabs hook app.js drives; buttons are
   Bootstrap .nav-link inside .nav-pills, active state is brand. */
.sidebar .tabs .nav-link {
  width: 100%; text-align: left;
  color: var(--bs-secondary-color); font-weight: 600; font-size: 14.5px;
  border-radius: 12px; padding: 10px 12px;
}
.sidebar .tabs .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.sidebar .tabs .nav-link.active {
  background: linear-gradient(90deg, rgba(18, 183, 106, 0.18), rgba(18, 183, 106, 0.05));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand);
}
@media (max-width: 991.98px) {
  .sidebar { padding: 14px 16px; border-right: none; border-bottom: 1px solid var(--bs-border-color); }
  .sidebar .tabs { flex-direction: row !important; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .sidebar .tabs .nav-link { width: auto; white-space: nowrap; }
  .side-foot { display: none; }
  .shell-main main { padding: 18px 16px 34px; }
}

/* tab panels — app.js toggles .active (its own router, not BS tabs) */
.tab { display: none; }
.tab.active { display: block; animation: tabIn 0.18s ease; }
@keyframes tabIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* dashboard form labels that wrap a control become stacked fields;
   inline toggle labels (checkbox + text) are untouched. */
.card label:has(> .form-control), .card label:has(> .form-select) {
  display: block; font-weight: 600; font-size: 0.9rem; color: var(--bs-secondary-color); margin-bottom: 0.9rem;
}
.card label:has(> .form-control) .form-control,
.card label:has(> .form-select) .form-select { margin-top: 0.4rem; font-weight: 400; color: var(--bs-body-color); }

/* ---------- boxes Bootstrap has no primitive for ---------- */

.checklist {
  display: grid; gap: 4px; max-height: 230px; overflow-y: auto;
  border: 1px solid var(--bs-border-color); border-radius: 0.9rem;
  padding: 10px; background: #0a1322;
}
.checklist label { display: flex; gap: 9px; align-items: center; font-size: 14px; padding: 5px 8px; border-radius: 8px; cursor: pointer; margin: 0; }
.checklist label:hover { background: rgba(255, 255, 255, 0.03); }

.qrbox {
  background: #fff; border-radius: 1.1rem; padding: 16px; color: #14202e;
  min-height: 290px; display: flex; align-items: center; justify-content: center; text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 60px -16px rgba(0, 0, 0, 0.75);
}
.qrbox img { width: 100%; height: auto; border-radius: 8px; }

.paywall-overlay {
  position: fixed; inset: 0; z-index: 80; overflow: auto;
  background: rgba(3, 7, 12, 0.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.paywall-card { max-width: 540px; margin: 7vh auto; }

/* ---------- pricing card (signup + landing) ---------- */

.pricing {
  position: relative; overflow: hidden;
  border: 1px solid rgba(18, 183, 106, 0.4); border-radius: 1.1rem;
  padding: 20px; margin: 16px 0;
  background: linear-gradient(180deg, rgba(18, 183, 106, 0.09), rgba(18, 183, 106, 0.02) 55%), var(--bs-card-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 40px -24px rgba(0, 0, 0, 0.7);
}
.pricing::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad-brand); }
.price { font-size: 34px; font-weight: 850; letter-spacing: -0.03em; margin: 8px 0 2px; }
.price small { font-size: 15px; font-weight: 550; color: var(--bs-secondary-color); letter-spacing: 0; }
.plimits { list-style: none; margin: 12px 0 0; padding: 0; font-size: 14px; color: var(--bs-secondary-color); }
.plimits li { margin: 6px 0; padding-left: 26px; position: relative; }
.plimits li::before { content: "✓"; position: absolute; left: 2px; color: var(--brand); font-weight: 800; }

/* ---------- auth (login / signup / reset / owner) ---------- */

.auth-hero {
  position: relative; overflow: hidden;
  background: var(--grad-hero);
  padding: 44px 48px;
  display: flex; flex-direction: column;
}
.auth-hero::after {
  content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%;
  right: -180px; bottom: -260px;
  background: radial-gradient(circle, rgba(46, 230, 168, 0.16), transparent 65%);
  pointer-events: none;
}
.auth-hero-main { margin: auto 0; max-width: 520px; position: relative; z-index: 1; }
.auth-hero h1 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; font-weight: 850; letter-spacing: -0.02em; }
.auth-hero h1 .accent { background: linear-gradient(90deg, #2ee6a8, #12b76a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero .lede { color: #c4d8ce; font-size: 16.5px; margin: 14px 0 22px; max-width: 46ch; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.feature-list li { display: flex; gap: 11px; align-items: flex-start; color: #dcebe2; font-size: 14.5px; }
.feature-list .fi {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid; place-items: center; font-size: 15px; color: #2ee6a8;
}
.hero-price {
  margin-top: 26px; display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px; padding: 13px 18px; backdrop-filter: blur(8px);
}
.hero-price .hp-price { font-size: 21px; font-weight: 800; }
.hero-price .hp-note { color: #b9cec2; font-size: 13px; }
.auth-foot { position: relative; z-index: 1; color: rgba(220, 235, 226, 0.65); font-size: 12.5px; margin: 0; }

.auth-card { width: min(460px, 100%); }
.auth-card.wide { width: min(560px, 100%); }

/* legacy centered card (owner login) */
.authwrap { max-width: 430px; margin: 9vh auto; }

@media (max-width: 991.98px) {
  .auth-hero { padding: 26px 22px 30px; }
  .auth-hero-main { margin: 26px 0 8px; }
  .auth-hero .lede { font-size: 15px; }
  .auth-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
