/* ═══════════════════════════════════════════════════════════
   CLOUD LEAD PANEL — Design System v2
   Premium SaaS Dashboard Theme
═══════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --brand:        #4f46e5;
  --brand-light:  #6366f1;
  --brand-soft:   rgba(79,70,229,.1);
  --brand-glow:   rgba(79,70,229,.22);
  --teal:         #0d9488;
  --ink:          #0f172a;
  --ink-2:        #1e293b;
  --muted:        #64748b;
  --muted-2:      #94a3b8;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;
  --surface-3:    #f1f5f9;
  --border:       #e2e8f0;
  --border-2:     #cbd5e1;
  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --sidebar-bg:   #0b0f1a;
  --sidebar-text: rgba(255,255,255,.75);
  --sidebar-w:    260px;
  --header-h:     64px;
  --radius:       12px;
  --radius-lg:    16px;
  --radius-xl:    22px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md:    0 4px 24px rgba(0,0,0,.1);
  --font:         "Plus Jakarta Sans","Segoe UI",sans-serif;
  --font-display: "Space Grotesk","Segoe UI",sans-serif;
}

/* ── Reset ──────────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; -webkit-font-smoothing:antialiased; }
body { font-family:var(--font); color:var(--ink); background:var(--surface-2); font-size:15px; line-height:1.6; }
a { color:inherit; text-decoration:none; }
strong { font-weight:700; }
h1,h2,h3,h4 { font-family:var(--font-display); letter-spacing:-.03em; line-height:1.2; color:var(--ink); }
img { max-width:100%; display:block; }

/* ── Utilities ──────────────────────────────────────────── */
.container { width:min(1280px,100% - 2rem); margin-inline:auto; }
.muted     { color:var(--muted); }
.small-text{ font-size:.82rem; }
.eyebrow {
  font-size:.68rem; font-weight:700; letter-spacing:.12em;
  text-transform:uppercase; color:var(--brand);
}
.text-link { color:var(--brand); font-weight:600; }
.text-link:hover { text-decoration:underline; }
.stack { display:grid; gap:1rem; }
.inline-grid   { display:grid; gap:1rem; }
.inline-grid-2 { grid-template-columns:1fr 1fr; }
.inline-grid-3 { grid-template-columns:1fr 1fr 1fr; }
.actions-row   { display:flex; gap:.75rem; align-items:center; flex-wrap:wrap; }
.panel-span-2  { grid-column:span 2; }
.mini-form     { display:grid; gap:.5rem; }
.checkbox-row  { display:flex; align-items:center; gap:.6rem; font-weight:600; }
.checkbox-row input { width:auto; margin:0; }

