/* ============================================================
   Championsys CRM — Light Premium Redesign
   Design tokens + components
   ============================================================ */

:root {
  /* Canvas */
  --base: #ffffff;
  --base-subtle: #fafaff;
  --base-band: #f8fafc;
  --surface: #ffffff;
  --surface-tint: #f5f6fb;
  --hairline: rgba(15, 15, 22, 0.08);
  --hairline-strong: rgba(15, 15, 22, 0.12);

  /* Ink */
  --ink: #0f0f16;
  --ink-2: #475569;
  --ink-3: #94a3b8;

  /* Brand accents */
  --violet: #7c3aed;
  --violet-600: #6d28d9;
  --cyan: #22d3ee;
  --cyan-600: #06b6d4;
  --fuchsia: #d946ef;
  --fuchsia-400: #e879f9;
  --emerald: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;

  /* Tinted surfaces */
  --violet-50: #f3effe;
  --cyan-50: #ecfdff;
  --fuchsia-50: #fdf4ff;
  --emerald-50: #ecfdf5;

  /* Signature gradients */
  --grad-text: linear-gradient(90deg, #06b6d4, #7c3aed, #d946ef);
  --grad-cta: linear-gradient(135deg, #7c3aed, #06b6d4); /* @kind color */
  --grad-conic: conic-gradient(from 90deg at 50% 50%, #8b5cf6, #06b6d4, #d946ef, #8b5cf6); /* @kind color */

  /* Shadows (soft, layered) */
  --sh-sm: 0 1px 2px rgba(15, 15, 22, 0.04), 0 2px 8px -2px rgba(15, 15, 22, 0.06);
  --sh-md: 0 10px 40px -12px rgba(15, 15, 22, 0.12), 0 2px 8px -4px rgba(15, 15, 22, 0.06);
  --sh-lg: 0 30px 70px -24px rgba(15, 15, 22, 0.20), 0 8px 24px -12px rgba(15, 15, 22, 0.10);
  --sh-violet: 0 20px 50px -18px rgba(124, 58, 237, 0.45);

  /* Layout */
  --maxw: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem); /* @kind spacing */
  --radius: 22px;
  --radius-sm: 14px;
  --radius-lg: 30px;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
}

/* ---------------- Reset ---------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
body {
  font-family: var(--font-sans);
  background: var(--base);
  color: var(--ink);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
:focus-visible { outline: 2.5px solid var(--violet); outline-offset: 3px; border-radius: 4px; }

/* ---------------- Utilities ---------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.section { padding-block: clamp(4.5rem, 10vw, 8rem); position: relative; }
.section--band { background: var(--base-band); }
.section--subtle { background: var(--base-subtle); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 500;
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--violet);
  padding: 0.4rem 0.85rem; border-radius: 100px;
  background: var(--violet-50);
  border: 1px solid rgba(124, 58, 237, 0.14);
}
.eyebrow svg { width: 14px; height: 14px; }

.section-head { max-width: 720px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head.center { margin-inline: auto; text-align: center; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); margin-block: 1rem 1.1rem; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-2); font-weight: 400; max-width: 60ch; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-weight: 600; font-size: 0.98rem; padding: 0.9rem 1.5rem;
  border-radius: 100px; transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s, background 0.25s;
  white-space: nowrap; position: relative;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { color: #fff; background: var(--grad-cta); box-shadow: var(--sh-violet); }
.btn-primary::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%);
  background-size: 220% 100%; background-position: 200% 0;
  opacity: 0; transition: opacity .3s;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 26px 60px -18px rgba(124,58,237,.6); }
.btn-primary:hover::before { opacity: 1; animation: shimmer 1.1s linear; }
.btn-secondary { color: var(--ink); background: var(--surface); border: 1px solid var(--hairline-strong); box-shadow: var(--sh-sm); }
.btn-secondary:hover { transform: translateY(-3px); border-color: rgba(124,58,237,.5); box-shadow: 0 16px 40px -16px rgba(124,58,237,.35); }
.btn-lg { padding: 1.05rem 1.9rem; font-size: 1.05rem; }
.btn-ghost { color: var(--ink-2); padding: 0.6rem 0.9rem; }
.btn-ghost:hover { color: var(--ink); }

.cta-note { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink-3); font-size: 0.85rem; }
.cta-note svg { width: 15px; height: 15px; color: var(--emerald); }

@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -120% 0; } }

/* ---------------- Cards / glass ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--sh-md);
}
.glass {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: var(--sh-md);
}

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 100px;
}
.badge svg { width: 13px; height: 13px; }
.badge-violet { background: var(--violet-50); color: var(--violet-600); }
.badge-emerald { background: var(--emerald-50); color: #047857; }
.badge-cyan { background: var(--cyan-50); color: var(--cyan-600); }
.badge-amber { background: #fffbeb; color: #b45309; }

/* ---------------- Aurora / blobs ---------------- */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.5; will-change: transform; }
.blob-v { width: 46vw; height: 46vw; background: radial-gradient(circle, rgba(124,58,237,.55), transparent 70%); }
.blob-c { width: 40vw; height: 40vw; background: radial-gradient(circle, rgba(34,211,238,.5), transparent 70%); }
.blob-f { width: 38vw; height: 38vw; background: radial-gradient(circle, rgba(217,70,239,.42), transparent 70%); }
@keyframes blob {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(4vw,-5vw) scale(1.12); }
  66% { transform: translate(-3vw,3vw) scale(0.92); }
}
.blob { animation: blob 18s ease-in-out infinite; }

