/* ═══════════════════════════════════════════════════════
   KLLAKAR AI — UNIFIED DESIGN SYSTEM v3.0
   Single source of truth for ALL pages
   Font: DM Sans (body) + Syne (display) — consistent everywhere
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Syne:wght@700;800&display=swap');

/* ── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* Accent */
  --ac:      #ff2d7a;
  --ac-h:    #ff1265;
  --ac-s:    #ff6fa3;
  --ac-bg:   rgba(255,45,122,.08);
  --ac-br:   rgba(255,45,122,.18);
  --ac-glow: rgba(255,45,122,.14);

  /* Green */
  --green:    #22c55e;
  --green-dk: #16a34a;
  --green-bg: rgba(34,197,94,.08);
  --green-br: rgba(34,197,94,.18);

  /* Red */
  --red:    #ef4444;
  --red-bg: rgba(239,68,68,.08);
  --red-br: rgba(239,68,68,.18);

  /* Backgrounds */
  --s0: #0d0d0d;
  --s1: #111111;
  --s2: #181818;
  --s3: #202020;
  --s4: #2a2a2a;

  /* Borders */
  --b1: #1e1e1e;
  --b2: #2c2c2c;
  --b3: #3c3c3c;

  /* Text */
  --t1: #f2f2f2;
  --t2: #979797;
  --t3: #525252;

  /* Typography */
  --f:  'DM Sans', system-ui, -apple-system, sans-serif;
  --fd: 'Syne', sans-serif;

  /* Spacing & Radius */
  --r:      8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Motion */
  --dur:  160ms;
  --ease: cubic-bezier(.16,1,.3,1);
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--s0);
  color: var(--t1);
  font-family: var(--f);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--f); border: none; background: none; }
input, textarea, select { font-family: var(--f); }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--b3); border-radius: 99px; }
::selection { background: var(--ac-bg); color: var(--ac-s); }

/* ── LAYOUT ─────────────────────────────────────────────── */
.wrap    { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.wrap-sm { width: 100%; max-width: 480px;  margin: 0 auto; padding: 0 24px; }
.wrap-md { width: 100%; max-width: 720px;  margin: 0 auto; padding: 0 24px; }
.pg      { position: relative; z-index: 1; }

/* ── TYPOGRAPHY SCALE ───────────────────────────────────── */
.d1    { font-family: var(--fd); font-size: clamp(2.6rem,6vw,4.2rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.d2    { font-family: var(--fd); font-size: clamp(2rem,4.5vw,3rem);   font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.d3    { font-family: var(--fd); font-size: clamp(1.6rem,3vw,2.2rem); font-weight: 800; letter-spacing: -.03em;  line-height: 1.1; }
.h1    { font-family: var(--fd); font-size: 1.6rem;  font-weight: 700; letter-spacing: -.02em; }
.h2    { font-family: var(--fd); font-size: 1.2rem;  font-weight: 700; letter-spacing: -.015em; }
.h3    { font-family: var(--fd); font-size: 1rem;    font-weight: 700; }
.body-lg { font-size: 1.0625rem; color: var(--t2); line-height: 1.7; }
.body    { font-size: .9rem;    color: var(--t2); line-height: 1.7; }
.sm      { font-size: .8rem;    color: var(--t3); }
.label-xs { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); }
.ac    { color: var(--ac); }

/* ── BUTTON SYSTEM ──────────────────────────────────────── */
/* Base */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: .6rem 1.25rem;
  border-radius: var(--r-full);     /* pill by default */
  font-size: .85rem; font-weight: 600; font-family: var(--f);
  transition: all var(--dur) var(--ease);
  white-space: nowrap; cursor: pointer; border: none;
  letter-spacing: -.01em;
}
/* Sizes */
.btn-sm  { padding: .4rem .9rem;  font-size: .78rem; }
.btn-lg  { padding: .8rem 1.6rem; font-size: .95rem; }
.btn-xl  { padding: .95rem 2rem;  font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* Variants */
.btn-primary {
  background: var(--ac); color: #fff;
}
.btn-primary:hover {
  background: var(--ac-h);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--ac-glow);
}
.btn-primary:active { transform: none; box-shadow: none; }

.btn-secondary {
  background: var(--s2); color: var(--t1);
  border: 1px solid var(--b2);
}
.btn-secondary:hover { background: var(--s3); border-color: var(--b3); }

.btn-ghost {
  background: transparent; color: var(--t2);
  border: 1px solid var(--b2);
}
.btn-ghost:hover { background: var(--s2); color: var(--t1); border-color: var(--b3); }

.btn-ac-outline {
  background: var(--ac-bg); color: var(--ac);
  border: 1px solid var(--ac-br);
}
.btn-ac-outline:hover { background: rgba(255,45,122,.14); }

.btn-danger {
  background: var(--red-bg); color: var(--red);
  border: 1px solid var(--red-br);
}
.btn-danger:hover { background: rgba(239,68,68,.14); }

.btn:disabled { opacity: .4; pointer-events: none; }

/* ── INPUT SYSTEM ────────────────────────────────────────── */
.field     { display: flex; flex-direction: column; gap: 6px; }
.field-lbl { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--t3); }

.inp {
  width: 100%;
  background: var(--s2); border: 1px solid var(--b2);
  border-radius: var(--r);
  padding: .7rem 1rem;
  color: var(--t1); font-size: .9rem; font-family: var(--f);
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
  -webkit-appearance: none; /* Remove default styles on mobile */
}
.inp:focus { border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-bg); }
.inp::placeholder { color: var(--t3); }
.inp:read-only { opacity: .5; cursor: not-allowed; }
textarea.inp { resize: vertical; min-height: 88px; line-height: 1.6; }