/* ── Buttons ────────────────────────────────────────────── */
.button, button[type=submit], button.button {
  display:inline-flex; align-items:center; justify-content:center; gap:.45rem;
  border:none; border-radius:var(--radius); cursor:pointer;
  font:600 .875rem var(--font);
  padding:.65rem 1.25rem;
  background:linear-gradient(135deg,var(--brand),var(--brand-light));
  color:#fff;
  box-shadow:0 2px 8px var(--brand-glow);
  transition:opacity .15s, transform .1s, box-shadow .15s;
  white-space:nowrap;
}
.button:hover, button[type=submit]:hover { opacity:.9; transform:translateY(-1px); box-shadow:0 4px 16px var(--brand-glow); }
.button.secondary, button.secondary {
  background:var(--surface); color:var(--ink-2);
  border:1.5px solid var(--border); box-shadow:none;
}
.button.secondary:hover { border-color:var(--border-2); background:var(--surface-3); transform:none; }
.button.danger { background:linear-gradient(135deg,#dc2626,#ef4444); box-shadow:0 2px 8px rgba(239,68,68,.25); }

/* ── Forms ──────────────────────────────────────────────── */
label {
  display:block; font-size:.8rem; font-weight:700;
  letter-spacing:.03em; color:var(--muted); margin-bottom:.35rem;
  text-transform:uppercase;
}
input, select, textarea {
  width:100%; border:1.5px solid var(--border);
  border-radius:var(--radius); padding:.625rem .875rem;
  font:inherit; font-size:.9rem; color:var(--ink-2);
  background:var(--surface); transition:border-color .15s, box-shadow .15s;
  appearance:auto;
}
input:focus, select:focus, textarea:focus {
  outline:none; border-color:var(--brand);
  box-shadow:0 0 0 3px var(--brand-soft);
}
input::placeholder, textarea::placeholder { color:var(--muted-2); }
select { cursor:pointer; }
textarea { resize:vertical; }

/* ── Cards / Panels ─────────────────────────────────────── */
.card, .table-card, .panel {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
  padding:1.25rem 1.5rem;
}
.panel-heading {
  display:flex; justify-content:space-between; align-items:flex-start;
  gap:1rem; margin-bottom:1.25rem;
  padding-bottom:1rem; border-bottom:1px solid var(--surface-3);
}
.panel-heading h3 { font-size:1rem; font-weight:700; color:var(--ink); margin:.25rem 0 0; }

/* ── Dashboard grid helpers ─────────────────────────────── */
.dashboard-panels        { display:grid; gap:1.25rem; }
.dashboard-panels-3      { grid-template-columns:repeat(3,1fr); }
.stats-grid, .stats-grid-4 { display:grid; gap:1rem; grid-template-columns:repeat(4,1fr); }
.pricing-grid            { display:grid; gap:1rem; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); }
.shortcut-grid           { display:grid; gap:.75rem; grid-template-columns:1fr 1fr; }

/* ── Stat Card component ─────────────────────────────────── */
.stat-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:1.1rem 1.25rem;
  box-shadow:var(--shadow); transition:box-shadow .2s, transform .15s;
}
.stat-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.stat-card .label { font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); }
.stat-card .value { font-family:var(--font-display); font-size:2rem; font-weight:700; color:var(--ink); line-height:1.1; margin:.3rem 0 .2rem; }
.stat-card .hint  { font-size:.8rem; color:var(--muted-2); }
.stat-number { font-family:var(--font-display); font-size:2rem; font-weight:700; }