/* ---------------- Reveal on scroll ---------------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-delay="1"] { transition-delay: .08s; }
[data-reveal][data-delay="2"] { transition-delay: .16s; }
[data-reveal][data-delay="3"] { transition-delay: .24s; }
[data-reveal][data-delay="4"] { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } }

/* ---------------- Demo scheduling modal ---------------- */
.demo-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 1rem; }
.demo-modal.open { display: flex; }
.demo-backdrop { position: absolute; inset: 0; background: rgba(15,15,22,0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: demoFade .25s ease; }
.demo-box { position: relative; width: 100%; max-width: 1000px; height: 90vh; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--sh-lg); overflow: hidden; display: flex; flex-direction: column; animation: demoIn .3s cubic-bezier(.2,.8,.2,1); }
@keyframes demoFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes demoIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.demo-bar { height: 4px; background: var(--grad-text); flex-shrink: 0; }
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.4rem; border-bottom: 1px solid var(--hairline); }
.demo-head-l { display: flex; align-items: center; gap: .85rem; }
.demo-head h3 { font-size: 1.05rem; }
.demo-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--violet-50); color: var(--violet); flex-shrink: 0; }
.demo-ic svg { width: 20px; height: 20px; }
.demo-meta { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: .3rem; font-size: .78rem; color: var(--ink-3); }
.demo-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.demo-meta svg { width: 12px; height: 12px; }
.demo-close { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); transition: background .2s, color .2s; flex-shrink: 0; }
.demo-close:hover { background: var(--surface-tint); color: var(--ink); }
.demo-close svg { width: 20px; height: 20px; }
.demo-body { position: relative; flex: 1; background: var(--surface-tint); }
.demo-body iframe { position: relative; z-index: 1; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .5s ease; }
.demo-modal.frame-loaded .demo-body iframe { opacity: 1; }
.demo-skel { position: absolute; inset: 0; z-index: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; color: var(--ink-2); font-weight: 500; }
.demo-modal.frame-loaded .demo-skel { display: none; }
.demo-spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--violet-50); border-top-color: var(--violet); animation: demoSpin 1s linear infinite; }
@keyframes demoSpin { to { transform: rotate(360deg); } }
.demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .7rem 1.4rem; border-top: 1px solid var(--hairline); font-size: .76rem; color: var(--ink-3); }
.demo-foot svg { width: 12px; height: 12px; display: inline-block; vertical-align: -1px; }
.demo-foot a { color: var(--violet-600); font-weight: 600; }
@media (max-width: 640px) { .demo-box { height: 92vh; } .demo-meta span:nth-child(n+2) { display: none; } }

/* ---------------- Logged-in profile (navbar) ---------------- */
.mobile-auth { display: flex; flex-direction: column; gap: .6rem; margin-top: .4rem; }
.crm-profile { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .7rem .3rem .35rem; border-radius: 100px; background: var(--surface-tint); border: 1px solid var(--hairline); }
.crm-ava { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--violet-50); color: var(--violet-600); font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.crm-ava-img { width: 100%; height: 100%; object-fit: cover; }
.crm-ava-ini { line-height: 1; }
.crm-name { font-size: .82rem; font-weight: 600; color: var(--ink); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-go svg { width: 15px; height: 15px; }
.crm-profile--m { width: 100%; padding: .7rem .9rem; border-radius: var(--radius-sm); }
.crm-ava--lg { width: 40px; height: 40px; font-size: 1rem; }
.crm-pcol { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.crm-pcol .crm-name { max-width: 100%; }
.crm-mail { font-size: .72rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
