*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #07070f;
  --surface:  #0d0d1c;
  --card:     #111126;
  --border:   #1c1c38;
  --accent:   #c0392b;
  --accent2:  #e74c3c;
  --glow:     rgba(192,57,43,.25);
  --text:     #e2e2f0;
  --muted:    #5a5a7a;
  --sub:      #8888aa;
  --success:  #27ae60;
  --warn:     #f39c12;
  --r:        8px;
  --sidebar:  220px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { color: #ff6b6b; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Utility ───────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.text-muted { color: var(--muted); }
.text-sub { color: var(--sub); }
.text-success { color: var(--success); }
.text-warn { color: var(--warn); }
.text-accent { color: var(--accent2); }
.w-full { width: 100%; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: var(--r); border: none;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .18s; user-select: none; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 2px 16px var(--glow);
}
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-1px); box-shadow: 0 4px 24px var(--glow); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent2); }
.btn-ghost { background: transparent; color: var(--sub); border: none; }
.btn-ghost:hover { color: var(--text); background: var(--border); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }

/* ── Inputs ────────────────────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-group label { font-size: 12px; font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: .5px; }
.input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 14px;
  color: var(--text); font-size: 14px; width: 100%;
  transition: border-color .18s, box-shadow .18s; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.input::placeholder { color: var(--muted); }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px;
}
.card-hover { transition: border-color .18s, transform .18s; }
.card-hover:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ── Alert ─────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px; border-radius: var(--r);
  font-size: 13px; border-left: 3px solid;
}
.alert-error { background: rgba(192,57,43,.12); border-color: var(--accent); color: #ff8a7a; }
.alert-success { background: rgba(39,174,96,.12); border-color: var(--success); color: #6edb95; }

/* ═══════════════════════════════════════════════════════════
   LANDING PAGE
═══════════════════════════════════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 60px;
  background: rgba(7,7,15,.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-size: 20px; font-weight: 800; letter-spacing: 2px; color: var(--text); }
.nav-logo span { color: var(--accent2); }
.nav-actions { display: flex; gap: 10px; }

.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 80px 20px 60px;
  background: radial-gradient(ellipse 80% 50% at 50% 20%, rgba(192,57,43,.12) 0%, transparent 70%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  background: rgba(192,57,43,.15); border: 1px solid rgba(192,57,43,.3);
  color: var(--accent2); font-size: 12px; font-weight: 600;
  letter-spacing: .5px; margin-bottom: 28px;
}
.hero-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent2); display: inline-block; animation: pulse 2s infinite; }
.hero-title {
  font-size: clamp(52px, 10vw, 96px); font-weight: 900;
  letter-spacing: -2px; line-height: 1;
  background: linear-gradient(135deg, #fff 30%, var(--accent2) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: clamp(16px, 2.5vw, 20px); color: var(--sub);
  max-width: 520px; margin: 0 auto 40px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.features {
  padding: 80px 40px;
  max-width: 1100px; margin: 0 auto;
}
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--accent2); text-transform: uppercase; margin-bottom: 8px;
}
.section-title { font-size: 32px; font-weight: 800; margin-bottom: 12px; }
.section-desc { color: var(--sub); max-width: 500px; margin-bottom: 48px; }
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px;
}
.feat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
  transition: border-color .2s, transform .2s;
}
.feat-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.feat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(192,57,43,.15); display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 16px;
}
.feat-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feat-card p { color: var(--sub); font-size: 13px; line-height: 1.6; }

.landing-footer {
  text-align: center; padding: 32px;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse 60% 60% at 50% 0%, rgba(192,57,43,.1) 0%, transparent 60%);
}
.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo h1 { font-size: 28px; font-weight: 900; letter-spacing: 3px; }
.auth-logo h1 span { color: var(--accent2); }
.auth-logo p { color: var(--sub); font-size: 13px; margin-top: 4px; }
.auth-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.auth-subtitle { color: var(--sub); font-size: 13px; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--sub); }
.auth-divider { text-align: center; color: var(--muted); font-size: 12px; margin: 4px 0; }

/* ═══════════════════════════════════════════════════════════
   APP LAYOUT (dashboard / chat / shop)
═══════════════════════════════════════════════════════════ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
}
.sidebar-logo {
  padding: 22px 20px 18px; border-bottom: 1px solid var(--border);
  font-size: 18px; font-weight: 900; letter-spacing: 2px; color: var(--text);
}
.sidebar-logo span { color: var(--accent2); }
.sidebar-logo small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); letter-spacing: 1px; margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px;
  color: var(--sub); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s; text-decoration: none;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: rgba(192,57,43,.15); color: var(--accent2); }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-bottom { padding: 12px 10px; border-top: 1px solid var(--border); }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 7px;
  background: var(--card);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info .role { font-size: 11px; color: var(--muted); }

.main-content {
  margin-left: var(--sidebar); flex: 1;
  display: flex; flex-direction: column; min-height: 100vh;
}
.page-header {
  padding: 28px 32px 0;
}
.page-header h1 { font-size: 22px; font-weight: 800; }
.page-header p { color: var(--sub); font-size: 13px; margin-top: 3px; }
.page-body { padding: 24px 32px; flex: 1; }

/* ── Dashboard stats ───────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px;
}
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-size: 22px; font-weight: 800; line-height: 1; }
.stat-sub { font-size: 12px; color: var(--sub); margin-top: 4px; }

.sub-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.sub-active { background: rgba(39,174,96,.15); color: #6edb95; border: 1px solid rgba(39,174,96,.3); }
.sub-inactive { background: rgba(192,57,43,.12); color: #ff8a7a; border: 1px solid rgba(192,57,43,.25); }

.section-head { font-size: 14px; font-weight: 700; color: var(--sub); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 14px; }

.info-block { display: flex; flex-direction: column; gap: 10px; }
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
}
.info-row .label { font-size: 12px; color: var(--sub); }
.info-row .value { font-size: 13px; font-weight: 600; font-family: monospace; }

/* ── Chat ──────────────────────────────────────────────────── */
.chat-layout { display: flex; gap: 0; flex: 1; height: calc(100vh - 60px); }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 2px;
}
.chat-msg { display: flex; gap: 10px; padding: 4px 0; align-items: flex-start; }
.chat-msg:hover .msg-time { opacity: 1; }
.msg-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; margin-top: 2px;
}
.msg-body { flex: 1; min-width: 0; }
.msg-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg-user { font-size: 13px; font-weight: 700; color: var(--accent2); }
.msg-time { font-size: 11px; color: var(--muted); opacity: 0; transition: opacity .2s; }
.msg-text { font-size: 14px; color: var(--text); word-break: break-word; line-height: 1.5; }

