:root {
  --bg-primary: #070a0f;
  --bg-secondary: #0d1117;
  --bg-surface: #131821;
  --bg-card: #1a1f2e;
  --bg-elevated: #232942;
  --border: #1e2438;
  --border-light: #2a3150;
  --text: #e8edf5;
  --text-secondary: #8b95b0;
  --text-muted: #5a6480;
  --accent: #6c8cff;
  --accent-hover: #8ba4ff;
  --accent-glow: rgba(108, 140, 255, 0.15);
  --green: #4ade80;
  --red: #f87171;
  --orange: #fb923c;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button { cursor: pointer; font-family: var(--font); border: none; outline: none; }
input, select { font-family: var(--font); outline: none; }
img { max-width: 100%; }

::selection { background: var(--accent); color: #fff; }

.hidden { display: none !important; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  transition: all var(--transition);
  background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border);
}
.btn:hover { background: var(--bg-card); border-color: var(--border-light); }
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-outline {
  background: transparent; border: 1px solid var(--border-light); color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; border: none; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; padding: 14px; }
.btn-oauth {
  width: 100%; justify-content: center; padding: 12px;
  background: var(--bg-surface); border: 1px solid var(--border);
  font-size: 14px; gap: 10px;
}
.btn-oauth:hover { border-color: var(--border-light); background: var(--bg-card); }

/* ===== LOADING ===== */
.loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease;
}
.loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loading-content { text-align: center; }
.loading-logo {
  font-size: 48px; font-weight: 800; letter-spacing: -2px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
}
.loading-text { font-size: 14px; color: var(--text-muted); margin-top: 16px; }
.spinner-ring {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(7, 10, 15, 0.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s ease;
}
.navbar.hidden { transform: translateY(-100%); }
.nav-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 60px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 20px; font-weight: 800; letter-spacing: -1px;
}
.nav-logo { background: linear-gradient(135deg, var(--accent), #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 100px; background: var(--accent-glow); color: var(--accent);
  border: 1px solid rgba(108, 140, 255, 0.2); -webkit-text-fill-color: var(--accent);
}
.nav-links { display: flex; gap: 24px; }
.nav-link { font-size: 14px; color: var(--text-secondary); font-weight: 500; transition: color var(--transition); }
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-actions { display: flex; gap: 8px; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.nav-user-email { font-size: 13px; color: var(--text-secondary); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-mobile-toggle { display: none; background: none; font-size: 22px; color: var(--text); }

/* ===== SECTIONS ===== */
.section { display: none; min-height: 100vh; }
.section.active { display: block; }
.section-content {
  max-width: 1200px; margin: 0 auto; padding: 120px 24px 80px;
}
.section-tag {
  display: inline-block; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 2px; color: var(--accent); margin-bottom: 16px;
}
.section-title {
  font-size: clamp(32px, 5vw, 52px); font-weight: 800; line-height: 1.15;
  letter-spacing: -1.5px; margin-bottom: 20px;
}
.section-desc {
  font-size: 18px; color: var(--text-secondary); max-width: 640px;
  line-height: 1.7; margin-bottom: 48px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ===== LANDING ===== */
#section-landing {
  position: relative; height: 100vh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.landing-globe {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
}
.landing-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(ellipse at center, transparent 30%, var(--bg-primary) 80%);
  pointer-events: none;
}
.landing-hero {
  position: relative; z-index: 2; text-align: center;
  max-width: 800px; padding: 0 24px;
}
.hero-badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 6px 16px; border-radius: 100px;
  background: var(--accent-glow); color: var(--accent);
  border: 1px solid rgba(108, 140, 255, 0.2); margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(36px, 6vw, 64px); font-weight: 800; line-height: 1.1;
  letter-spacing: -2px; margin-bottom: 20px;
}
.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px); color: var(--text-secondary);
  max-width: 640px; margin: 0 auto 32px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 48px; justify-content: center; }
