/* ============================================================
   BuiltSELL — global styles
   ============================================================ */

:root {
  --bg: #0b0d12;
  --bg-soft: #11141c;
  --surface: #161a24;
  --surface-2: #1d2330;
  --border: #262d3d;
  --text: #e8ecf3;
  --muted: #9aa4b8;
  --brand: #6d5efc;
  --brand-2: #25d0a8;
  --brand-grad: linear-gradient(120deg, #6d5efc 0%, #25d0a8 100%);
  --danger: #ff6b6b;
  --radius: 14px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  --maxw: 1140px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 10px 25px rgba(109, 94, 252, 0.35); }
.btn-primary:hover { box-shadow: 0 14px 32px rgba(109, 94, 252, 0.5); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 30px; font-size: 16px; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 18, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.brand {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand .dot {
  width: 12px; height: 12px; border-radius: 4px;
  background: var(--brand-grad);
  display: inline-block;
}
.brand b { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a.link { color: var(--muted); font-weight: 500; font-size: 15px; }
.nav-links a.link:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 12px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 80px;
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 900px;
  background: radial-gradient(circle, rgba(109,94,252,0.25), transparent 60%);
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted); font-size: 13px; font-weight: 500;
  margin-bottom: 26px;
}
.badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 0 0 rgba(37,208,168,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(37,208,168,.5);} 70%{box-shadow:0 0 0 10px rgba(37,208,168,0);} 100%{box-shadow:0 0 0 0 rgba(37,208,168,0);} }
.hero h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin: 0 0 20px;
  font-weight: 800;
}
.hero h1 span { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 64px; flex-wrap: wrap; }
.hero-stats .stat strong { display: block; font-size: 30px; font-weight: 800; }
.hero-stats .stat span { color: var(--muted); font-size: 14px; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 54px; }
.section-head .eyebrow { color: var(--brand-2); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -1px; margin: 12px 0 14px; }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }

