/* DeskPilot — design tokens + global styles */
:root {
  --bg: #0a0a0f;
  --bg-raised: #12121a;
  --bg-card: #16161f;
  --fg: #e8e8ed;
  --fg-muted: #8a8a9a;
  --accent: #f0a030;
  --accent-dim: rgba(240, 160, 48, 0.12);
  --accent-glow: rgba(240, 160, 48, 0.25);
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(240, 160, 48, 0.3);
  --success: #30c060;
  --error: #e04040;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--fg); letter-spacing: -0.02em; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { font-size: 0.9rem; color: var(--fg-muted); }
.nav-links a:hover { color: var(--fg); text-decoration: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 0.875rem; padding: 10px 20px; border-radius: 100px; border: none; cursor: pointer; transition: all 0.15s; text-decoration: none !important; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: #fbb040; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--border-accent); background: var(--accent-dim); }
.btn-sm { padding: 7px 16px; font-size: 0.8rem; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { opacity: 0.9; }

/* ===== HERO ===== */
.hero { position: relative; min-height: 90vh; display: flex; align-items: center; justify-content: center; padding: 120px 24px 80px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(240,160,48,0.08) 0%, transparent 70%); pointer-events: none; }
.hero-inner { max-width: 800px; text-align: center; position: relative; z-index: 2; }
.hero-badge { display: inline-block; font-family: var(--font-display); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.15em; color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(240,160,48,0.2); padding: 8px 20px; border-radius: 100px; margin-bottom: 32px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(3rem, 8vw, 5.5rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 24px; background: linear-gradient(180deg, #fff 40%, var(--fg-muted) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 1.15rem; color: var(--fg-muted); max-width: 580px; margin: 0 auto 48px; line-height: 1.7; }
.hero-cta { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.hero-stats { display: flex; align-items: center; justify-content: center; gap: 32px; padding: 24px 40px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 16px; margin-top: 64px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--fg-muted); }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* ===== SECTIONS ===== */
section { padding: 96px 24px; }
.container { max-width: 1100px; margin: 0 auto; }
.section-badge { font-family: var(--font-display); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.15em; color: var(--accent); text-transform: uppercase; margin-bottom: 16px; }
.section-title { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 16px; }
.section-sub { color: var(--fg-muted); font-size: 1.05rem; max-width: 600px; }
.text-center { text-align: center; }
.text-center .section-sub { margin: 0 auto; }

/* ===== PROBLEM ===== */
.problem-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 48px; }
.problem-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.problem-icon { font-size: 2rem; margin-bottom: 16px; }
.problem-card h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.problem-card p { color: var(--fg-muted); font-size: 0.9rem; }

/* ===== FEATURES ===== */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-top: 56px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; transition: border-color 0.2s; }
.feature-card:hover { border-color: var(--border-accent); }
.feature-icon { width: 48px; height: 48px; background: var(--accent-dim); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 20px; }
.feature-card h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.feature-card p { color: var(--fg-muted); font-size: 0.9rem; line-height: 1.6; }

/* ===== HOW IT WORKS ===== */
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; margin-top: 56px; counter-reset: step; }
.how-step { text-align: center; counter-increment: step; }
.step-num { width: 48px; height: 48px; background: var(--accent); color: #000; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; margin: 0 auto 16px; }
.how-step h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.how-step p { color: var(--fg-muted); font-size: 0.875rem; }

/* ===== CLOSING / CTA ===== */
.closing { background: var(--bg-raised); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.closing-inner { text-align: center; }

/* ===== FOOTER ===== */
footer { padding: 40px 24px; border-top: 1px solid var(--border); }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-logo { font-family: var(--font-display); font-weight: 700; color: var(--fg-muted); }
.footer-links { display: flex; gap: 24px; font-size: 0.875rem; color: var(--fg-muted); }
.footer-links a { color: var(--fg-muted); }

/* ===== ONBOARDING ===== */
.onboarding-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 80px 24px; }
.onboarding-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 48px; width: 100%; max-width: 620px; }
.onboarding-card h2 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; margin-bottom: 8px; }
.onboarding-card .sub { color: var(--fg-muted); margin-bottom: 36px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--fg-muted); margin-bottom: 8px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--fg); font-family: var(--font-body); font-size: 0.9rem; outline: none; transition: border-color 0.15s; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--border-accent); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group .hint { font-size: 0.8rem; color: var(--fg-muted); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.services-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.service-tag { display: flex; align-items: center; gap: 6px; background: var(--accent-dim); border: 1px solid var(--border-accent); border-radius: 100px; padding: 4px 12px; font-size: 0.8rem; }
.service-tag button { background: none; border: none; color: var(--fg-muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.service-input-row { display: flex; gap: 8px; }
.service-input-row input { flex: 1; }
.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 8px; }
.day-btn { padding: 8px 4px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 8px; color: var(--fg-muted); font-size: 0.75rem; cursor: pointer; text-align: center; transition: all 0.15s; }
.day-btn.active { background: var(--accent-dim); border-color: var(--border-accent); color: var(--accent); }
.hours-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }

/* ===== DASHBOARD ===== */
.dash-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.dash-sidebar { background: var(--bg-raised); border-right: 1px solid var(--border); padding: 24px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.dash-logo { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; padding: 8px 12px; margin-bottom: 24px; }
.dash-logo span { color: var(--accent); }
.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--fg-muted); font-size: 0.9rem; text-decoration: none; transition: all 0.15s; }
.dash-nav a:hover, .dash-nav a.active { background: var(--accent-dim); color: var(--fg); }
.dash-main { padding: 32px 40px; overflow-y: auto; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.dash-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.dash-sub { color: var(--fg-muted); font-size: 0.9rem; margin-top: 4px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.stat-card .label { font-size: 0.8rem; color: var(--fg-muted); margin-bottom: 8px; }
.stat-card .value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--accent); }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.panel-header { padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.panel-body { padding: 0; }
.appt-list { list-style: none; }
.appt-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--border); gap: 16px; flex-wrap: wrap; }
.appt-item:last-child { border-bottom: none; }
.appt-time { font-family: var(--font-display); font-weight: 600; color: var(--accent); font-size: 0.9rem; min-width: 60px; }
.appt-name { font-weight: 500; }
.appt-service { font-size: 0.8rem; color: var(--fg-muted); }
.appt-phone { font-size: 0.8rem; color: var(--fg-muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 0.75rem; font-weight: 600; }
.badge-confirmed { background: rgba(48,192,96,0.15); color: var(--success); }
.badge-cancelled { background: rgba(224,64,64,0.15); color: var(--error); }
.convo-list { list-style: none; }
.convo-item { display: flex; align-items: flex-start; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--border); gap: 16px; }
.convo-item:last-child { border-bottom: none; }
.convo-name { font-weight: 500; font-size: 0.9rem; }
.convo-preview { font-size: 0.8rem; color: var(--fg-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.convo-time { font-size: 0.75rem; color: var(--fg-muted); white-space: nowrap; }
.empty-state { padding: 40px; text-align: center; color: var(--fg-muted); font-size: 0.9rem; }
.widget-box { background: var(--bg-raised); border: 1px solid var(--border-accent); border-radius: var(--radius); padding: 20px 24px; }
.widget-box h4 { font-family: var(--font-display); font-size: 0.9rem; margin-bottom: 12px; }
.code-wrap { background: var(--bg); border-radius: 8px; padding: 12px 16px; font-family: monospace; font-size: 0.78rem; color: var(--fg-muted); word-break: break-all; margin-bottom: 12px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash-layout { grid-template-columns: 1fr; } .dash-sidebar { height: auto; position: static; } }

/* ===== WIDGET DEMO PAGE ===== */
.widget-demo { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 24px; flex-direction: column; gap: 24px; }
.widget-demo h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--fg-muted); }

