/* =========================================================================
   THEME TOKENS — one variable set, two values (dark default / light override)
   Toggled via [data-theme] on <html>. Everything below reads these vars,
   so switching theme recolors the whole site, marketing pages and the
   app dashboard alike.
   ========================================================================= */
:root,
html[data-theme="dark"] {
  --bg: #0a0d12;
  --bg-elevated: #10141c;
  --surface: #141a24;
  --surface-2: #1a2130;
  --border: #232b3a;
  --text: #eef2f7;
  --text-muted: #94a1b8;
  --accent: #5eead4;
  --accent-strong: #2dd4bf;
  --accent-2: #a78bfa;
  --danger: #f87171;
  --warning: #fbbf24;
  --success: #4ade80;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px -20px rgba(0, 0, 0, 0.65);
  --code-bg: #0d1117;
  --table-head-bg: #171e2b;
  --table-hover: #171e2b;
  --input-bg: #10141c;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --border: #e5e9f0;
  --text: #131a2b;
  --text-muted: #667085;
  --accent: #0f9d84;
  --accent-strong: #0c8271;
  --accent-2: #7c5cd6;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #16a34a;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px -20px rgba(15, 23, 42, 0.18);
  --code-bg: #0d1117;
  --table-head-bg: #fafbfd;
  --table-hover: #fafbfd;
  --input-bg: #ffffff;
  color-scheme: light;
}

:root {
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { background-color: var(--bg); }
body {
  font-family: var(--font-body);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color .15s ease, color .15s ease;
}

a { color: inherit; }
.font-mono { font-family: var(--font-mono); }

/* ================= THEME TOGGLE ================= */
.uw-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.uw-theme-toggle:hover { color: var(--text); border-color: var(--accent); }

/* ================= NAVBARS ================= */
.uw-navbar {
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.uw-navbar .navbar-brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text) !important;
  letter-spacing: -0.02em;
}
.uw-navbar .navbar-brand .dot { color: var(--accent); }
.uw-navbar .nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  padding: 0.5rem 0.9rem !important;
}
.uw-navbar .nav-link:hover { color: var(--text) !important; }
.uw-navbar .btn-accent {
  background: var(--accent);
  color: #04231d;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.3rem;
}
.uw-navbar .btn-accent:hover { background: var(--accent-strong); color: #04231d; }
.uw-navbar .navbar-toggler { border-color: var(--border); }
html[data-theme="dark"] .uw-navbar .navbar-toggler-icon { filter: invert(1) grayscale(1); }

.app-navbar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.app-navbar .navbar-brand { font-weight: 800; color: var(--text) !important; }
.app-navbar .navbar-brand span { color: var(--accent) !important; }
.app-navbar .nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  border-radius: 8px;
  padding: 0.45rem 0.8rem !important;
}
.app-navbar .nav-link:hover, .app-navbar .nav-link.active { color: var(--text) !important; background: var(--surface-2); }
html[data-theme="dark"] .app-navbar .navbar-toggler-icon { filter: invert(1) grayscale(1); }

/* ================= HERO ================= */
.uw-hero {
  padding: 6rem 0 4.5rem;
  background:
    radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 45%),
    radial-gradient(circle at 85% 10%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 40%);
}
.uw-hero h1 {
  font-size: clamp(2rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.uw-hero .lead {
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  max-width: 620px;
}
.uw-gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.uw-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
}
.uw-badge-pill .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: uw-pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes uw-pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,.6); }
  70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

