/* ===================================================================
   Bridge Design System
   Font import lives in App.razor <head>
   =================================================================== */

/* ===== Design Tokens ===== */
:root {
  /* Typography */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

  /* Dark palette (marketing pages, sidebar) */
  --bg-dark: #09090b;
  --surface-dark: #18181b;
  --surface-dark-elevated: #27272a;
  --border-dark: #3f3f46;
  --text-dark: #fafafa;
  --text-dark-secondary: #d4d4d8;
  --text-dark-muted: #a1a1aa;

  /* Light palette (dashboard content) */
  --bg-light: #f8fafc;
  --surface-light: #ffffff;
  --surface-light-elevated: #f1f5f9;
  --border-light: #e2e8f0;
  --text-light: #0f172a;
  --text-light-secondary: #334155;
  --text-light-muted: #64748b;

  /* Accent — cyan */
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --accent-dark: #0891b2;
  --accent-subtle: rgba(6, 182, 212, 0.08);
  --accent-glow: rgba(6, 182, 212, 0.15);
  --accent-glow-strong: rgba(6, 182, 212, 0.3);

  /* Status */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #06b6d4;

  /* Sidebar */
  --sidebar-width: 256px;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active-bg: rgba(6, 182, 212, 0.08);
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #f8fafc;
  --sidebar-section: #475569;
  --sidebar-border: #1e293b;

  /* Topbar */
  --topbar-height: 56px;
  --topbar-bg: #ffffff;
  --topbar-border: #e2e8f0;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Bootstrap overrides */
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --bs-primary: #06b6d4;
  --bs-primary-rgb: 6, 182, 212;
  --bs-success: #10b981;
  --bs-success-rgb: 16, 185, 129;
  --bs-warning: #f59e0b;
  --bs-warning-rgb: 245, 158, 11;
  --bs-danger: #ef4444;
  --bs-danger-rgb: 239, 68, 68;
  --bs-info: #06b6d4;
  --bs-info-rgb: 6, 182, 212;
}


/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

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

@media (min-width: 768px) {
  html { font-size: 16px; }
}

body {
  font-family: var(--font-body);
  color: var(--text-light);
  background: var(--bg-light);
  line-height: 1.6;
  margin: 0;
}


/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-light);
}

h1, .h1 { font-size: 2.25rem; font-weight: 800; }
h2, .h2 { font-size: 1.75rem; }
h3, .h3 { font-size: 1.375rem; }
h4, .h4 { font-size: 1.125rem; font-weight: 600; }
h5, .h5 { font-size: 1rem; font-weight: 600; }
h6, .h6 { font-size: 0.875rem; font-weight: 600; }

code, pre, .font-monospace { font-family: var(--font-mono); }

code:not(pre code) {
  font-size: 0.85em;
  background: var(--surface-light-elevated);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--accent-dark);
  border: 1px solid var(--border-light);
}

pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.75;
  border: 1px solid #1e293b;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  border: none;
  font-size: inherit;
}


/* ===== Links ===== */
a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-light); }


/* ===== Buttons (Bootstrap overrides) ===== */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  letter-spacing: -0.01em;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.btn-lg {
  padding: 0.625rem 1.5rem;
  font-size: 0.9375rem;
}

.btn-sm {
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

.btn-outline-primary {
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-success { background: var(--color-success); border-color: var(--color-success); }
.btn-success:hover { background: #059669; border-color: #059669; }

.btn-warning { background: var(--color-warning); border-color: var(--color-warning); color: #0f172a; }
.btn-danger { background: var(--color-error); border-color: var(--color-error); }


/* ===== Cards (Bootstrap overrides) ===== */
.card {
  border-radius: var(--radius-lg);
  border-color: var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-normal);
  background: var(--surface-light);
}

.card-header {
  background: var(--surface-light-elevated);
  border-bottom-color: var(--border-light);
  font-weight: 600;
  font-size: 0.875rem;
}


/* ===== Badges ===== */
.badge {
  font-weight: 500;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  border-radius: var(--radius-full);
  padding: 0.25em 0.625em;
}


/* ===== Tables ===== */
.table { font-size: 0.875rem; }
.table > :not(caption) > * > * { padding: 0.75rem 1rem; }
.table > thead > tr > th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light-muted);
  border-bottom-width: 2px;
}


/* ===== Forms ===== */
.form-control, .form-select {
  border-radius: var(--radius-md);
  border-color: var(--border-light);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-label {
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  color: var(--text-light-secondary);
}


/* ===== Focus states ===== */
.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-glow-strong);
  outline: none;
}


/* ===== Alerts ===== */
.alert {
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  border-width: 1px;
}


/* ===== Spinners ===== */
.spinner-border { color: var(--accent); }


/* ===== Scrollbars ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light-muted); }


/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}


/* ===== Utility classes ===== */
.text-accent { color: var(--accent) !important; }
.bg-accent { background-color: var(--accent) !important; }
.border-accent { border-color: var(--accent) !important; }
.font-mono { font-family: var(--font-mono) !important; }
.text-display { font-family: var(--font-display); letter-spacing: -0.025em; }
