/* -------------------------------------------------------------------------- */
/*                                 Variables                                  */
/* -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Premium Dark Theme */
  --color-bg-base: #0a0a0c;
  --color-bg-surface: #141417;
  --color-bg-surface-elevated: #1e1e24;
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-secondary: #ec4899;
  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-border: #27272a;
  --color-success: #10b981;
  --color-error: #ef4444;

  /* Glassmorphism */
  --glass-bg: rgba(20, 20, 23, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 16px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Transitions & Shadows */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background elements for depth */
body::before {
  content: '';
  position: fixed;
  top: -10%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  bottom: -10%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.05) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

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

/* -------------------------------------------------------------------------- */
/*                                Components                                  */
/* -------------------------------------------------------------------------- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: white;
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
  color: white;
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--color-text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
}

.btn-secondary:hover {
  background: var(--color-bg-surface-elevated);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

.auth-card.glass-card {
  padding: 0.75rem 1.5rem; /* Further reduced from 1rem 1.75rem */
}

/* Inputs */
.form-group {
  margin-bottom: 0.65rem; /* Aggressively reduced from 1.15rem */
}

.form-label {
  display: block;
  margin-bottom: 0.25rem; /* Reduced from 0.5rem */
  font-size: 0.8rem; /* Slightly smaller */
  color: var(--color-text-secondary);
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem; /* Reduced from 0.6rem 0.8rem */
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.5;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  padding: 0.25rem 0; /* Minimized for auth no-scroll */
  border-bottom: 1px solid var(--glass-border);
  background: rgba(10, 10, 12, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.25rem; /* Reduced from 1.5rem */
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--color-text-secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.05em;
}

/* Auth Pages Layout */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 45px); /* Tighter fit for smaller header */
  padding: 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-title {
  text-align: center;
  font-size: 1.3rem; /* Reduced from 2rem */
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem; /* Reduced from 1.25rem */
  font-size: 0.85rem;
}

.auth-footer {
  text-align: center;
  margin-top: 0.4rem; /* Reduced from 0.6rem */
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  display: none;
  /* hidden by default */
}

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

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

/* -------------------------------------------------------------------------- */
/*                                Landing Page                                */
/* -------------------------------------------------------------------------- */

.hero {
  padding: 8rem 0 6rem;
  text-align: center;
}

.hero-pill {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.hero h1 {
  font-size: 4.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #ffffff, #a5b4fc);
  background: linear-gradient(to right, #ffffff, #a5b4fc);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.hero p {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* Pricing */
.pricing-section {
  padding: 5rem 0;
}

.pricing-header {
  text-align: center;
  margin-bottom: 4rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-glow);
}

.pricing-card.popular {
  border-color: rgba(99, 102, 241, 0.5);
  position: relative;
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.plan-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.plan-price {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: end;
  gap: 0.25rem;
}

.plan-price span {
  font-size: 1rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.plan-features {
  list-style: none;
  margin: 2rem 0;
  flex-grow: 1;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
}

.plan-features li svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------- */
/*                                Dashboard                                   */
/* -------------------------------------------------------------------------- */

.dashboard-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  min-height: calc(100vh - 80px);
  padding: 2rem 0;
}

.sidebar {
  border-right: 1px solid var(--color-border);
  padding-right: 2rem;
}

.user-snippet {
  margin-bottom: 2rem;
}

.user-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.user-email {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.nav-links {
  list-style: none;
}

.nav-links li {
  margin-bottom: 0.5rem;
}

.nav-links a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--color-text-secondary);
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--glass-bg);
  color: var(--color-text-primary);
}

.dashboard-content h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.status-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

/* Utility */
.hide {
  display: none !important;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 0.5rem;
}

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

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

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding-right: 0;
    padding-bottom: 2rem;
  }
}