/* ================= CODE PANEL ================= */
.uw-code-panel {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  max-width: 100%;
}
.uw-code-panel .uw-code-header {
  display: flex;
  gap: 6px;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
}
.uw-code-panel .dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.uw-code-panel .dot.red { background: #ff5f57; }
.uw-code-panel .dot.yellow { background: #febc2e; }
.uw-code-panel .dot.green { background: #28c840; }
.uw-code-panel pre {
  margin: 0;
  padding: 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #cdd9e5;
  overflow-x: auto;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}
.uw-code-panel .tok-key { color: #79c0ff; }
.uw-code-panel .tok-str { color: #a5d6ff; }
.uw-code-panel .tok-com { color: #6e7681; }
.uw-code-panel .tok-fn { color: #d2a8ff; }

/* ================= MARKETING SECTIONS ================= */
.uw-section { padding: 4.5rem 0; }
.uw-section-alt { background: var(--bg-elevated); }
.uw-eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.uw-feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  height: 100%;
  transition: transform .15s ease, border-color .15s ease;
}
.uw-feature-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.uw-feature-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

/* ================= PRICING ================= */
.uw-price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.9rem;
  height: 100%;
}
.uw-price-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 20px 50px -25px color-mix(in srgb, var(--accent) 40%, transparent);
  position: relative;
}
.uw-price-card .price {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.uw-price-card .price span { font-size: 1rem; color: var(--text-muted); font-weight: 500; }
.uw-price-card ul { list-style: none; padding: 0; margin: 1.4rem 0; }
.uw-price-card li { padding: 0.4rem 0; color: var(--text-muted); display: flex; gap: 0.6rem; align-items: flex-start; }
.uw-price-card li::before { content: "✓"; color: var(--accent); font-weight: 700; }

/* ================= FOOTER ================= */
.uw-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2.5rem 0 2rem;
  font-size: 0.88rem;
}
.uw-footer a { color: var(--text-muted); }
.uw-footer a:hover { color: var(--text); }

/* ================= APP SHELL ================= */
body.app-shell { background-color: var(--bg); }
.uw-app-main { padding: 1.75rem 1rem 3rem; }
@media (min-width: 768px) {
  .uw-app-main { padding: 2rem 1.5rem 3.5rem; }
}

.uw-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.uw-page-title { font-weight: 800; letter-spacing: -0.01em; margin-bottom: 0.15rem; color: var(--text); }
.uw-page-sub { color: var(--text-muted); margin-bottom: 0; font-size: 0.92rem; }

.uw-back-link {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.uw-back-link:hover { color: var(--accent); }

.uw-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.uw-stat-card.p-0 { padding: 0 !important; }

.uw-stat-label { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.35rem; }
.uw-stat-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }

.uw-progress-track {
  height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden;
}
.uw-progress-fill { height: 100%; border-radius: 999px; background: var(--success); transition: width .3s ease; }
.uw-progress-fill.warn { background: var(--warning); }
.uw-progress-fill.danger { background: var(--danger); }

.uw-key-plaintext {
  font-family: var(--font-mono);
  background: var(--code-bg);
  color: #a5d6ff;
  padding: 1rem;
  border-radius: var(--radius-sm);
  word-break: break-all;
  font-size: 0.9rem;
}

.uw-project-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  height: 100%;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.uw-project-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--text);
}

.table-uw { margin-bottom: 0; color: var(--text); }
.table-uw thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom-width: 1px;
  border-color: var(--border);
  white-space: nowrap;
  background: var(--table-head-bg);
}
.table-uw td { vertical-align: middle; font-size: 0.9rem; border-color: var(--border); }
.table-uw tbody tr:hover { background: var(--table-hover); }
.table-responsive-uw { border-radius: var(--radius); overflow: hidden; }

.btn { border-radius: var(--radius-sm); font-weight: 600; }
.btn-dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-dark:hover { opacity: 0.85; background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-outline-dark { border-color: var(--border); color: var(--text); }
.btn-outline-dark:hover { background: var(--text); border-color: var(--text); color: var(--bg); }

.form-label { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  padding: 0.55rem 0.8rem;
  background-color: var(--input-bg);
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--accent) 20%, transparent);
  background-color: var(--input-bg);
  color: var(--text);
}
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-text { font-size: 0.82rem; color: var(--text-muted); }

.badge { font-weight: 600; font-size: 0.72rem; padding: 0.4em 0.65em; }

.uw-empty { text-align: center; padding: 3rem 1.5rem; }
.uw-empty p { color: var(--text-muted); }

dt, dd { color: var(--text); }

/* ================= MOBILE TUNING ================= */
@media (max-width: 767.98px) {
  .uw-hero { padding: 3.5rem 0 3rem; text-align: left; }
  .uw-section { padding: 3rem 0; }
  .uw-price-card { padding: 1.5rem; }
  .uw-code-panel pre { font-size: 0.72rem; padding: 1rem; }
  .uw-stat-value { font-size: 1.5rem; }
  .uw-page-header { flex-direction: column; align-items: stretch; }
  .uw-page-header .d-flex.gap-2 { flex-wrap: wrap; }
  .uw-page-header .btn { flex: 1 1 auto; }
  .table-uw td, .table-uw th { font-size: 0.82rem; padding: 0.6rem 0.5rem; }
  .container, .container-fluid { padding-left: 1rem; padding-right: 1rem; }
}

@media (max-width: 575.98px) {
  .uw-hero h1 { font-size: 2rem; }
  .uw-navbar .btn-accent { padding: 0.5rem 1rem; font-size: 0.9rem; }
}