/* ===== CHAT WIDGET ===== */
#dp-widget-btn { position: fixed; bottom: 24px; right: 24px; width: 60px; height: 60px; background: var(--accent); border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px var(--accent-glow); transition: transform 0.2s; z-index: 9998; }
#dp-widget-btn:hover { transform: scale(1.08); }
#dp-widget-btn svg { width: 28px; height: 28px; }
#dp-chat-window { position: fixed; bottom: 96px; right: 24px; width: 360px; max-height: 540px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 8px 40px rgba(0,0,0,0.5); display: flex; flex-direction: column; z-index: 9999; overflow: hidden; transform: translateY(10px); opacity: 0; pointer-events: none; transition: transform 0.2s, opacity 0.2s; }
#dp-chat-window.open { transform: translateY(0); opacity: 1; pointer-events: all; }
.dp-chat-header { background: var(--bg-raised); padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.dp-chat-avatar { width: 36px; height: 36px; background: var(--accent-dim); border: 1px solid var(--border-accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.dp-chat-name { font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; }
.dp-chat-status { font-size: 0.75rem; color: var(--success); }
.dp-chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.dp-msg { max-width: 80%; display: flex; flex-direction: column; gap: 4px; }
.dp-msg.user { align-self: flex-end; align-items: flex-end; }
.dp-msg.bot { align-self: flex-start; }
.dp-msg-bubble { padding: 10px 14px; border-radius: 14px; font-size: 0.875rem; line-height: 1.5; }
.dp-msg.user .dp-msg-bubble { background: var(--accent); color: #000; border-bottom-right-radius: 4px; }
.dp-msg.bot .dp-msg-bubble { background: var(--bg-raised); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.dp-typing { display: flex; gap: 4px; padding: 10px 14px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; border-bottom-left-radius: 4px; align-self: flex-start; }
.dp-typing span { width: 6px; height: 6px; background: var(--fg-muted); border-radius: 50%; animation: typing 1.2s infinite; }
.dp-typing span:nth-child(2) { animation-delay: 0.2s; }
.dp-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.dp-booking-card { background: var(--bg); border: 1px solid var(--border-accent); border-radius: 10px; padding: 12px 14px; font-size: 0.8rem; color: var(--fg-muted); margin-top: 4px; }
.dp-booking-card .title { color: var(--success); font-weight: 600; margin-bottom: 4px; }
.dp-chat-input { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 8px; }
.dp-chat-input input { flex: 1; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 100px; padding: 9px 16px; color: var(--fg); font-size: 0.875rem; outline: none; font-family: var(--font-body); }
.dp-chat-input input:focus { border-color: var(--border-accent); }
.dp-send-btn { width: 36px; height: 36px; background: var(--accent); border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: opacity 0.15s; }
.dp-send-btn:disabled { opacity: 0.4; cursor: default; }
.dp-send-btn svg { width: 16px; height: 16px; }

/* ===== ERROR PAGE ===== */
.error-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; padding: 40px; text-align: center; }
.error-wrap h1 { font-family: var(--font-display); font-size: 2rem; }
.error-wrap p { color: var(--fg-muted); }