/* ── Health / key-value list ────────────────────────────── */
.health-list { display:grid; gap:.5rem; }
.health-item {
  display:flex; justify-content:space-between; align-items:center;
  padding:.6rem .9rem; border-radius:10px;
  background:var(--surface-2); font-size:.875rem;
}
.health-item span  { color:var(--muted); }
.health-item strong{ color:var(--ink); font-weight:700; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display:inline-flex; align-items:center;
  padding:.25rem .65rem; border-radius:999px;
  font-size:.72rem; font-weight:700; letter-spacing:.03em;
  background:var(--brand-soft); color:var(--brand);
}
.badge-active, .badge-paid, .badge-completed {
  background:#dcfce7; color:#166534;
}
.badge-pending, .badge-trialing { background:#fef3c7; color:#92400e; }
.badge-suspended,.badge-failed,.badge-cancelled { background:#fee2e2; color:#991b1b; }
.badge-inactive { background:var(--surface-3); color:var(--muted); }

/* ── Tables ─────────────────────────────────────────────── */
.table { width:100%; border-collapse:collapse; font-size:.875rem; }
.table th {
  text-align:left; padding:.625rem 1rem;
  background:var(--surface-2); font-size:.72rem; font-weight:700;
  text-transform:uppercase; letter-spacing:.07em; color:var(--muted);
  border-bottom:1px solid var(--border);
}
.table td {
  padding:.75rem 1rem; border-bottom:1px solid var(--surface-3);
  color:var(--ink-2); vertical-align:middle;
}
.table tbody tr:last-child td { border-bottom:none; }
.table tbody tr:hover td { background:var(--surface-2); }
.table-footer { padding:.75rem 0; }

/* ── Progress bar ───────────────────────────────────────── */
.progress { width:100%; height:8px; border-radius:999px; background:var(--surface-3); overflow:hidden; }
.progress span { display:block; height:100%; border-radius:999px; background:linear-gradient(90deg,var(--brand),var(--brand-light)); transition:width .4s ease; }

/* ── Callout / Alert ────────────────────────────────────── */
.callout {
  padding:.875rem 1.1rem; border-radius:var(--radius);
  background:linear-gradient(135deg,rgba(79,70,229,.08),rgba(13,148,136,.07));
  border:1px solid rgba(79,70,229,.15); font-size:.9rem; color:var(--ink-2);
}
.callout-danger { background:#fef2f2; border-color:#fecaca; color:#991b1b; }
.error-list { margin:.5rem 0 0 1rem; padding:0; font-size:.875rem; }

/* ── Shortcut card ──────────────────────────────────────── */
.shortcut-card {
  display:grid; gap:.3rem; padding:.875rem 1rem;
  background:var(--surface); border:1.5px solid var(--border);
  border-radius:var(--radius); text-decoration:none;
  transition:border-color .15s, background .15s, transform .15s;
}
.shortcut-card strong { font-size:.875rem; color:var(--ink); }
.shortcut-card span   { font-size:.8rem; color:var(--muted); line-height:1.4; }
.shortcut-card:hover  { border-color:var(--brand); background:var(--brand-soft); transform:translateY(-2px); }

/* ══════════════════════════════════════════════════════════
   DASHBOARD SHELL (Sidebar + Main)
══════════════════════════════════════════════════════════ */
.dashboard-body {
  min-height:100vh;
  background:var(--surface-2);
}
.dashboard-shell {
  min-height:100vh;
  display:grid;
  grid-template-columns:var(--sidebar-w) 1fr;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  position:sticky; top:0; height:100vh;
  overflow-y:auto; overflow-x:hidden;
  background:var(--sidebar-bg);
  border-right:1px solid rgba(255,255,255,.05);
  display:flex; flex-direction:column;
  padding:0;
  scrollbar-width:none;
}
.sidebar::-webkit-scrollbar { display:none; }

.sidebar-brand {
  display:flex; align-items:center; gap:.875rem;
  padding:1.25rem 1.25rem .875rem;
  border-bottom:1px solid rgba(255,255,255,.06);
  flex-shrink:0;
}
.sidebar-brand strong  { font-size:.95rem; font-weight:700; color:#fff; display:block; line-height:1.2; }
.sidebar-brand-mark {
  width:38px; height:38px; border-radius:10px; flex-shrink:0;
  background:linear-gradient(135deg,var(--brand),var(--brand-light));
  display:grid; place-items:center;
  font-family:var(--font-display); font-weight:800; color:#fff; font-size:1rem;
  box-shadow:0 4px 12px var(--brand-glow);
}
.sidebar-brand-logo { width:38px; height:38px; border-radius:10px; object-fit:cover; }

.sidebar-user-card {
  margin:1rem .875rem .5rem;
  display:flex; align-items:center; gap:.75rem;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  border-radius:var(--radius); padding:.75rem;
  flex-shrink:0;
}
.sidebar-user-avatar {
  width:34px; height:34px; border-radius:9px; flex-shrink:0;
  background:linear-gradient(135deg,var(--brand),#818cf8);
  display:grid; place-items:center;
  font-weight:700; font-size:.9rem; color:#fff;
}
.sidebar-user-card strong  { font-size:.85rem; font-weight:600; color:#fff; display:block; line-height:1.3; }
.sidebar-user-card .small-text { color:rgba(255,255,255,.45); font-size:.75rem; }

.sidebar-nav {
  flex:1; padding:.5rem .875rem 1rem;
  display:flex; flex-direction:column; gap:.125rem;
  overflow-y:auto;
}
.sidebar-section { margin-top:1.25rem; }
.sidebar-section:first-child { margin-top:.5rem; }
.sidebar-section-title {
  font-size:.65rem; font-weight:800; letter-spacing:.12em;
  text-transform:uppercase; color:rgba(255,255,255,.3);
  padding:.25rem .6rem; margin-bottom:.35rem;
}
.sidebar-link {
  display:flex; align-items:center; gap:.75rem;
  padding:.6rem .875rem; border-radius:9px;
  color:rgba(255,255,255,.6); font-size:.875rem; font-weight:500;
  transition:background .15s, color .15s, transform .1s;
}
.sidebar-link:hover { background:rgba(255,255,255,.07); color:rgba(255,255,255,.9); }
.sidebar-link.active {
  background:linear-gradient(90deg,rgba(79,70,229,.35),rgba(79,70,229,.1));
  color:#fff; font-weight:600;
  border-left:3px solid var(--brand);
  padding-left:calc(.875rem - 3px);
}
.sidebar-footer {
  margin-top:auto; padding:.875rem 1.25rem;
  border-top:1px solid rgba(255,255,255,.06);
  font-size:.72rem; color:rgba(255,255,255,.3); flex-shrink:0;
}

/* ── Main area ──────────────────────────────────────────── */
.dashboard-main {
  display:flex; flex-direction:column;
  min-width:0; overflow-x:hidden;
}

.dashboard-header {
  position:sticky; top:0; z-index:10;
  height:var(--header-h);
  background:rgba(248,250,252,.92);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  padding:0 1.75rem; gap:1rem; flex-shrink:0;
}
.dashboard-header-left { display:flex; flex-direction:column; gap:1px; }
.dashboard-header-left .eyebrow { margin:0; color:var(--muted-2); }
.dashboard-title {
  font-size:1.25rem; font-weight:700; color:var(--ink); margin:0; line-height:1;
}
.dashboard-header-actions {
  display:flex; align-items:center; gap:.75rem; flex-wrap:wrap;
}
.dashboard-header-chip {
  font-size:.8rem; color:var(--muted); padding:.35rem .875rem;
  background:var(--surface); border:1px solid var(--border);
  border-radius:999px; font-weight:500;
}
.dashboard-content {
  flex:1; padding:1.5rem 1.75rem 2.5rem;
  display:grid; gap:1.25rem; align-content:start;
}
.dashboard-flash { display:grid; gap:.5rem; }

/* ── Dashboard hero banner ─────────────────────────────── */
.dashboard-hero {
  display:grid; grid-template-columns:1.4fr .9fr;
  gap:1rem; padding:1.75rem 2rem;
  background:linear-gradient(135deg,#0f0c29,#302b63 50%,#24243e);
  border-radius:var(--radius-xl); color:#fff;
  box-shadow:0 8px 32px rgba(15,12,41,.3);
  overflow:hidden; position:relative;
}
.dashboard-hero::before {
  content:''; position:absolute; top:-40px; right:-40px;
  width:240px; height:240px; border-radius:50%;
  background:radial-gradient(circle,rgba(99,102,241,.35),transparent 70%);
  pointer-events:none;
}
.dashboard-hero h2 { font-size:clamp(1.5rem,2.8vw,2.4rem); margin-bottom:.5rem; }
.dashboard-hero .muted, .dashboard-hero .small-text { color:rgba(255,255,255,.65); }
.dashboard-hero .eyebrow { color:#a5b4fc; }
.hero-metrics { display:grid; gap:.875rem; }
.hero-metric-card {
  background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.12);
  border-radius:14px; padding:1rem 1.1rem; color:#fff;
}
.hero-metric-card strong { display:block; font-size:1.75rem; font-family:var(--font-display); margin:.2rem 0; }

/* ══════════════════════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════════════════════ */
.auth-body {
  min-height:100vh;
  background:linear-gradient(135deg,#0f0c29 0%,#302b63 50%,#24243e 100%);
  display:grid; place-items:center; padding:1.5rem;
}
.auth-shell {
  min-height:100vh; display:grid; align-items:center; padding:2rem;
  background:
    radial-gradient(circle at 20% 20%,rgba(79,70,229,.12),transparent 40%),
    radial-gradient(circle at 80% 80%,rgba(13,148,136,.1),transparent 40%),
    #f1f5f9;
}
.auth-alert-wrap { width:min(1100px,100%); margin:0 auto 1rem; }
.auth-scene {
  width:min(1100px,100%); margin:0 auto;
  display:grid; grid-template-columns:1.1fr .9fr;
  gap:1.5rem; align-items:stretch;
}
.auth-marketing-panel {
  background:linear-gradient(150deg,#0f0c29,#302b63 55%,#1e1b4b);
  border-radius:var(--radius-xl); padding:2.5rem;
  color:#fff; display:grid; align-content:center; gap:1rem;
  box-shadow:0 20px 60px rgba(15,12,41,.4);
}
.auth-marketing-panel h1 { font-size:clamp(2rem,3.5vw,3.5rem); margin:0; line-height:1; color:#fff; }
.auth-marketing-panel p  { color:rgba(255,255,255,.72); font-size:.95rem; line-height:1.7; }
.auth-feature-list  { display:grid; gap:.65rem; margin-top:.5rem; }
.auth-feature-item {
  padding:.875rem 1rem; border-radius:12px;
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.1);
}
.auth-feature-item strong { display:block; color:#fff; margin-bottom:.2rem; font-size:.9rem; }
.auth-feature-item span   { color:rgba(255,255,255,.65); font-size:.83rem; }
.auth-card {
  background:var(--surface); border-radius:var(--radius-xl);
  padding:2rem; box-shadow:var(--shadow-md);
  border:1px solid var(--border); display:grid; gap:1rem; align-content:start;
}
.auth-card-elevated { justify-self:end; }
.auth-card h2 { font-size:1.75rem; margin:.25rem 0; }
.auth-links-row { display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.auth-links-row a { color:var(--brand); font-weight:600; font-size:.875rem; }
.auth-brand-banner { display:inline-flex; align-items:center; gap:.875rem; flex-wrap:wrap; }
.auth-brand-logo, .auth-brand-banner img { width:48px; height:48px; border-radius:12px; object-fit:cover; }
.captcha-wrap { margin:.25rem 0 .75rem; }

/* ══════════════════════════════════════════════════════════
   MARKETING / PUBLIC PAGES
══════════════════════════════════════════════════════════ */
.marketing-body { background:var(--surface-2); }
.topbar {
  position:sticky; top:0; z-index:20;
  background:rgba(255,255,255,.88); backdrop-filter:blur(18px);
  border-bottom:1px solid var(--border);
}
.topbar-inner, .nav-links, .actions { display:flex; align-items:center; gap:1rem; }
.topbar-inner { justify-content:space-between; padding:.875rem 0; }
.brand { font-family:var(--font-display); font-size:1.1rem; font-weight:800; color:var(--ink); }
.brand-inline { display:inline-flex; align-items:center; gap:.6rem; }
.brand-inline-logo { width:32px; height:32px; border-radius:9px; object-fit:cover; }
.nav-links a { color:var(--muted); font-size:.9rem; font-weight:500; transition:color .15s; }
.nav-links a:hover { color:var(--ink); }
.footer { padding:2rem 0 3rem; color:var(--muted); font-size:.875rem; }
.marketing-body .hero {
  display:grid; grid-template-columns:1.25fr .9fr;
  gap:2rem; padding:4rem 0 3rem; align-items:center;
}

/* ══════════════════════════════════════════════════════════
   CHALLENGE / CAPTCHA PAGE
══════════════════════════════════════════════════════════ */
.challenge-body { display:grid; place-items:center; min-height:100vh; padding:1.5rem; }
.challenge-shell { width:min(520px,100%); }
.challenge-card {
  padding:2rem; border-radius:var(--radius-xl);
  background:var(--surface); border:1px solid var(--border);
  box-shadow:var(--shadow-md); display:grid; gap:1rem;
}
.challenge-card h1 { font-size:1.75rem; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width:1100px) {
  :root { --sidebar-w:220px; }
  .dashboard-hero, .auth-scene { grid-template-columns:1fr; }
  .dashboard-panels-3 { grid-template-columns:1fr 1fr; }
  .panel-span-2 { grid-column:1/-1; }
  .stats-grid, .stats-grid-4 { grid-template-columns:1fr 1fr; }
}
@media (max-width:768px) {
  .dashboard-shell { grid-template-columns:1fr; }
  .sidebar { position:relative; height:auto; overflow:visible; border-right:none; border-bottom:1px solid rgba(255,255,255,.06); }
  .sidebar-nav { flex-direction:row; flex-wrap:wrap; padding:.5rem; gap:.25rem; }
  .sidebar-section { margin-top:0; }
  .sidebar-section-title { display:none; }
  .sidebar-link { padding:.45rem .75rem; font-size:.8rem; }
  .sidebar-link.active { border-left:none; border-bottom:2px solid var(--brand); padding-left:.75rem; border-radius:9px 9px 0 0; }
  .sidebar-user-card { margin:.5rem; }
  .sidebar-brand { padding:.875rem 1rem; }
  .dashboard-content { padding:1rem 1rem 2rem; }
  .dashboard-header { padding:0 1rem; }
  .dashboard-title { font-size:1.1rem; }
  .dashboard-panels-3, .inline-grid-2, .inline-grid-3 { grid-template-columns:1fr; }
  .panel-span-2 { grid-column:auto; }
  .auth-shell { padding:1rem; }
  .nav-links { display:none; }
}
@media (max-width:480px) {
  .stats-grid, .stats-grid-4 { grid-template-columns:1fr; }
  .dashboard-header { height:auto; padding:.875rem 1rem; flex-wrap:wrap; }
  .auth-card { padding:1.25rem; }
}