.stat { text-align: center; }
.stat-num { display: block; font-size: 28px; font-weight: 700; color: var(--text); font-family: var(--mono); }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.landing-scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  z-index: 2; font-size: 12px; color: var(--text-muted);
  animation: bounce 2s infinite;
}
@keyframes bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* ===== FEATURES ===== */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; transition: all var(--transition);
}
.feature-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.feature-icon { margin-bottom: 20px; }
.feature-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* ===== VERTICALS ===== */
.verticals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.vertical-card {
  position: relative; border-radius: var(--radius); padding: 32px;
  border: 1px solid var(--border); overflow: hidden; cursor: default;
  transition: all var(--transition);
}
.vertical-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.vertical-bg { position: absolute; inset: 0; opacity: 0.5; }
.vertical-icon, .vertical-card h3, .vertical-card p, .vertical-metrics { position: relative; }
.vertical-icon { font-size: 32px; margin-bottom: 16px; }
.vertical-card h3 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.vertical-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 20px; }
.vertical-metrics { display: flex; flex-wrap: wrap; gap: 8px; }
.vertical-metrics span {
  font-size: 11px; font-weight: 500; padding: 4px 10px;
  border-radius: 100px; background: rgba(255,255,255,0.05);
  color: var(--text-secondary); border: 1px solid var(--border);
}

/* ===== STEPS ===== */
.steps {
  display: flex; align-items: center; gap: 24px;
  flex-wrap: wrap; justify-content: center;
}
.step {
  flex: 1; min-width: 240px; max-width: 320px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; text-align: center;
}
.step-num {
  font-size: 32px; font-weight: 800; color: var(--accent);
  font-family: var(--mono); margin-bottom: 16px;
}
.step h3 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.step p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }
.step-arrow { font-size: 24px; color: var(--text-muted); }

