/* ============================================================
   Nutrition AI Platform — Developer Dashboard
   Dark theme, Vercel/Linear-inspired aesthetic
   ============================================================ */

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #000000;
  --bg-secondary: #09090b;
  --bg-tertiary: #111113;
  --bg-card: #18181b;
  --bg-card-hover: #1f1f23;
  --bg-elevated: #1c1c20;
  --bg-input: #131316;
  --bg-sidebar: #0c0c0e;
  --border: #27272a;
  --border-light: #1f1f23;
  --border-hover: #3f3f46;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-muted: #52525b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-muted: rgba(59, 130, 246, 0.15);
  --accent-glow: rgba(59, 130, 246, 0.25);
  --success: #22c55e;
  --success-muted: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-muted: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-muted: rgba(239, 68, 68, 0.15);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --transition: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-width: 240px;
  --header-height: 64px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

img, svg {
  display: block;
  max-width: 100%;
}

/* --- Typography ------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 0.938rem; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.font-mono { font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', Monaco, 'Cascadia Code', monospace; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* --- Layout ----------------------------------------------- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-logo svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.sidebar-logo span {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.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: var(--radius-md);
  color: var(--text-tertiary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.nav-item:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--text-primary);
  background: var(--accent-muted);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border-light);
}

/* Main content area */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.top-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left h2 {
  font-size: 1rem;
  font-weight: 600;
}

.page-title {
  color: var(--text-tertiary);
  font-size: 0.813rem;
  font-weight: 500;
}

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

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.688rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-badge.free {
  background: rgba(113, 113, 122, 0.15);
  color: var(--text-tertiary);
}
.plan-badge.starter {
  background: var(--accent-muted);
  color: var(--accent);
}
.plan-badge.pro {
  background: var(--success-muted);
  color: var(--success);
}
.plan-badge.enterprise {
  background: var(--warning-muted);
  color: var(--warning);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.813rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-logout:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

/* Page content wrapper */
.page-content {
  padding: 32px;
  flex: 1;
}

/* --- Sections --------------------------------------------- */
.section {
  display: none;
}
.section.active {
  display: block;
  animation: fadeIn 200ms ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* --- Cards ------------------------------------------------ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 0.938rem;
  font-weight: 600;
}

.card-body {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* --- Stats Grid ------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-value .currency {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-tertiary);
}

.stat-change {
  font-size: 0.75rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* --- Progress Bar (Monthly Usage) ------------------------- */
.usage-bar-container {
  margin-bottom: 24px;
}

.usage-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.usage-bar-label {
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.usage-bar-percent {
  font-size: 0.813rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.usage-bar-track {
  width: 100%;
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.usage-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--accent) 0%, #60a5fa 100%);
  transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.usage-bar-fill.warning {
  background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%);
}

.usage-bar-fill.danger {
  background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%);
}

.usage-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* --- Tables ----------------------------------------------- */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.813rem;
}

thead th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.688rem;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.813rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger-muted);
  color: var(--danger);
  border-color: transparent;
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: white;
}

.btn-success {
  background: var(--success-muted);
  color: var(--success);
  border-color: transparent;
}
.btn-success:hover:not(:disabled) {
  background: var(--success);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-tertiary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.938rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-secondary .spinner {
  border-color: rgba(255, 255, 255, 0.15);
  border-top-color: var(--text-secondary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Forms & Inputs --------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-muted);
}

.form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* --- API Key Display -------------------------------------- */
.api-key-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.813rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  word-break: break-all;
}

.api-key-display .key-value {
  flex: 1;
  min-width: 0;
}

.api-key-display .key-masked {
  color: var(--text-muted);
  letter-spacing: 0.15em;
}

.api-key-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* --- Billing / Plan Cards ---------------------------------- */
.tier-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
}

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

.tier-card.current-plan {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-muted);
}

