@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ================================================
   CSS VARIABLES & DESIGN TOKENS
   ================================================ */
:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-dark: #0a0a0f;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ================================================
   BACKGROUND GRADIENTS
   ================================================ */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(79, 70, 229, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.page-wrap {
  position: relative;
  z-index: 1;
}

/* ================================================
   PUBLIC NAVBAR
   ================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 70px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.navbar-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.navbar-nav a.active {
  color: var(--text-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(79, 70, 229, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

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

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-lg {
  padding: 14px 30px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

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

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ================================================
   HERO SECTION
   ================================================ */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  text-align: center;
  padding: 80px 40px;
  flex-direction: column;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(79, 70, 229, 0.15);
  border: 1px solid rgba(79, 70, 229, 0.3);
  color: var(--primary-light);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 28px;
  animation: fadeInDown 0.6s ease;
}

.hero h1 {
  font-size: clamp(42px, 7vw, 80px);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.3s both;
}

/* ================================================
   FEATURES SECTION
   ================================================ */
.section {
  padding: 80px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 60px;
}

.feature-card {
  background: var(--glass-bg);
  border: 1px solid #fff;
  border-radius: 5px;
  padding: 32px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
}

.feature-icon.purple {
  background: rgba(79, 70, 229, 0.15);
}

.feature-icon.cyan {
  background: rgba(6, 182, 212, 0.15);
}

.feature-icon.green {
  background: rgba(16, 185, 129, 0.15);
}

.feature-icon.orange {
  background: rgba(245, 158, 11, 0.15);
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ================================================
   INTEGRATIONS MARQUEE
   ================================================ */
.integrations-section {
  padding: 60px 0;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
}

.marquee-label {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 32px;
}

.marquee-track {
  display: flex;
  gap: 20px;
  animation: marquee 30s linear infinite;
  width: max-content;
}

.marquee-wrap {
  overflow: hidden;
  position: relative;
}

.marquee-wrap::before,
.marquee-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
}

.marquee-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-dark), transparent);
}

.marquee-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-dark), transparent);
}

.platform-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ================================================
   AUTH PAGES
   ================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 48px 44px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  animation: fadeInUp 0.5s ease;
}

.auth-header {
  text-align: center;
  margin-bottom: 36px;
}

.auth-header .logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 16px;
}

.auth-header h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-control.error {
  border-color: var(--danger);
}

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

.input-with-icon {
  position: relative;
}

.input-with-icon .form-control {
  padding-left: 44px;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: .5;
  pointer-events: none;
}

.input-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

.input-preview {
  font-size: 11px;
  color: var(--primary-light);
  margin-top: 4px;
  font-weight: 600;
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  display: none;
}

.field-error.show {
  display: block;
}

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

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary-light);
  font-weight: 600;
  text-decoration: none;
}

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

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: none;
  margin-bottom: 20px;
}

.alert.show {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.alert-success {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

/* Custom Checkbox Style */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  user-select: none;
  transition: var(--transition);
}

.checkbox-container:hover {
  color: var(--text-primary);
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-custom {
  height: 18px;
  width: 18px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
  transition: var(--transition);
}

.checkbox-container:hover input~.checkbox-custom {
  border-color: var(--primary-light);
  background: rgba(255, 255, 255, 0.08);
}

.checkbox-container input:checked~.checkbox-custom {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkbox-custom:after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-container input:checked~.checkbox-custom:after {
  display: block;
}

.remember-me-group {
  margin-top: -10px;
  margin-bottom: 24px;
}

/* ================================================
   FOOTER
   ================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: auto;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text-primary);
}

/* ================================================
   ANIMATIONS
   ================================================ */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

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

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .5;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
  .navbar {
    padding: 0 20px;
  }

  .hero {
    padding: 60px 20px;
  }

  .section {
    padding: 60px 20px;
  }

  .auth-card {
    padding: 36px 28px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* --- LIGHT THEME OVERRIDES --- */
:root {
  --primary: #0084ff;
  --primary-light: #339dff;
  --bg-dark: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --glass-bg: #ffffff;
  --glass-border: #e2e8f0;
}

body,
.dash-layout,
.dash-main,
.sidebar,
.dash-topbar,
.navbar,
.welcome-card,
.stat-card,
.integration-item,
.auth-card,
.platform-card,
.modal-box,
.cms-card,
.field-row {
  background: #ffffff !important;
}

.sidebar-nav a:hover,
.sidebar-user:hover {
  background: #f3f4f6 !important;
}

.sidebar-nav a.active {
  background: #f3f4f6 !important;
  color: var(--text-primary) !important;
  border: none !important;
}

.welcome-card::before,
body::before {
  display: none !important;
}

.dash-topbar,
.navbar {
  backdrop-filter: none !important;
}

.btn-primary {
  background: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.sidebar-brand .brand-icon {
  background: var(--primary) !important;
  color: #ffffff !important;
}

.empty-state {
  background: transparent !important;
  border: none !important;
}

.card {
  background: #fff;
  border: 1px solid #fff;
  border-radius: 5px;
  padding: 24px;
  transition: var(--transition);
  animation: slideUp 0.5s ease;
}