/* ============================================================
   BOOKZIGN — Main stylesheet (mobile-first, premium SaaS)
   Palette: purple accent on white, rounded cards, soft shadows
   ============================================================ */

:root {
  --purple: #6d28d9;
  --purple-dark: #5b21b6;
  --purple-light: #ede9fe;
  --purple-soft: #f5f3ff;
  --ink: #1e1b2e;
  --ink-soft: #5b5772;
  --muted: #8b87a0;
  --bg: #ffffff;
  --bg-soft: #faf9fc;
  --line: #eceaf3;
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(80, 60, 160, 0.08);
  --shadow-lg: 0 12px 40px rgba(80, 60, 160, 0.14);
  --font: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-dark); }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: none; cursor: pointer; transition: all .18s ease; text-decoration: none;
  font-family: var(--font); line-height: 1.2;
}
.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 6px 18px rgba(109,40,217,.28); }
.btn-primary:hover { background: var(--purple-dark); color: #fff; transform: translateY(-1px); }
.btn-outline { background: #fff; color: var(--purple); border: 1.5px solid var(--purple); }
.btn-outline:hover { background: var(--purple-soft); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn-sm { padding: 8px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-danger { background: #fde8e8; color: var(--red); }
.btn-danger:hover { background: #fbd5d5; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--purple-light); color: var(--purple-dark);
}
.badge-green { background: #d1fae5; color: var(--green); }
.badge-amber { background: #fef3c7; color: var(--amber); }
.badge-red { background: #fde8e8; color: var(--red); }
.badge-gray { background: var(--line); color: var(--ink-soft); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { font-size: 21px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); }
.logo span { color: var(--purple); }
.nav-toggle {
  margin-left: auto; background: none; border: none; cursor: pointer; padding: 8px;
  display: flex; flex-direction: column; gap: 5px;
}
.nav-toggle i { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; display: block; }
.main-nav {
  display: none; position: absolute; top: 64px; left: 0; right: 0;
  background: #fff; border-bottom: 1px solid var(--line); padding: 16px 20px 22px;
  flex-direction: column; gap: 4px; box-shadow: var(--shadow-lg);
}
.main-nav.open { display: flex; }
.main-nav a {
  color: var(--ink-soft); font-weight: 500; padding: 10px 12px; border-radius: var(--radius-sm);
}
.main-nav a:hover, .main-nav a.active { color: var(--purple); background: var(--purple-soft); }
.nav-cta { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.nav-search { margin: 8px 0; }
.nav-search input {
  width: 100%; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 999px;
  font-family: var(--font); font-size: 14px; background: var(--bg-soft);
}
.nav-search input:focus { outline: none; border-color: var(--purple); background: #fff; }

@media (min-width: 880px) {
  .nav-toggle { display: none; }
  .main-nav {
    display: flex; position: static; flex-direction: row; align-items: center;
    background: none; border: none; box-shadow: none; padding: 0; flex: 1; gap: 2px;
  }
  .nav-search { margin: 0 8px 0 auto; width: 220px; }
  .nav-cta { margin: 0; }
}

/* ---------- Hero ---------- */
.hero { background: linear-gradient(170deg, var(--purple-soft) 0%, #fff 70%); padding: 56px 0 48px; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(32px, 6vw, 52px); font-weight: 800; letter-spacing: -1.5px; line-height: 1.12; }
.hero h1 em { font-style: normal; color: var(--purple); }
.hero p.sub { margin: 18px 0 28px; font-size: 17px; color: var(--ink-soft); max-width: 520px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-mockups { display: flex; gap: 14px; justify-content: center; }
.mockup-card {
  flex: 1; max-width: 150px; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 10px; transform: rotate(-2deg);
  transition: transform .25s ease;
}
.mockup-card:nth-child(2) { transform: rotate(0) translateY(-12px); }
.mockup-card:nth-child(3) { transform: rotate(2deg); }
.mockup-card:hover { transform: translateY(-8px) rotate(0); }
.mockup-cover {
  border-radius: var(--radius-sm); aspect-ratio: 3/4; display: flex; align-items: flex-end;
  padding: 12px; color: #fff; font-weight: 700; font-size: 12.5px; line-height: 1.3;
}
.mc-1 { background: linear-gradient(150deg, #7c3aed, #4c1d95); }
.mc-2 { background: linear-gradient(150deg, #0ea5e9, #1e40af); }
.mc-3 { background: linear-gradient(150deg, #f59e0b, #b45309); }
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.1fr .9fr; } .hero { padding: 80px 0 70px; } }

/* ---------- Benefits ---------- */
.benefits { padding: 36px 0; border-bottom: 1px solid var(--line); }
.benefit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.benefit { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.benefit .ic {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--purple-soft);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
@media (min-width: 880px) { .benefit-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(24px, 4.5vw, 34px); font-weight: 800; letter-spacing: -.8px; }
.section-head p { color: var(--ink-soft); margin-top: 10px; }
.eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--purple); margin-bottom: 10px;
}

/* ---------- Demo calculator ---------- */
.demo-box {
  max-width: 480px; margin: 0 auto; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 28px; border: 1px solid var(--line);
}
.demo-box label { display: block; font-size: 13.5px; font-weight: 600; margin: 14px 0 6px; color: var(--ink-soft); }
.demo-box input[type=number] {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-size: 16px; font-family: var(--font);
}
.demo-box input:focus { outline: none; border-color: var(--purple); }
.demo-result { margin-top: 20px; padding: 16px; background: var(--purple-soft); border-radius: var(--radius-sm); }
.demo-result .amount { font-size: 26px; font-weight: 800; color: var(--purple-dark); }
.progress-track { height: 10px; background: var(--line); border-radius: 999px; margin-top: 12px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--purple), #a78bfa); border-radius: 999px; width: 0; transition: width .4s ease; }

/* ---------- Product cards ---------- */
.product-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
.product-card {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--line);
  overflow: hidden; transition: all .2s ease; display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: #ddd6fe; }
.product-cover { aspect-ratio: 16/10; background: linear-gradient(150deg, var(--purple-light), #ddd6fe); position: relative; overflow: hidden; }
.product-cover img { width: 100%; height: 100%; object-fit: cover; }
.product-cover .ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 42px; opacity: .55;
}
.product-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.product-body h3 { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.product-body h3 a { color: var(--ink); }
.product-body p { font-size: 13.5px; color: var(--muted); flex: 1; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.price { font-size: 19px; font-weight: 800; color: var(--purple-dark); }
.price-old { font-size: 14px; color: var(--muted); text-decoration: line-through; }

/* ---------- Library preview / trust ---------- */
.library-mock {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); padding: 22px; max-width: 560px; margin: 0 auto;
}
.lm-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.lm-tab { padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--bg-soft); color: var(--ink-soft); }
.lm-tab.on { background: var(--purple); color: #fff; }
.lm-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.lm-thumb { width: 46px; height: 58px; border-radius: 8px; flex-shrink: 0; }
.lm-item h4 { font-size: 14px; font-weight: 700; }
.lm-item small { color: var(--muted); font-size: 12px; }
.trust-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; text-align: center; }
.trust-num { font-size: clamp(26px, 5vw, 38px); font-weight: 800; color: var(--purple); letter-spacing: -1px; }
.trust-label { font-size: 13.5px; color: var(--ink-soft); font-weight: 500; }
@media (min-width: 880px) { .trust-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- FAQ ---------- */
.faq-list { max-width: 720px; margin: 0 auto; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; background: #fff; overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; padding: 18px 20px;
  font-family: var(--font); font-size: 15.5px; font-weight: 600; color: var(--ink);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-q::after { content: "+"; font-size: 22px; color: var(--purple); font-weight: 400; transition: transform .2s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 20px 18px; color: var(--ink-soft); font-size: 14.5px; }
.faq-item.open .faq-a { display: block; }

/* ---------- Final CTA ---------- */
.cta-final {
  background: linear-gradient(140deg, var(--purple-dark), var(--purple));
  border-radius: var(--radius); padding: 48px 28px; text-align: center; color: #fff;
}
.cta-final h2 { font-size: clamp(24px, 4.5vw, 34px); font-weight: 800; letter-spacing: -.8px; }
.cta-final p { opacity: .85; margin: 10px 0 26px; }
.cta-final .btn { background: #fff; color: var(--purple-dark); }
.cta-final .btn:hover { transform: translateY(-2px); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #b9b5cc; margin-top: 64px; padding: 48px 0 28px; font-size: 14px; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer .logo { color: #fff; }
.site-footer h5 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.site-footer a { color: #b9b5cc; display: block; padding: 4px 0; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 36px; padding-top: 20px; font-size: 13px; color: #8b87a0; }

/* ---------- Forms / auth ---------- */
.auth-wrap { max-width: 440px; margin: 48px auto; padding: 0 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.card h1, .card h2 { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 6px; }
.card .sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 15px; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-light); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.form-foot { font-size: 14px; color: var(--ink-soft); text-align: center; margin-top: 18px; }

/* ---------- Alerts ---------- */
.alert { padding: 13px 18px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; font-weight: 500; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fde8e8; color: #991b1b; }
.alert-info { background: var(--purple-soft); color: var(--purple-dark); }

/* ---------- Page header ---------- */
.page-head { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 36px 0; }
.page-head h1 { font-size: clamp(24px, 5vw, 32px); font-weight: 800; letter-spacing: -.8px; }
.page-head p { color: var(--ink-soft); margin-top: 6px; }

/* ---------- Filter pills ---------- */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0; }
.pill {
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink-soft); cursor: pointer;
}
.pill:hover { border-color: var(--purple); color: var(--purple); }
.pill.active { background: var(--purple); border-color: var(--purple); color: #fff; }

/* ---------- Product detail ---------- */
.product-detail { display: grid; gap: 36px; padding: 40px 0; }
@media (min-width: 880px) { .product-detail { grid-template-columns: .9fr 1.1fr; } }
.pd-cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 3/4; max-width: 380px; background: linear-gradient(150deg, var(--purple-light), #ddd6fe); }
.pd-cover img { width: 100%; height: 100%; object-fit: cover; }
.pd-info h1 { font-size: clamp(26px, 5vw, 36px); font-weight: 800; letter-spacing: -1px; margin: 10px 0; }
.pd-price { display: flex; align-items: baseline; gap: 12px; margin: 18px 0; }
.pd-price .now { font-size: 32px; font-weight: 800; color: var(--purple-dark); }
.pd-price .was { font-size: 18px; color: var(--muted); text-decoration: line-through; }
.included { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0; }
.included h3 { font-size: 15px; margin-bottom: 10px; }
.included li { list-style: none; padding: 6px 0 6px 28px; position: relative; font-size: 14.5px; color: var(--ink-soft); }
.included li::before { content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 700; }

/* ---------- Library (customer) ---------- */
.lib-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .lib-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .lib-grid { grid-template-columns: repeat(3, 1fr); } }
.lib-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.lib-card:hover { box-shadow: var(--shadow); }
.lib-cover { aspect-ratio: 16/9; background: linear-gradient(150deg, var(--purple-light), #ddd6fe); position: relative; }
.lib-cover img { width: 100%; height: 100%; object-fit: cover; }
.lib-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.lib-body h3 { font-size: 15.5px; font-weight: 700; }
.lib-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ---------- Dashboard shell (admin & customer) ---------- */
.dash { display: flex; min-height: 100vh; background: var(--bg-soft); }
.dash-side {
  position: fixed; inset: 0 25% 0 0; max-width: 264px; z-index: 60; background: var(--ink);
  padding: 22px 16px; transform: translateX(-100%); transition: transform .22s ease;
  display: flex; flex-direction: column; overflow-y: auto;
}
.dash-side.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
.dash-side .logo { color: #fff; margin-bottom: 26px; padding: 0 10px; }
.dash-side nav a {
  display: flex; align-items: center; gap: 12px; color: #b9b5cc; font-size: 14.5px; font-weight: 500;
  padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 2px;
}
.dash-side nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.dash-side nav a.active { color: #fff; background: var(--purple); }
.dash-side .side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.dash-main { flex: 1; min-width: 0; }
.dash-top {
  background: #fff; border-bottom: 1px solid var(--line); padding: 14px 20px;
  display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 40;
}
.dash-top .who { margin-left: auto; font-size: 14px; color: var(--ink-soft); }
.dash-body { padding: 24px 20px 48px; max-width: 1180px; }
.side-toggle { background: none; border: 1.5px solid var(--line); border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: 16px; line-height: 1; }
@media (min-width: 1024px) {
  .dash-side { position: sticky; top: 0; height: 100vh; transform: none; }
  .side-toggle { display: none; }
}

/* ---------- Stats cards ---------- */
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); margin-bottom: 28px; }
@media (min-width: 880px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat-card .k { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.stat-card .v { font-size: 26px; font-weight: 800; letter-spacing: -.8px; margin-top: 4px; }

/* ---------- Tables ---------- */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.bz { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.bz th { text-align: left; padding: 13px 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--bg-soft); }
table.bz td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.bz tr:last-child td { border-bottom: none; }
table.bz tr:hover td { background: var(--bg-soft); }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar h1 { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin-right: auto; }

.empty {
  text-align: center; padding: 56px 24px; color: var(--muted);
  background: #fff; border: 1.5px dashed var(--line); border-radius: var(--radius);
}
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* tiny helpers */
.mt-2 { margin-top: 16px; } .mb-2 { margin-bottom: 16px; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.text-muted { color: var(--muted); font-size: 13px; }
