/**
 * TileBack App Styles
 * Modern SaaS styling built on PicoCSS + mwangi-ui tokens
 */

/* ============================================================================
   VARIABLE BRIDGE
   Map semantic vars to mwangi-ui tokens for template compatibility
   ============================================================================ */

:root {
  /* Spacing */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Colors */
  --text-primary: var(--mw-text-primary, #1f2937);
  --text-secondary: var(--mw-text-secondary, #6b7280);
  --text-tertiary: var(--mw-text-tertiary, #9ca3af);
  --text-accent: var(--mw-primary, #3b82f6);

  --bg-primary: var(--mw-bg-primary, #ffffff);
  --bg-secondary: var(--mw-bg-secondary, #f9fafb);
  --bg-card: var(--mw-bg-elevated, #ffffff);

  --border-default: var(--mw-border-secondary, #e5e7eb);
  --border-subtle: var(--mw-border-subtle, #f3f4f6);

  --color-primary: var(--mw-primary, #3b82f6);
  --color-primary-hover: var(--mw-primary-hover, #2563eb);
  --color-success: var(--mw-success, #10b981);
  --color-warning: var(--mw-warning, #f59e0b);
  --color-error: var(--mw-error, #ef4444);
}

[data-theme="dark"] {
  --text-primary: var(--mw-text-primary, #f9fafb);
  --text-secondary: var(--mw-text-secondary, #9ca3af);
  --text-tertiary: var(--mw-text-tertiary, #6b7280);

  --bg-primary: var(--mw-bg-primary, #111827);
  --bg-secondary: var(--mw-bg-secondary, #1f2937);
  --bg-card: var(--mw-bg-elevated, #1f2937);

  --border-default: var(--mw-border-secondary, #374151);
  --border-subtle: var(--mw-border-subtle, #1f2937);
}

/* ============================================================================
   BASE OVERRIDES
   Override PicoCSS defaults with our branding
   ============================================================================ */

:root {
  --pico-font-family: 'Lexend', system-ui, sans-serif;
  --pico-font-family-monospace: 'Fira Code', monospace;
  --pico-border-radius: 0.5rem;
}

body {
  font-family: 'Lexend', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Lexend', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

code, pre, kbd {
  font-family: 'Fira Code', monospace;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Auth pages need full-width layouts - remove container constraints */
main.container:has(.auth-container) {
  max-width: 100%;
  padding: 0;
  margin: 0;
  width: 100%;
}

/* Fallback for browsers without :has() support */
@supports not (selector(:has(*))) {
  main.auth-page {
    max-width: 100%;
    padding: 0;
    margin: 0;
    width: 100%;
  }
}

.hero {
  padding: var(--space-12) 0 var(--space-16) 0;
  text-align: center;
}

/* ============================================================================
   GRID SYSTEM
   ============================================================================ */

.grid {
  display: grid;
  gap: var(--space-4);
}

.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

@media (max-width: 768px) {
  .cols-2, .cols-3, .cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .cols-3, .cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================================
   FLEXBOX UTILITIES
   ============================================================================ */

.flex {
  display: flex;
}

.stack {
  display: flex;
  flex-direction: column;
}

.text-center {
  text-align: center;
}

/* ============================================================================
   BUTTONS
   Modern, accessible button styles
   NOTE: Core height normalization happens in mwangi-ui/components.css
   These styles add visual enhancements only
   ============================================================================ */

.btn {
  /* Dimensions are enforced by mwangi-ui/components.css !important rules */
  gap: 0.5rem;
  font-family: 'Lexend', sans-serif;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  /* DO NOT set padding, min-height, line-height, font-size here - managed by components.css */
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px) scale(1.02);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  transition: all 0.1s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  /* Padding managed by components.css */
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  color: white;
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-default);
  /* Padding managed by components.css */
}

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

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  /* Padding managed by components.css */
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Size variants - dimensions managed by components.css, only set what's unique */
.btn-sm {
  /* Padding and font-size managed by components.css */
}

.btn-lg {
  /* Padding and font-size managed by components.css */
}

.btn-block {
  width: 100%;
}

/* Loading state for buttons */
.btn-loading {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.6s linear infinite;
}

.btn-secondary.btn-loading::after {
  border-color: var(--border-default);
  border-top-color: var(--color-primary);
}

/* ============================================================================
   CARDS
   Elevated, modern card design
   ============================================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 0.75rem;
  padding: var(--space-6);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.card:hover {
  border-color: var(--border-default);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

[data-theme="dark"] .card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.card-highlight {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary), 0 4px 12px rgba(59, 130, 246, 0.15);
}

.card-highlight:hover {
  box-shadow: 0 0 0 1px var(--color-primary), 0 8px 20px rgba(59, 130, 246, 0.2);
}

/* ============================================================================
   ALERTS
   ============================================================================ */

.alert {
  padding: var(--space-4);
  border-radius: 0.5rem;
  border-left: 4px solid;
  margin-bottom: var(--space-4);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--color-success);
  color: #065f46;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--color-warning);
  color: #92400e;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--color-error);
  color: #991b1b;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--color-primary);
  color: #1e40af;
}

[data-theme="dark"] .alert-success { color: #065f46; }
[data-theme="dark"] .alert-warning { color: #fcd34d; }
[data-theme="dark"] .alert-error { color: #fca5a5; }
[data-theme="dark"] .alert-info { color: #93c5fd; }

/* ============================================================================
   BADGES
   ============================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-primary {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-error,
.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .badge-primary { color: #60a5fa; }
[data-theme="dark"] .badge-success { color: #34d399; }
[data-theme="dark"] .badge-warning { color: #fbbf24; }
[data-theme="dark"] .badge-error,
[data-theme="dark"] .badge-danger { color: #f87171; }

/* ============================================================================
   BRAND LOGO
   Consistent styling for TileBack logo across all pages
   ============================================================================ */

.brand-logo {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.brand-logo:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

/* ============================================================================
   NAVIGATION
   ============================================================================ */

header.container {
  border-bottom: 1px solid var(--border-default) !important;
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) 0;
}

header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

header nav li {
  margin: 0;
}

header nav a.contrast {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
}

header nav a.secondary {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

header nav a.secondary:hover {
  color: var(--text-primary);
}

/* Mobile Navigation Helper */
@media (max-width: 768px) {
  .hide-mobile {
    display: none;
  }

  header nav ul.nav-menu {
    gap: var(--space-2);
  }

  header nav a,
  header nav button {
    font-size: 0.745rem;
  }

  header nav .btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
  }
}

/* Breadcrumb navigation */
nav[aria-label="breadcrumb"] ul {
  list-style: none;
  display: flex;
  gap: var(--space-2);
  padding: 0;
  margin-bottom: var(--space-6);
  font-size: 0.875rem;
}

nav[aria-label="breadcrumb"] a {
  color: var(--text-secondary);
}

nav[aria-label="breadcrumb"] a:hover {
  color: var(--color-primary);
}

nav[aria-label="breadcrumb"] li::after {
  content: "/";
  margin-left: var(--space-2);
  color: var(--text-tertiary);
}

nav[aria-label="breadcrumb"] li:last-child::after {
  content: "";
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.site-footer {
  margin-top: var(--space-16);
  padding: var(--space-12) 0 var(--space-8) 0;
  border-top: 1px solid var(--border-default);
  background: var(--bg-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-6);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

.footer-logo-link {
  display: inline-block;
  transition: opacity 0.2s ease;
}

.footer-logo-link:hover {
  opacity: 0.8;
  text-decoration: none;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-tagline {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  text-align: left;
  line-height: 1.6;
  margin: 0;
  /* max-width: 400px; */
}

.footer-copyright {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin: 0;
}

.footer-mwangi-link {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.footer-mwangi-link:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.footer-heading {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-3) 0;
  color: var(--text-primary);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-bottom .footer-copyright {
  margin: 0;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer-bottom {
    padding-top: var(--space-4);
  }
}

/* Cookie consent styles are now in /src/views/partials/cookie-consent.ejs */

footer {
  margin-top: var(--space-16);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border-default);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ============================================================================
   TABLES
   Modern, clean table styling
   ============================================================================ */

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

thead {
  background: var(--bg-secondary);
}

th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-default);
}

td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: var(--bg-secondary);
}

.overflow-auto {
  overflow-x: auto;
}

/* ============================================================================
   FORMS
   Enhanced form styling
   ============================================================================ */

/* Form Actions - Button height consistency enforcement
   NOTE: Primary normalization is in mwangi-ui/components.css
   This is a backup layer for dynamic inline styles */
.form-actions,
div[style*="display: flex"][style*="justify-content: flex-end"],
div[style*="display: flex"][style*="gap"] {
  align-items: center !important;
}

/* These rules are now redundant thanks to comprehensive normalization in components.css
   but kept as a safety net for any edge cases */
.form-actions .btn,
.form-actions button,
.form-actions a.btn,
.form-actions [role="button"],
.form-actions a[role="button"],
.form-actions a[class*="btn-"],
div[style*="display: flex"][style*="gap"] > .btn,
div[style*="display: flex"][style*="gap"] > button,
div[style*="display: flex"][style*="gap"] > [role="button"],
div[style*="display: flex"][style*="gap"] > a[role="button"],
div[style*="display: flex"][style*="gap"] > a.btn,
div[style*="display: flex"][style*="gap"] > a[class*="btn-"] {
  /* These are enforced by components.css but adding here for specificity boost */
  height: auto !important;
  min-height: 44px !important;
  padding: 0.625rem 1.25rem !important;
  line-height: 1.4 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  font-size: 0.9375rem !important;
  margin: 0 !important;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  font-size: 0.9375rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: 'Lexend', sans-serif;
  font-size: 0.9375rem;
  border: 1px solid var(--border-default);
  border-radius: 0.5rem;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 44px; /* Touch-friendly minimum */
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

input:hover:not(:focus),
textarea:hover:not(:focus),
select:hover:not(:focus) {
  border-color: var(--text-secondary);
}

/* Success state */
input.is-valid,
textarea.is-valid {
  border-color: var(--color-success);
}

input.is-valid:focus,
textarea.is-valid:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Error state */
input.is-invalid,
textarea.is-invalid {
  border-color: var(--color-error);
}

input.is-invalid:focus,
textarea.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ============================================================================
   TEXT UTILITIES
   ============================================================================ */

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }

.text-gradient {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================================
   CODE BLOCKS
   VSCode-inspired syntax highlighting container
   ============================================================================ */

pre {
  background: #1e1e1e;
  border-radius: 0.5rem;
  overflow: hidden;
}

pre code {
  font-family: 'Fira Code', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ============================================================================
   ONBOARDING COMPONENTS
   Clean, engaging onboarding experience
   ============================================================================ */

/* Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 0.75rem;
  padding: var(--space-5);
  margin-bottom: var(--space-6);
  animation: slideDown 0.4s ease;
}

.welcome-content {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.welcome-emoji {
  font-size: 2rem;
  line-height: 1;
}

.welcome-banner h3 {
  margin: 0 0 var(--space-1) 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.welcome-banner p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

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

/* Onboarding Card */
.onboarding-card {
  background: var(--bg-card);
  border: 2px solid transparent;
  background-image: linear-gradient(var(--bg-card), var(--bg-card)),
                    linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border-radius: 0.75rem;
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
  transition: all 0.3s ease;
  animation: fadeIn 0.4s ease;
}

[data-theme="dark"] .onboarding-card {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Onboarding Header */
.onboarding-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
}

.onboarding-dismiss {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Lexend', sans-serif;
  font-weight: 500;
}

.onboarding-dismiss:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* Progress Bar */
.onboarding-progress {
  height: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: var(--space-6);
  position: relative;
}

.onboarding-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 9999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.onboarding-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

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

/* Onboarding Steps */
.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.onboarding-step.pending {
  background: var(--bg-secondary);
}

.onboarding-step.completed {
  background: rgba(16, 185, 129, 0.05);
}

.onboarding-step:hover {
  background: var(--bg-secondary);
  transform: translateX(2px);
}

.step-indicator {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
}

.onboarding-step.completed .step-indicator {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.onboarding-step.pending .step-indicator {
  background: var(--bg-card);
  border: 2px solid var(--border-default);
}

.step-number {
  color: var(--text-secondary);
}

.step-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.step-title {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.step-optional {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  font-weight: 400;
}

.step-status {
  color: var(--color-success);
  font-size: 0.8125rem;
  font-weight: 500;
}

.step-action {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.step-action:hover {
  text-decoration: none;
  transform: translateX(2px);
}

/* Completion Message */
.completion-message {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 0.5rem;
  padding: var(--space-4);
  margin-top: var(--space-4);
  color: var(--text-primary);
  animation: bounceIn 0.5s ease;
  transition: opacity 0.3s ease;
}

.completion-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .welcome-content {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .onboarding-header {
    flex-direction: column;
    align-items: stretch;
  }

  .onboarding-dismiss {
    align-self: flex-end;
  }

  .step-content {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .step-action {
    align-self: flex-start;
  }
}

/* ============================================================================
   DASHBOARD-SPECIFIC STYLES
   ============================================================================ */

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 0.75rem;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all 0.2s ease;
  cursor: default;
  min-height: 140px; /* Ensures consistent card height */
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--color-primary);
}

[data-theme="dark"] .stat-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 0.5rem;
  color: var(--color-primary);
  flex-shrink: 0;
}

.stat-icon-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  flex: 1;
  text-align: right;
}

.stat-card .stat-trend {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
}

.stat-card .stat-trend.positive {
  color: var(--color-success);
}

.stat-card .stat-trend.negative {
  color: var(--color-error);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--text-secondary);
}

.empty-state svg,
.empty-state .icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state h3 {
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: var(--space-1);
}

/* Quick Actions Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 1024px) {
  .quick-actions-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .quick-actions-grid {
    grid-template-columns: 1fr;
  }
}

.quick-action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 0.75rem;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all 0.2s ease;
}

.quick-action-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .quick-action-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.quick-action-hero {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

@media (min-width: 641px) {
  .quick-action-hero {
    grid-row: span 2;
  }
}

.quick-action-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.quick-action-icon-secondary {
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
  box-shadow: none;
}

.quick-action-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.quick-action-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  flex: 1;
}

/* Status Dots */
.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-active {
  background: var(--color-success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-dot-inactive {
  background: var(--text-tertiary);
  box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.2);
}

.status-dot-warning {
  background: var(--color-warning);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* Forms Table Enhancements */
.forms-table tbody tr.form-row {
  transition: all 0.15s ease;
}

.forms-table tbody tr.form-row:hover {
  background: var(--bg-secondary);
  transform: translateX(2px);
}

/* Submissions Feed */
.submissions-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.submission-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 0.75rem;
  padding: var(--space-4);
  transition: all 0.2s ease;
}

.submission-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .submission-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.submission-card-new {
  animation: pulse 2s ease-in-out infinite;
  border-color: var(--color-success);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, rgba(6, 182, 212, 0.03) 100%);
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
}

.submission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  gap: var(--space-3);
}

.submission-form-name {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.submission-form-name:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.submission-time {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.submission-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-secondary);
  border-radius: 0.5rem;
}

.submission-field {
  display: flex;
  gap: var(--space-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

.submission-field-key {
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

.submission-field-value {
  color: var(--text-primary);
  word-break: break-word;
}

.submission-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.submission-view-link {
  font-size: 0.875rem;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.submission-view-link:hover {
  text-decoration: none;
  transform: translateX(2px);
}

/* Quick links cards */
.quick-links .card {
  transition: all 0.2s ease;
}

.quick-links .card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem !important;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header .btn {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   TRUST BADGES & SOCIAL PROOF
   ============================================================================ */

.trust-icon {
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.trust-icon:hover {
  transform: scale(1.05);
  border-color: var(--color-primary);
}

.trust-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 0.75rem;
}

.trust-badge {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.trust-badge-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}

.trust-badge strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--text-primary);
}

.trust-badge p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .trust-badges {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   ANIMATIONS & MICRO-INTERACTIONS
   ============================================================================ */

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

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* Staggered Fade-in for Grid Items */
.fade-in-stagger > * {
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

.fade-in-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.fade-in-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.fade-in-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.fade-in-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.fade-in-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.fade-in-stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* Slide Up Animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.4s ease forwards;
}

/* Scale In Animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scaleIn 0.3s ease forwards;
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border-default);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================================
   TOAST NOTIFICATIONS
   Temporary feedback messages
   ============================================================================ */

.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  min-width: 250px;
  max-width: 400px;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: var(--text-primary);
  font-size: 0.9375rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast-success {
  border-left: 4px solid var(--color-success);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
}

.toast-error {
  border-left: 4px solid var(--color-error);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(220, 38, 38, 0.05) 100%);
}

.toast-warning {
  border-left: 4px solid var(--color-warning);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(217, 119, 6, 0.05) 100%);
}

.toast-info {
  border-left: 4px solid var(--color-primary);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.05) 100%);
}

@media (max-width: 768px) {
  .toast {
    bottom: var(--space-4);
    right: var(--space-4);
    left: var(--space-4);
    min-width: auto;
  }
}

/* ============================================================================
   COPY BUTTON FOR CODE BLOCKS
   ============================================================================ */

.copy-button {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  padding: 0.375rem 0.75rem;
  font-family: 'Lexend', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.375rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.copy-button.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* ============================================================================
   KEYBOARD FOCUS INDICATORS
   Enhanced focus for keyboard navigation
   ============================================================================ */

.keyboard-focus {
  outline: 2px solid var(--color-primary) !important;
  outline-offset: 2px !important;
}

.keyboard-focus.btn {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* ============================================================================
   EXTERNAL LINK INDICATOR
   ============================================================================ */

.external-icon {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.75em;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

a:hover .external-icon {
  opacity: 1;
}

/* ============================================================================
   DROPDOWN MENUS (for future use)
   ============================================================================ */

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 12rem;
  padding: var(--space-2) 0;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.dropdown-item {
  display: block;
  padding: var(--space-2) var(--space-4);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: var(--bg-secondary);
  text-decoration: none;
}

/* ============================================================================
   PRICING COMPONENTS
   Conversion-optimized pricing section styles
   ============================================================================ */

/* Pricing Toggle */
.pricing-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  padding: var(--space-1);
}

.toggle-option {
  padding: 0.5rem 1.25rem;
  font-family: 'Lexend', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 9999px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toggle-option:hover {
  color: var(--text-primary);
}

.toggle-option.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.savings-pill {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.toggle-option.active .savings-pill {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Pricing Cards */
.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 550px;
}

.pricing-card-featured {
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2) !important;
}

[data-theme="dark"] .pricing-card-featured {
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3) !important;
}

.popular-ribbon {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  white-space: nowrap;
}

/* Feature Comparison Table */
.feature-comparison-table {
  margin-top: var(--space-8);
  overflow-x: auto;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 1px;
  background: var(--border-default);
  border: 1px solid var(--border-default);
  border-radius: 0.75rem;
  overflow: hidden;
  min-width: 600px;
}

.comparison-row {
  display: contents;
}

.comparison-cell {
  background: var(--bg-card);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.9375rem;
}

.comparison-header .comparison-cell {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.comparison-label {
  justify-content: flex-start;
  text-align: left;
  font-weight: 500;
  color: var(--text-primary);
}

.comparison-highlight {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  color: var(--color-primary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .feature-comparison-table {
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    padding: 0 var(--space-4);
  }
}

/* ============================================================================
   BILLING PAGE STYLES
   ============================================================================ */

/* Small Pricing Toggle for Billing Page */
.pricing-toggle-small {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  padding: 0.25rem;
}

.toggle-option-small {
  padding: 0.375rem 0.875rem;
  font-family: 'Lexend', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 9999px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toggle-option-small:hover {
  color: var(--text-primary);
}

.toggle-option-small.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.savings-pill-small {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.toggle-option-small.active .savings-pill-small {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Usage Bars - Modern Style */
.usage-bar-modern {
  height: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.usage-bar-fill-modern {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 9999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

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

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

/* Pricing Cards for Billing Page */
.pricing-card-billing {
  position: relative;
  transition: all 0.2s ease;
}

.pricing-card-billing.current-plan {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
}

.current-plan-badge {
  position: absolute;
  top: -10px;
  right: var(--space-4);
  background: var(--color-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Billing Trust Section */
.billing-trust-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  padding: var(--space-8);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, rgba(139, 92, 246, 0.02) 100%);
  border: 1px solid var(--border-default);
  border-radius: 0.75rem;
}

@media (max-width: 768px) {
  .billing-trust-section {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .pricing-card-featured {
    transform: scale(1);
  }
}

/* ============================================================================
   MOBILE OPTIMIZATIONS
   Enhanced touch-friendly interactions and responsive layouts
   ============================================================================ */

/* Tablet Breakpoint */
@media (max-width: 1024px) {
  /* Adjust hero padding */
  .hero {
    padding: var(--space-12) 0 var(--space-10) 0;
  }

  /* Reduce spacing for sections */
  section {
    padding: var(--space-10) 0;
  }

  /* Trust icons scale down */
  .trust-icon {
    width: 3rem;
    height: 3rem;
  }

  /* Quick actions to 2 columns */
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
  /* Typography scaling */
  h1 {
    font-size: 2rem !important;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.5rem !important;
  }

  h3 {
    font-size: 1.25rem !important;
  }

  /* Hero specific adjustments */
  .hero h1 {
    font-size: 2.5rem !important;
    line-height: 1.15;
  }

  .hero p {
    font-size: 1rem !important;
  }

  /* Reduce container padding on mobile */
  .container {
    padding: 0 var(--space-3);
  }

  /* Section padding adjustments */
  .hero {
    padding: var(--space-10) 0 var(--space-8) 0;
  }

  section {
    padding: var(--space-8) 0;
  }

  /* Button stacking on mobile */
  .hero .flex {
    flex-direction: column;
    width: 100%;
  }

  .hero .btn {
    width: 100%;
  }

  /* Card padding reduction */
  .card {
    padding: var(--space-4);
  }

  /* Trust badges to single column */
  .trust-badges {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-4);
  }

  /* Stats grid to single column */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Table wrapper for horizontal scroll */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Forms table adjustments */
  .forms-table td {
    padding: var(--space-2) var(--space-3);
    font-size: 0.875rem;
  }

  /* Hide certain columns on mobile */
  .forms-table th:nth-child(3),
  .forms-table td:nth-child(3) {
    display: none; /* Hide "Last Submission" column on mobile */
  }

  /* Quick actions to single column */
  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  /* Pricing cards stack */
  .pricing-card {
    min-height: auto;
  }

  /* Feature comparison table scroll container */
  .feature-comparison-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Submission cards mobile adjustments */
  .submission-card {
    padding: var(--space-3);
  }

  .submission-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .submission-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  /* Page header mobile */
  .page-header {
    margin-bottom: var(--space-6);
  }

  /* Onboarding card adjustments */
  .onboarding-card {
    padding: var(--space-4);
  }

  .step-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Small Mobile Breakpoint */
@media (max-width: 480px) {
  /* Further reduce hero text */
  .hero h1 {
    font-size: 2rem !important;
  }

  .hero p {
    font-size: 0.9375rem !important;
  }

  /* Reduce card padding more */
  .card {
    padding: var(--space-3);
  }

  /* Button size adjustments */
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
  }

  /* Stat cards compact mode */
  .stat-card .stat-value {
    font-size: 1.5rem;
  }

  /* Trust icon further reduction */
  .trust-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }

  /* Pricing toggle to vertical */
  .pricing-toggle {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-2);
  }

  .toggle-option {
    justify-content: center;
    width: 100%;
  }
}

/* ============================================================================
   TOUCH OPTIMIZATION
   Improve touch targets and remove hover-only interactions
   ============================================================================ */

/* Ensure all interactive elements are at least 44x44px */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .btn:hover,
  .card:hover,
  a:hover {
    transform: none;
  }

  /* Enhance tap feedback */
  .btn:active {
    transform: scale(0.97);
    opacity: 0.9;
  }

  /* Remove subtle hover animations on touch */
  .quick-action-card:hover,
  .stat-card:hover,
  .submission-card:hover {
    transform: none;
  }

  /* Ensure dropdowns work with tap */
  .dropdown:hover .dropdown-menu {
    opacity: 0;
    visibility: hidden;
  }

  .dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
  }
}

/* Increase touch target sizes */
@media (max-width: 768px) {
  /* Navigation links */
  header nav a,
  header nav button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Footer links */
  .footer-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) 0;
  }

  /* Badge minimum touch size */
  .badge {
    min-height: 32px;
    padding: 0.375rem 0.75rem;
  }

  /* Form controls spacing */
  label {
    margin-bottom: var(--space-3);
  }

  input,
  textarea,
  select {
    margin-bottom: var(--space-4);
  }
}

/* ============================================================================
   STICKY HEADER OPTIMIZATION
   ============================================================================ */

header.container {
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  backdrop-filter: blur(10px);
  z-index: 100;
  transition: box-shadow 0.2s ease;
}

header.container.scrolled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] header.container.scrolled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   SMOOTH SCROLLING
   ============================================================================ */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* Account for sticky header */
}

/* Anchor links should account for sticky header */
:target {
  scroll-margin-top: 100px;
}

/* ============================================================================
   MODAL SYSTEM
   Accessible, animated modal dialogs
   ============================================================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: var(--space-4);
}

.modal-overlay.show {
  opacity: 1;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 0.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  transform: scale(0.9) translateY(-20px);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal-overlay.show .modal-content {
  transform: scale(1) translateY(0);
}

[data-theme="dark"] .modal-content {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-header {
  padding: var(--space-6) var(--space-6) var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-4) var(--space-6);
}

.modal-body p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.modal-footer {
  padding: var(--space-4) var(--space-6) var(--space-6) var(--space-6);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

.modal-footer .btn {
  min-width: 100px;
}

/* Modal Variants */
.modal-info .modal-header {
  border-bottom-color: rgba(59, 130, 246, 0.2);
}

.modal-info .modal-title {
  color: var(--color-primary);
}

.modal-success .modal-header {
  border-bottom-color: rgba(16, 185, 129, 0.2);
}

.modal-success .modal-title {
  color: var(--color-success);
}

.modal-warning .modal-header {
  border-bottom-color: rgba(245, 158, 11, 0.2);
}

.modal-warning .modal-title {
  color: var(--color-warning);
}

.modal-error .modal-header {
  border-bottom-color: rgba(239, 68, 68, 0.2);
}

.modal-error .modal-title {
  color: var(--color-error);
}

/* Modal responsive adjustments */
@media (max-width: 640px) {
  .modal-content {
    max-width: 100%;
    margin: var(--space-4);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

/* ============================================================================
   ACCESSIBILITY - REDUCED MOTION
   Critical for users with motion sensitivities
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Remove all transforms in reduced motion */
  .btn:hover,
  .btn:active,
  .card:hover,
  input:focus,
  textarea:focus,
  select:focus {
    transform: none !important;
  }

  /* Keep functional transforms only */
  .spinner {
    animation: none;
    opacity: 0.5;
  }
}

/* ============================================================================
   PERFORMANCE OPTIMIZATION
   Use will-change sparingly for animated elements
   ============================================================================ */

.btn,
.card,
.quick-action-card,
.stat-card {
  will-change: transform;
}

/* Remove will-change after animation completes */
.btn:not(:hover):not(:active),
.card:not(:hover):not(:focus-within) {
  will-change: auto;
}

/* ============================================================================
   HIGH CONTRAST MODE SUPPORT
   ============================================================================ */

@media (prefers-contrast: high) {
  .btn {
    border-width: 2px;
  }

  .card {
    border-width: 2px;
  }

  input,
  textarea,
  select {
    border-width: 2px;
  }
}

/* ============================================================================
   PRINT STYLES
   Ensure pages print cleanly
   ============================================================================ */

@media print {
  /* Hide interactive elements */
  .btn,
  header nav,
  footer,
  .cookie-banner {
    display: none;
  }

  /* Remove shadows and backgrounds */
  .card {
    box-shadow: none;
    border: 1px solid #000;
  }

  /* Ensure text is black on white */
  body {
    background: white;
    color: black;
  }

  /* Prevent page breaks inside elements */
  .card,
  .stat-card,
  .submission-card {
    page-break-inside: avoid;
  }
}

/* ============================================================================
   AUTH PAGES - 50/50 SPLIT LAYOUT
   Modern, conversion-optimized authentication pages
   ============================================================================ */

.auth-split {
  display: grid;
  grid-template-columns: 35% 65%;
  gap: var(--space-8);
  min-height: calc(100vh - 200px);
  align-items: center;
  padding: var(--space-8) 0;
}

.auth-left {
  padding-right: var(--space-6);
}

.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-branding h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.auth-tagline {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

.auth-benefits {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.auth-benefit {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.benefit-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border-radius: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.benefit-text {
  flex: 1;
}

.benefit-text strong {
  display: block;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.benefit-text p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 1rem;
  padding: var(--space-8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .auth-card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.auth-header {
  margin-bottom: var(--space-6);
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 var(--space-2) 0;
  color: var(--text-primary);
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin: 0;
}

.auth-form {
  margin-bottom: var(--space-6);
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.form-group label small {
  color: var(--text-tertiary);
  font-weight: 400;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.form-footer {
  text-align: center;
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

.form-footer-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin: 0;
}

.form-footer-text a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.form-footer-text a:hover {
  text-decoration: underline;
}

.forgot-password-link {
  display: block;
  text-align: right;
  margin-top: var(--space-2);
  font-size: 0.875rem;
  color: var(--color-primary);
  text-decoration: none;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

/* Mobile: Stack columns, form first */
@media (max-width: 1024px) {
  .auth-split {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .auth-left {
    order: 2;
    padding-right: 0;
    padding-top: var(--space-6);
  }

  .auth-right {
    order: 1;
  }

  .auth-branding h1 {
    font-size: 2rem;
  }

  .auth-benefits {
    gap: var(--space-4);
  }
}

@media (max-width: 640px) {
  .auth-split {
    padding: var(--space-4) 0;
  }

  .auth-card {
    padding: var(--space-6);
  }

  .auth-branding h1 {
    font-size: 1.75rem;
  }

  .auth-tagline {
    font-size: 1rem;
  }
}

/* ============================================================================
   ENHANCED FORM INPUTS
   More visible, accessible inputs for dark theme
   ============================================================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

input:focus,
textarea:focus,
select:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================================================
   PASSWORD TOGGLE
   Show/hide password functionality
   ============================================================================ */

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 3rem;
  flex: 1;
}

.password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.875rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
  z-index: 10;
}

.password-toggle:hover {
  color: var(--text-primary);
}

.password-toggle:focus {
  outline: none;
}

.password-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.eye-icon {
  flex-shrink: 0;
}

/* ============================================================================
   PASSWORD STRENGTH INDICATOR
   Real-time password strength feedback
   ============================================================================ */

.password-strength {
  margin-top: var(--space-3);
}

.strength-bar {
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.strength-fill {
  height: 100%;
  width: 0%;
  background: var(--text-tertiary);
  border-radius: 9999px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-fill.weak {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.strength-fill.fair {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.strength-fill.good {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.strength-fill.strong {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.strength-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  line-height: 1.3;
}

.req {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
}

.req.met {
  color: var(--color-success);
}

@media (max-width: 480px) {
  .strength-requirements {
    gap: 0.4rem;
  }

  .req {
    font-size: 0.65rem;
  }
}
