/* CelDrive App — dashboard styles (mirrors celdrive.com tokens) */

:root {
  --bg: #060608;
  --bg-alt: #0e0e11;
  --bg-elev: #141418;
  --fg: #f5f5f7;
  --fg-mid: #b8b8c0;
  --fg-dim: #70707a;
  --accent: #00e676;
  --accent-bright: #00ff88;
  --accent-dim: #00b85f;
  --accent-glow: rgba(0, 230, 118, 0.18);
  --accent-glow-strong: rgba(0, 230, 118, 0.35);
  --border: #1f1f24;
  --border-bright: #2a2a30;
  --danger: #ff6262;
  --radius: 10px;
  --radius-lg: 14px;
}

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

html, body {
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

code, pre, .mono {
  font-family: "JetBrains Mono", "SF Mono", "Menlo", monospace;
  font-feature-settings: "liga" 0;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-bright); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- NAV ---------- */

nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 0;
  background: rgba(6, 6, 8, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}

.logo-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.logo-wordmark .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  box-shadow: 0 0 16px var(--accent-glow);
}

.logo-wordmark .mark svg {
  width: 16px; height: 16px;
  color: var(--bg);
  stroke-width: 2.5;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-right a {
  color: var(--fg-mid);
  font-size: 14px;
  font-weight: 500;
}

.nav-right a:hover { color: var(--fg); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--fg-mid);
}

.user-chip-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  font-weight: 700;
  font-size: 12px;
}

/* ---------- BUTTONS ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%);
  color: #06180e;
  box-shadow: 0 4px 16px rgba(0, 230, 118, 0.25), 0 0 32px rgba(0, 230, 118, 0.12);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 230, 118, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
  background: rgba(0, 230, 118, 0.08);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-mid);
  box-shadow: none;
  padding: 10px 16px;
}

.btn-ghost:hover { color: var(--fg); }

.btn-block { width: 100%; }

/* ---------- CARDS ---------- */

.card {
  background: linear-gradient(180deg, rgba(20, 20, 24, 0.8) 0%, rgba(14, 14, 17, 0.8) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}

.card-sub {
  font-size: 13.5px;
  color: var(--fg-mid);
  margin-bottom: 20px;
}

/* ---------- LAYOUT ---------- */

.page {
  padding: 56px 0 80px;
}

.page-header {
  margin-bottom: 40px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.page-sub {
  color: var(--fg-mid);
  font-size: 16px;
}

.centered-shell {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.centered-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 36px;
}

.centered-card h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  text-align: center;
}

.centered-card h1 .accent {
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent-dim) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.centered-card .lede {
  color: var(--fg-mid);
  font-size: 14.5px;
  text-align: center;
  margin-bottom: 28px;
}

.centered-card .fineprint {
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--fg-dim);
  text-align: center;
  line-height: 1.55;
}

.centered-card .fineprint .accent-text { color: var(--accent); }

/* ---------- USAGE METER ---------- */

.usage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.usage-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.usage-used {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.usage-used .unit {
  font-size: 16px;
  color: var(--fg-mid);
  font-weight: 500;
  margin-left: 4px;
}

.usage-quota {
  font-size: 14px;
  color: var(--fg-mid);
}

.usage-bar {
  position: relative;
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}

.usage-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-bright) 100%);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 16px var(--accent-glow);
}

.usage-bar-fill--warn { background: linear-gradient(90deg, #ffa500 0%, #ff6262 100%); }

.usage-tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(0, 230, 118, 0.08);
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- INSTALL BLOCK ---------- */

.install-block {
  position: relative;
  background: #08080a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 52px 18px 18px;
  font-family: "JetBrains Mono", "SF Mono", "Menlo", monospace;
  font-size: 13px;
  color: var(--fg);
  overflow-x: auto;
  white-space: nowrap;
}

.install-copy {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--fg-mid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
  font-size: 12px;
}

.install-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.install-copy.copied {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- CLI DEVICE APPROVAL ---------- */

.device-code-display {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 24px 0;
}

.device-code-cell {
  width: 44px;
  height: 54px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0;
}

.device-code-dash {
  display: inline-flex;
  align-items: center;
  color: var(--fg-dim);
  padding: 0 4px;
}

/* ---------- STATE BANNERS ---------- */

.banner {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 16px;
}

.banner-info {
  background: rgba(0, 230, 118, 0.06);
  border: 1px solid rgba(0, 230, 118, 0.25);
  color: var(--fg);
}

.banner-error {
  background: rgba(255, 98, 98, 0.06);
  border: 1px solid rgba(255, 98, 98, 0.3);
  color: var(--danger);
}

/* ---------- GRID ---------- */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .page-title { font-size: 26px; }
  .centered-card { padding: 32px 24px; }
}

/* ---------- CLERK APPEARANCE OVERRIDES ---------- */
/* Clerk mounts its own components; nudge them to match our dark theme */

#clerk-sign-in-root .cl-card,
#clerk-sign-up-root .cl-card {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

/* ---------- UTILITIES ---------- */

.hidden { display: none !important; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.text-center { text-align: center; }
.text-mid { color: var(--fg-mid); }
.text-dim { color: var(--fg-dim); }
.text-accent { color: var(--accent); }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fw-600 { font-weight: 600; }

/* ---------- TIER GRID (dashboard plan picker) ---------- */

.tier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 1024px) { .tier-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .tier-grid { grid-template-columns: 1fr; } }

.tier-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(20, 20, 24, 0.85) 0%, rgba(14, 14, 17, 0.85) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.tier-card:hover { border-color: var(--border-bright); transform: translateY(-2px); }

.tier-card.tier-current {
  border-color: rgba(0, 230, 118, 0.45);
  background: linear-gradient(180deg, rgba(0, 230, 118, 0.06) 0%, rgba(14, 14, 17, 0.9) 100%);
}

.tier-card .tier-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg-mid);
}

.tier-card .tier-price {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
  color: var(--fg);
}

.tier-card .tier-price .unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-dim);
  margin-left: 3px;
}

.tier-card .tier-bullets {
  list-style: none;
  margin: 14px 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.tier-card .tier-bullets li {
  font-size: 13px;
  color: var(--fg-mid);
  padding-left: 16px;
  position: relative;
}

.tier-card .tier-bullets li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.tier-card .tier-cta {
  margin-top: auto;
}

.tier-current-badge {
  position: absolute;
  top: -10px;
  right: 14px;
  background: var(--accent);
  color: #06180e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 230, 118, 0.35);
}

.btn-sm { padding: 9px 14px; font-size: 13px; }

.btn-disabled,
.btn-disabled:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg-dim);
  cursor: default;
  transform: none;
  box-shadow: none;
  border: 1px solid var(--border);
}