.tier-card.current-plan::before {
  content: 'Current';
  position: absolute;
  top: -1px;
  right: 20px;
  padding: 3px 10px;
  background: var(--accent);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.tier-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tier-price {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.tier-price .period {
  font-size: 0.813rem;
  font-weight: 400;
  color: var(--text-tertiary);
}

.tier-desc {
  font-size: 0.813rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.tier-features {
  list-style: none;
  margin-bottom: 20px;
}

.tier-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.813rem;
  color: var(--text-secondary);
  padding: 4px 0;
}

.tier-features li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.tier-features li .check { color: var(--success); }
.tier-features li .cross { color: var(--text-muted); }

/* --- Toast Notifications ---------------------------------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: slideIn 200ms ease-out;
  font-size: 0.813rem;
  line-height: 1.5;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast.info { border-color: var(--accent); }

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--accent); }

.toast-body {
  flex: 1;
  color: var(--text-primary);
}

.toast-dismiss {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  font-size: 1rem;
  transition: color var(--transition);
}
.toast-dismiss:hover { color: var(--text-primary); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Skeleton Loaders ------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 60%;
}

.skeleton-text.short { width: 30%; }
.skeleton-text.long { width: 80%; }
.skeleton-block { height: 80px; }

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Empty State ------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.813rem;
  max-width: 400px;
  margin: 0 auto;
}

/* --- Loading / Spinner overlay ---------------------------- */
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-tertiary);
}

.spinner-lg {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --- Copy Button flash ------------------------------------ */
.copy-flash {
  animation: flash 0.4s ease-out;
}

@keyframes flash {
  0% { background: var(--accent-muted); }
  100% { background: transparent; }
}

/* --- Divider ---------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* --- Confirmation Dialog ---------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  animation: fadeIn 150ms ease-out;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: slideUp 200ms ease-out;
}

.modal h3 {
  margin-bottom: 8px;
}

.modal p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* --- Plan limit info -------------------------------------- */
.limit-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 0.813rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.limit-info svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Chart container -------------------------------------- */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 280px;
}

.chart-container canvas {
  width: 100% !important;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 20px;
  }

  .top-header {
    padding: 0 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .tier-cards {
    grid-template-columns: 1fr;
  }

  .mobile-menu-btn {
    display: flex !important;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none !important;
  }
  .sidebar-close {
    display: none !important;
  }
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.mobile-menu-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.open {
  display: block;
}

/* ============================================================
   LANDING PAGE (index.html) — Signup / Hero
   ============================================================ */

.landing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.landing-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at 20% 50%,
    rgba(59, 130, 246, 0.03) 0%,
    transparent 50%
  ),
  radial-gradient(
    ellipse at 80% 50%,
    rgba(59, 130, 246, 0.02) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  position: relative;
  z-index: 1;
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.landing-logo svg {
  width: 28px;
  height: 28px;
}

.landing-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.signup-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 400ms ease-out;
}

.signup-card.wide {
  max-width: 520px;
}

.signup-header {
  text-align: center;
  margin-bottom: 32px;
}

.signup-header h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.signup-header p {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.signup-header .brand-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  background: var(--accent-muted);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
}

.signup-header .brand-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

/* API key reveal card */
.api-key-reveal {
  text-align: center;
}

.api-key-reveal .success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--success-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.api-key-reveal .success-icon svg {
  width: 28px;
  height: 28px;
  color: var(--success);
}

.api-key-reveal h2 {
  margin-bottom: 6px;
}

.api-key-reveal p {
  color: var(--text-tertiary);
  font-size: 0.813rem;
  margin-bottom: 20px;
}

.api-key-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
}

.api-key-box .key-text {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.6;
  user-select: all;
}

.api-key-box .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  font-size: 0.688rem;
  border-radius: var(--radius-sm);
}

.api-key-box .warning-text {
  font-size: 0.688rem;
  color: var(--warning);
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.signup-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.signup-footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Landing page responsive ------------------------------ */
@media (max-width: 480px) {
  .signup-card {
    padding: 28px 24px;
  }

  .landing-nav {
    padding: 16px 20px;
  }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