.inp-wrap { position: relative; }
.inp-wrap .inp { padding-left: 2.6rem; }
.inp-icon {
  position: absolute; left: .85rem; top: 50%;
  transform: translateY(-50%);
  color: var(--t3); pointer-events: none;
  display: flex; align-items: center;
}

/* ── CARDS ───────────────────────────────────────────────── */
.card      { background: var(--s1); border: 1px solid var(--b1); border-radius: var(--r-lg); padding: 24px; }
.card-sm   { padding: 16px; border-radius: var(--r-md); }
.card:hover { border-color: var(--b2); }

/* ── BADGES ──────────────────────────────────────────────── */
.badge       { display: inline-flex; align-items: center; gap: 4px; padding: .2rem .6rem; border-radius: var(--r-full); font-size: .68rem; font-weight: 700; }
.badge-ac    { background: var(--ac-bg); color: var(--ac);      border: 1px solid var(--ac-br); }
.badge-green { background: var(--green-bg); color: var(--green-dk); border: 1px solid var(--green-br); }
.badge-muted { background: var(--s3); color: var(--t3);         border: 1px solid var(--b2); }
.badge-dot   { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider { display: flex; align-items: center; gap: 12px; color: var(--t3); font-size: .8rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--b1); }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: var(--r); font-size: .85rem; }
.alert-error   { background: var(--red-bg); border: 1px solid var(--red-br); color: #fca5a5; }
.alert-success { background: var(--green-bg); border: 1px solid var(--green-br); color: #86efac; }
.alert-info    { background: var(--ac-bg); border: 1px solid var(--ac-br); color: var(--ac-s); }

/* ── SITE NAV (public pages) ─────────────────────────────── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 62px;
  transition: all .3s var(--ease);
}
.site-nav.scrolled {
  background: rgba(13,13,13,.94);
  border-bottom: 1px solid var(--b1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.nav-logo { font-family: var(--fd); font-size: 1.25rem; font-weight: 800; letter-spacing: -.03em; color: var(--t1); }
.nav-logo span { color: var(--ac); }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-link  { font-size: .85rem; color: var(--t2); transition: color var(--dur); }
.nav-link:hover { color: var(--t1); }
.nav-cta   { display: flex; align-items: center; gap: 10px; }

/* ── APP BAR (logged-in pages) ───────────────────────────── */
.app-bar {
  background: var(--s1); border-bottom: 1px solid var(--b1);
  padding: 0 20px; height: 54px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.app-bar-logo      { font-family: var(--fd); font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; color: var(--t1); }
.app-bar-logo span { color: var(--ac); }
.app-bar-sep       { width: 1px; height: 18px; background: var(--b2); flex-shrink: 0; }
.app-bar-title     { font-size: .85rem; color: var(--t2); font-weight: 400; }
.app-bar-end       { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ── DECORATIVE ──────────────────────────────────────────── */
.grid-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,45,122,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,45,122,.022) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 20%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 20%, transparent 100%);
}
.orb { position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0; }
.orb-1 { width: 560px; height: 400px; background: rgba(255,45,122,.07); top: -180px; left: 50%; transform: translateX(-50%); }
.orb-2 { width: 300px; height: 300px; background: rgba(100,30,180,.05); bottom: 5%; right: -80px; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--s2); border: 1px solid var(--b2);
  color: var(--t1); padding: .6rem 1.4rem;
  border-radius: var(--r-full); font-size: .83rem; font-weight: 500;
  opacity: 0; transition: all .28s var(--ease);
  pointer-events: none; z-index: 9999; white-space: nowrap;
}
.toast.on  { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok  { border-color: var(--green-br); color: var(--green); }
.toast.err { border-color: var(--ac-br); color: var(--ac); }

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeUp  { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes pulse   { 0%,100%{ opacity:1; transform:scale(1); } 50%{ opacity:.5; transform:scale(1.5); } }

.au   { animation: fadeUp  .5s var(--ease) both; }
.ai   { animation: fadeIn  .4s var(--ease) both; }
.d1s  { animation-delay: .1s; }
.d2s  { animation-delay: .2s; }
.d3s  { animation-delay: .3s; }
.d4s  { animation-delay: .4s; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .hide-m { display: none !important; }
  .nav-links { display: none; }
  .site-nav { padding: 0 16px; }
  .wrap, .wrap-sm, .wrap-md { padding: 0 16px; }
}
@media (min-width: 769px) { .hide-d { display: none !important; } }