.chat-input-area {
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex; gap: 10px; align-items: flex-end;
}
.chat-input {
  flex: 1; background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; color: var(--text);
  font-size: 14px; outline: none; resize: none;
  transition: border-color .18s; font-family: inherit; max-height: 120px;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--muted); }

.chat-sidebar-right {
  width: 200px; flex-shrink: 0; border-left: 1px solid var(--border);
  padding: 16px; background: var(--surface);
}
.online-header { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 12px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; margin-right: 5px; }

/* ── Shop ──────────────────────────────────────────────────── */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px 24px; display: flex; flex-direction: column;
  transition: border-color .2s, transform .2s;
  position: relative; overflow: hidden;
}
.plan-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.plan-card.popular { border-color: rgba(192,57,43,.5); }
.plan-badge {
  position: absolute; top: 14px; right: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 20px; letter-spacing: .5px; text-transform: uppercase;
}
.plan-name { font-size: 14px; font-weight: 700; color: var(--sub); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.plan-price { font-size: 38px; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.plan-price sup { font-size: 28px; vertical-align: top; margin-top: 4px; font-weight: 900; color: var(--accent2); }
.plan-period { font-size: 12px; color: var(--sub); margin-bottom: 24px; }
.plan-features { flex: 1; display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.plan-feature { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); }
.plan-feature::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }
.plan-feature.cross::before { content: '✕'; color: var(--muted); }

/* ── Animations ────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(.85); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fadein { animation: fadeIn .25s ease forwards; }
