/* =============================================
   SaaS design system
   ============================================= */

:root {
  --clr-primary:       #2563eb;
  --clr-primary-dark:  #1d4ed8;
  --clr-primary-light: #eff6ff;
  --clr-accent:        #f59e0b;
  --clr-bg:            #f1f5f9;
  --clr-surface:       #ffffff;
  --clr-border:        #e2e8f0;
  --clr-text:          #0f172a;
  --clr-muted:         #64748b;
  --clr-success:       #16a34a;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
}

/* ── Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv02","cv03","cv04","cv11";
  -webkit-font-smoothing: antialiased;
}

/* Centered app wrapper — max 1100 px */
.bg-app {
  background: var(--clr-bg);
  min-height: 100vh;
}

/* ── Page shell / centering ───────────────────── */
.container {
  max-width: 1100px !important;
}

/* ── Brand logo icon ─────────────────────────── */
.brand-logo {
  width: 32px;
  height: 32px;
  background: var(--clr-primary);
  border-radius: var(--radius-sm);
  display: inline-grid;
  place-items: center;
  border: none;
  flex-shrink: 0;
}
.brand-logo svg {
  width: 18px;
  height: 18px;
  color: #fff;
  fill: #fff;
}

/* ── Navbar ───────────────────────────────────── */
.navbar {
  background: rgba(255,255,255,.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-border) !important;
  padding-top: .75rem;
  padding-bottom: .75rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-text) !important;
  letter-spacing: -.02em;
}
.brand-text { color: var(--clr-text); }

.navbar .nav-link {
  color: var(--clr-muted) !important;
  font-size: .9rem;
  font-weight: 500;
  padding: .4rem .75rem !important;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.navbar .nav-link:hover {
  color: var(--clr-text) !important;
  background: var(--clr-bg);
}

/* CTA nav button */
.navbar .nav-link.nav-cta {
  background: linear-gradient(135deg, var(--clr-primary) 0%, #3b82f6 100%);
  color: #fff !important;
  padding: .4rem 1rem !important;
  margin-left: .25rem;
  box-shadow: 0 2px 6px rgba(37,99,235,.28);
  transition: filter .15s ease, transform .15s ease, box-shadow .15s ease !important;
}
.navbar .nav-link.nav-cta:hover {
  background: linear-gradient(135deg, var(--clr-primary) 0%, #3b82f6 100%) !important;
  filter: brightness(1.1);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.38);
}

/* ── Buttons ──────────────────────────────────── */
.btn-primary {
  --bs-btn-bg:           var(--clr-primary);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-bg:     var(--clr-primary-dark);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-bg:    var(--clr-primary-dark);
  --bs-btn-focus-shadow-rgb: 37,99,235;
  --bs-btn-color: #fff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--clr-primary) 0%, #3b82f6 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 2px 8px rgba(37,99,235,.30);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(37,99,235,.40) !important;
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37,99,235,.30) !important;
}

.btn-outline-primary {
  --bs-btn-color:        var(--clr-primary);
  --bs-btn-border-color: var(--clr-primary);
  --bs-btn-hover-bg:     var(--clr-primary);
  --bs-btn-hover-border-color: var(--clr-primary);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-outline-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.25);
}

.btn-outline-secondary {
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: transform .15s ease;
}
.btn-outline-secondary:hover {
  transform: translateY(-1px);
}

/* ── Cards ────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover {
  box-shadow: var(--shadow) !important;
  transform: translateY(-2px);
}

.card-body { padding: 1.5rem; }

/* ── Hero section ─────────────────────────────── */
.hero {
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(37,99,235,.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero .container { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--clr-text);
}

.hero .lead {
  font-size: 1.1rem;
  color: var(--clr-muted);
  max-width: 52ch;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--clr-primary-light);
  color: var(--clr-primary);
  font-size: .8rem;
  font-weight: 600;
  padding: .35rem .85rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
  letter-spacing: .01em;
  text-transform: uppercase;
  border: 1px solid rgba(37,99,235,.18);
  box-shadow: 0 1px 6px rgba(37,99,235,.12);
}

.hero-cta-note {
  color: var(--clr-muted);
  font-size: .85rem;
  margin-top: .6rem;
}

/* ── Feature icons ────────────────────────────── */
.feature-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--clr-primary-light) 0%, #dbeafe 100%);
  border-radius: var(--radius-sm);
  display: inline-grid;
  place-items: center;
  margin-bottom: 1rem;
  border: 1px solid rgba(37,99,235,.1);
}
.feature-icon img {
  width: 24px;
  height: 24px;
  filter: invert(26%) sepia(98%) saturate(1400%) hue-rotate(210deg) brightness(95%);
}

/* ── Steps / How it works ─────────────────────── */
.step-number {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--clr-primary) 0%, #60a5fa 100%);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-bottom: .75rem;
  box-shadow: 0 3px 10px rgba(37,99,235,.35);
}