/* ---------- Feature grid ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--brand); }
.card .ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface-2);
  font-size: 22px; margin-bottom: 16px;
}
.card h3 { margin: 0 0 8px; font-size: 19px; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }

/* ---------- Product cards ---------- */
.product {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s ease, border-color .2s ease;
}
.product:hover { transform: translateY(-4px); border-color: var(--brand); }
.product .thumb { aspect-ratio: 16/10; background: var(--brand-grad); display: grid; place-items: center; font-size: 44px; }
.product .body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.product .tag { font-size: 12px; color: var(--brand-2); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.product h3 { margin: 8px 0 6px; font-size: 18px; }
.product p { color: var(--muted); font-size: 14px; margin: 0 0 16px; flex: 1; }
.product .foot { display: flex; align-items: center; justify-content: space-between; }
.product .price { font-size: 20px; font-weight: 800; }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.plans.plans-single { grid-template-columns: minmax(0, 420px); justify-content: center; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--brand); box-shadow: var(--shadow); position: relative; }
.plan.featured::after { content: "Most popular"; position: absolute; top: -12px; right: 24px; background: var(--brand-grad); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.plan h3 { margin: 0 0 6px; font-size: 20px; }
.plan .price { font-size: 40px; font-weight: 800; margin: 10px 0; }
.plan .price small { font-size: 15px; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 26px; flex: 1; }
.plan ul li { padding: 8px 0; color: var(--muted); border-bottom: 1px solid var(--border); font-size: 15px; }
.plan ul li::before { content: "✓ "; color: var(--brand-2); font-weight: 700; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; padding: 80px 0; }
.cta-box {
  background: var(--brand-grad);
  border-radius: 24px;
  padding: 60px 30px;
}
.cta-box h2 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 12px; color: #fff; letter-spacing: -1px; }
.cta-box p { color: rgba(255,255,255,0.9); margin: 0 0 28px; font-size: 18px; }
.cta-box .btn-primary { background: #fff; color: #1a1130; box-shadow: none; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 48px 0 30px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 36px; }
.footer h4 { color: var(--text); font-size: 14px; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .5px; }
.footer a { display: block; color: var(--muted); padding: 5px 0; font-size: 15px; }
.footer a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 22px; font-size: 14px; flex-wrap: wrap; gap: 10px; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background: var(--brand-grad);
  padding: 60px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-side::before { content:""; position:absolute; width:500px; height:500px; border-radius:50%; background:rgba(255,255,255,.12); top:-150px; right:-150px; }
.auth-side .brand { color: #fff; }
.auth-side .brand b { color: #fff; -webkit-text-fill-color:#fff; }
.auth-side h2 { font-size: 34px; color: #fff; margin: 0 0 14px; letter-spacing: -1px; line-height: 1.15; position: relative; }
.auth-side p { color: rgba(255,255,255,.92); font-size: 17px; position: relative; }
.auth-side .quote { background: rgba(255,255,255,.14); border-radius: 14px; padding: 22px; color:#fff; position:relative; }
.auth-main { display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -0.5px; }
.auth-card .sub { color: var(--muted); margin: 0 0 30px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field input {
  width: 100%; padding: 13px 15px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 15px; font-family: var(--font);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109,94,252,.2); }
.auth-foot { text-align: center; margin-top: 22px; color: var(--muted); font-size: 15px; }
.auth-foot a { color: var(--brand-2); font-weight: 600; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 15px; border-radius: 10px; font-size: 14px; margin-bottom: 18px; display: none; }
.alert.show { display: block; }
.alert-error { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.4); color: #ffb4b4; }
.alert-success { background: rgba(37,208,168,.12); border: 1px solid rgba(37,208,168,.4); color: #7fe9cf; }

/* ---------- Dashboard ---------- */
.dash { padding: 40px 0; }
.dash-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 34px; flex-wrap: wrap; gap: 14px; }
.dash-head h1 { margin: 0; font-size: 28px; }
.dash-head p { margin: 4px 0 0; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 38px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.stat-card .label { color: var(--muted); font-size: 14px; }
.stat-card .value { font-size: 28px; font-weight: 800; margin-top: 6px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-grad); display:grid; place-items:center; font-weight:700; color:#fff; }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Nav active link ---------- */
.nav-links a.link.active { color: var(--text); }
.nav-links a.link.active::after { content: ""; display: block; height: 2px; background: var(--brand-grad); border-radius: 2px; margin-top: 3px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 28px; flex-wrap: wrap; }
.tab {
  background: none; border: none; color: var(--muted);
  font-family: var(--font); font-size: 15px; font-weight: 600;
  padding: 12px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--brand); }
.tabpane { display: none; }
.tabpane.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.tbl th, table.tbl td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); }
table.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; background: var(--bg-soft); }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: var(--surface-2); }

/* ---------- Badges ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-green { background: rgba(37,208,168,.14); color: #7fe9cf; }
.pill-red   { background: rgba(255,107,107,.14); color: #ffb4b4; }
.pill-gray  { background: var(--surface-2); color: var(--muted); }
.pill-purple{ background: rgba(109,94,252,.18); color: #c3bcff; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field select, .field textarea {
  width: 100%; padding: 13px 15px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  font-size: 15px; font-family: var(--font);
}
.field textarea { resize: vertical; min-height: 90px; }
.field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
/* segmented product / service selector */
.seg { display: flex; gap: 10px; }
.seg-opt {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); border-radius: 12px; font-family: var(--font);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s ease; text-align: center;
}
.seg-opt:hover { color: var(--text); border-color: var(--brand); }
.seg-opt.active { color: #fff; border-color: transparent; background: var(--brand-grad); box-shadow: 0 8px 20px rgba(109,94,252,.3); }
.seg-opt .se { font-size: 22px; line-height: 1; }
.seg-opt small { font-weight: 500; opacity: .8; font-size: 11.5px; }

.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: transparent; border: 1px solid rgba(255,107,107,.5); color: #ffb4b4; }
.btn-danger:hover { background: rgba(255,107,107,.12); }

/* ---------- Section panel ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; margin-bottom: 24px; }
.panel h2 { margin: 0 0 4px; font-size: 20px; }
.panel .hint { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: none; place-items: center; z-index: 100; padding: 20px; overflow-y: auto;
}
.modal-back.show { display: grid; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  width: 100%; max-width: 440px; padding: 30px; box-shadow: var(--shadow);
  max-height: calc(100vh - 40px); overflow-y: auto;  /* scroll instead of clipping tall forms */
}
.modal h3 { margin: 0 0 4px; }
.modal .close { float: right; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; background: none; border: none; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }

/* switch */
.switch { position: relative; width: 46px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; transition: .2s; }
.switch .track::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .track { background: var(--brand-grad); border-color: transparent; }
.switch input:checked + .track::before { transform: translateX(20px); }

/* ---------- Blog ---------- */
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
  transition: transform .2s ease, border-color .2s ease;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--brand); }
.post-card .cover { aspect-ratio: 16/8; background: var(--brand-grad); display: grid; place-items: center; font-size: 48px; }
.post-card .pbody { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.post-card .pdate { color: var(--brand-2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.post-card h3 { margin: 8px 0 8px; font-size: 20px; letter-spacing: -.3px; }
.post-card p { color: var(--muted); font-size: 14px; margin: 0 0 16px; flex: 1; }
.post-card .read { color: var(--brand-2); font-weight: 600; font-size: 14px; }

.article { max-width: 740px; margin: 0 auto; }
.article .cover-lg { aspect-ratio: 16/6; background: var(--brand-grad); border-radius: var(--radius); display: grid; place-items: center; font-size: 70px; margin-bottom: 28px; }
.article h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -1px; margin: 0 0 12px; }
.article .meta { color: var(--muted); font-size: 14px; margin-bottom: 30px; }
.article .content { font-size: 17px; line-height: 1.8; color: #d4dae6; }
.article .content h2 { font-size: 24px; letter-spacing: -.4px; margin: 32px 0 10px; color: var(--text); }
.article .content p { margin: 0 0 18px; }
.article .content strong { color: var(--text); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 26px; font-weight: 500; }
.back-link:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4, .plans, .stat-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4, .plans, .stat-grid, .footer-grid, .form-grid { grid-template-columns: 1fr; }
  .nav-links .link { display: none; }
  .hero-stats { gap: 26px; }
}