/* ===== PRICING ===== */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; align-items: start; }
.pricing-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px 32px;
  transition: all var(--transition);
}
.pricing-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.pricing-card.featured {
  border-color: var(--accent); position: relative;
  background: linear-gradient(135deg, rgba(108,140,255,0.05), transparent);
}
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 600; padding: 4px 16px;
  border-radius: 100px; background: var(--accent); color: #fff;
}
.pricing-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.pricing-price { font-size: 36px; font-weight: 800; margin-bottom: 24px; color: var(--text); }
.pricing-period { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.pricing-features { list-style: none; margin-bottom: 32px; }
.pricing-features li {
  padding: 8px 0; font-size: 14px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.pricing-features li::before { content: "✓ "; color: var(--green); }
.pricing-cta { width: 100%; justify-content: center; }

/* ===== AUTH ===== */
#section-auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 100px 24px; }
.auth-container { width: 100%; max-width: 420px; }
.auth-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; }
.auth-back { font-size: 13px; color: var(--text-muted); cursor: pointer; margin-bottom: 24px; display: inline-block; }
.auth-back:hover { color: var(--text); }
.auth-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.auth-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.form-group input, .form-group select {
  padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-secondary); color: var(--text); font-size: 14px;
  transition: border-color var(--transition);
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-error { font-size: 13px; color: var(--red); padding: 8px 12px; background: rgba(248,113,113,0.1); border-radius: var(--radius-sm); border: 1px solid rgba(248,113,113,0.2); }
.auth-divider {
  display: flex; align-items: center; gap: 16px; margin: 24px 0;
  font-size: 12px; color: var(--text-muted);
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { white-space: nowrap; }
.auth-oauth { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.auth-switch { font-size: 13px; color: var(--text-secondary); text-align: center; }

/* ===== DASHBOARD ===== */
#section-dashboard { position: relative; width: 100%; height: 100vh; display: flex; }
.dashboard-map { position: absolute; inset: 0; z-index: 0; }
.dashboard-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: rgba(7,10,15,0.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo { font-size: 18px; font-weight: 800; letter-spacing: -1px; background: linear-gradient(135deg, var(--accent), #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.topbar-sep { color: var(--border); }
.baselayer-group { display: flex; gap: 2px; background: var(--bg-secondary); border-radius: 6px; padding: 2px; }
.baselayer-btn {
  padding: 6px 12px; font-size: 11px; font-weight: 500;
  border-radius: 4px; background: transparent; color: var(--text-muted); border: none;
  transition: all var(--transition); cursor: pointer;
}
.baselayer-btn.active { background: var(--bg-elevated); color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-user { display: flex; align-items: center; gap: 8px; margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--border); }
.topbar-email { font-size: 12px; color: var(--text-muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-info {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; gap: 8px;
}
.info-pill {
  font-size: 11px; padding: 6px 14px; border-radius: 100px;
  background: rgba(7,10,15,0.85); backdrop-filter: blur(12px);
  border: 1px solid var(--border); color: var(--text-secondary);
  font-family: var(--mono);
}
.dashboard-dropzone {
  position: absolute; inset: 0; z-index: 20; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s ease;
  background: rgba(7,10,15,0.7);
}
.dashboard-dropzone.drag-over { opacity: 1; pointer-events: auto; }
.dropzone-content {
  text-align: center; padding: 48px; border: 2px dashed var(--accent);
  border-radius: var(--radius); background: rgba(108,140,255,0.1);
}
.dropzone-icon { font-size: 48px; margin-bottom: 16px; }
.dropzone-content p { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.dropzone-content small { font-size: 13px; color: var(--text-muted); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-close { background: none; font-size: 18px; color: var(--text-muted); padding: 4px 8px; border-radius: 4px; }
.modal-close:hover { background: var(--bg-elevated); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { margin-top: 20px; }
.fine-print { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 12px; }

.proc-value { font-size: 16px; font-weight: 600; color: var(--accent); font-family: var(--mono); }
.vertical-select { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vselect-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition); font-size: 13px; font-weight: 500;
}
.vselect-card:hover { border-color: var(--border-light); }
.vselect-card:has(input:checked) { border-color: var(--accent); background: var(--accent-glow); }
.vselect-card span:first-child { font-size: 24px; }
.range-slider { width: 100%; height: 6px; appearance: none; background: var(--border); border-radius: 3px; outline: none; }
.range-slider::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid var(--bg-surface); }
.accent { color: var(--accent); font-weight: 600; }

/* ===== HISTORY ===== */
.history-empty { text-align: center; padding: 48px; color: var(--text-muted); font-size: 14px; }
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.history-item-info { display: flex; flex-direction: column; gap: 4px; }
.history-item-name { font-size: 14px; font-weight: 500; }
.history-item-meta { font-size: 12px; color: var(--text-muted); }
.history-item-status { font-size: 11px; padding: 4px 10px; border-radius: 100px; font-weight: 500; }
.history-item-status.pending { background: rgba(255,183,74,0.15); color: var(--orange); }
.history-item-status.completed { background: rgba(74,222,128,0.15); color: var(--green); }

/* ===== TOAST ===== */
#toast-container {
  position: fixed; top: 72px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; max-width: 400px;
  animation: slideIn 0.3s ease; pointer-events: auto;
}
.toast.success { background: rgba(74,222,128,0.15); border: 1px solid rgba(74,222,128,0.3); color: var(--green); }
.toast.error { background: rgba(248,113,113,0.15); border: 1px solid rgba(248,113,113,0.3); color: var(--red); }
.toast.info { background: rgba(108,140,255,0.15); border: 1px solid rgba(108,140,255,0.3); color: var(--accent); }
.toast.fade-out { animation: fadeOut 0.3s ease forwards; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { transform: translateX(100%); opacity: 0; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links, .nav-actions { display: none; }
  .nav-mobile-toggle { display: block; }
  .navbar.mobile-open .nav-links, .navbar.mobile-open .nav-actions { display: flex; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg-primary); border-bottom: 1px solid var(--border); padding: 16px 24px; }
  .hero-stats { gap: 24px; }
  .steps { flex-direction: column; }
  .step-arrow { transform: rotate(90deg); }
  .dashboard-topbar { flex-wrap: wrap; gap: 8px; }
  .topbar-left { order: 1; }
  .topbar-right { order: 3; width: 100%; justify-content: flex-end; }
  .topbar-user { margin-left: 0; padding-left: 0; border-left: none; }
  .baselayer-group { order: 2; }
  .dashboard-info { flex-wrap: wrap; justify-content: center; bottom: 60px; }
  .vertical-select { grid-template-columns: 1fr 1fr; }
}