/* ── Pricing card ─────────────────────────────── */
.pricing-card {
  border: 2px solid var(--clr-primary) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  position: relative;
  overflow: hidden;
}
.pricing-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--clr-primary-light) 0%, transparent 10%);
  pointer-events: none;
}
.pricing-card .card-body { padding: 2rem; }

.pricing-price {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--clr-text);
  line-height: 1;
}
.pricing-price sup {
  font-size: 1.25rem;
  font-weight: 700;
  vertical-align: super;
}
.pricing-period {
  color: var(--clr-muted);
  font-size: .9rem;
  margin-top: .25rem;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.pricing-features li {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 0;
  font-size: .95rem;
  color: var(--clr-text);
}
.pricing-features li::before {
  content: '';
  width: 18px;
  height: 18px;
  background: var(--clr-success);
  border-radius: 50%;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: cover;
}

.pricing-badge {
  display: inline-flex;
  background: linear-gradient(135deg, var(--clr-primary) 0%, #3b82f6 100%);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem .75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(37,99,235,.30);
}

/* ── Section headings ─────────────────────────── */
.section-label {
  display: block;
  color: var(--clr-primary);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: .5rem;
  color: var(--clr-text);
}

.section-sub {
  color: var(--clr-muted);
  font-size: 1rem;
}

/* ── Footer ───────────────────────────────────── */
footer {
  background: var(--clr-surface) !important;
  border-top: 1px solid var(--clr-border) !important;
}
footer .text-muted a {
  color: var(--clr-muted) !important;
  text-decoration: none;
  transition: color .15s;
}
footer .text-muted a:hover { color: var(--clr-text) !important; }

/* ── Auth / Create pages ──────────────────────── */
.auth-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  padding: 2rem 0;
}

.auth-card {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--clr-border) !important;
}

.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--clr-border);
  font-size: .95rem;
  padding: .55rem .85rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.input-group-text {
  background: var(--clr-bg);
  border-color: var(--clr-border);
  color: var(--clr-muted);
  font-size: .85rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.input-group > .form-control {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.form-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: .35rem;
}

/* ── Admin layout ─────────────────────────────── */
.admin-nav {
  background: rgba(255,255,255,.95) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-border) !important;
}

/* Sidebar nav pills */
.nav-pills .nav-link {
  color: var(--clr-muted);
  font-size: .875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: .5rem .875rem;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.nav-pills .nav-link:hover {
  background: var(--clr-bg);
  color: var(--clr-text);
}
.nav-pills .nav-link.active {
  background: var(--clr-primary-light) !important;
  color: var(--clr-primary) !important;
  font-weight: 600;
}

/* Sidebar card */
.sidebar-card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--clr-border) !important;
  box-shadow: var(--shadow-sm);
  background: var(--clr-surface);
  padding: 1.25rem;
  position: sticky;
  top: 80px;
}

/* Admin section headings */
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

/* Table */
.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--clr-border);
}
.table thead th {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--clr-muted);
  border-bottom: 1px solid var(--clr-border);
  padding-top: .65rem;
  padding-bottom: .65rem;
}
.table tbody td {
  font-size: .9rem;
  padding-top: .75rem;
  padding-bottom: .75rem;
  vertical-align: middle;
}

/* Badges */
.badge.text-bg-light {
  background: var(--clr-bg) !important;
  color: var(--clr-muted) !important;
  font-weight: 500;
  font-size: .78rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--clr-border);
}

/* Alerts / flash */
.alert {
  border-radius: var(--radius-sm);
  font-size: .9rem;
}

/* ── Offcanvas mobile sidebar ─────────────────── */
.offcanvas .nav-pills .nav-link { padding: .55rem .875rem; }

/* ── Dividers ─────────────────────────────────── */
hr {
  border-color: var(--clr-border);
  opacity: 1;
}

/* ── Pagination ───────────────────────────────── */
.page-link {
  border-radius: var(--radius-sm) !important;
  border-color: var(--clr-border);
  color: var(--clr-muted);
  font-size: .85rem;
}
.page-item.active .page-link {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
}

/* ── CTA strip ────────────────────────────────── */
.cta-strip {
  background: linear-gradient(135deg, var(--clr-primary-dark) 0%, var(--clr-primary) 50%, #3b82f6 100%);
  padding: 3.5rem 0;
}

/* ── Table row hover ──────────────────────────── */
.table tbody tr {
  transition: background .12s;
}
.table tbody tr:hover {
  background: rgba(239,246,255,.65);
}

/* ── Responsive tweaks ────────────────────────── */
@media (max-width: 767.98px) {
  .hero { padding: 3rem 0 2.5rem; }
  .pricing-card .card-body { padding: 1.5rem; }
  .pricing-price { font-size: 2.5rem; }
}
