/* ============================================================
   CRYPTIC AI — Main Stylesheet
   Dark futuristic purple glassmorphism theme
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary:    #0F0A1A;
  --bg-secondary:  #1A1128;
  --bg-tertiary:   #231535;
  --bg-card:       rgba(124, 58, 237, 0.08);
  --bg-card-hover: rgba(124, 58, 237, 0.14);

  --purple-primary: #7C3AED;
  --purple-light:   #A78BFA;
  --purple-lighter: #C4B5FD;
  --purple-dark:    #4C1D95;
  --purple-glow:    rgba(124, 58, 237, 0.4);
  --purple-glow-sm: rgba(124, 58, 237, 0.2);

  --text-primary:   #F5F3FF;
  --text-secondary: #C4B5FD;
  --text-muted:     #7C6A9E;

  --border-color:   rgba(167, 139, 250, 0.15);
  --border-hover:   rgba(167, 139, 250, 0.4);

  --success: #10B981;
  --danger:  #EF4444;
  --warning: #F59E0B;
  --info:    #3B82F6;

  --sidebar-width: 260px;
  --navbar-height: 64px;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 30px var(--purple-glow);
  --shadow-glow-lg: 0 0 60px rgba(124, 58, 237, 0.35);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { color: var(--text-secondary); }

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

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb {
  background: var(--purple-dark);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--purple-primary); }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-primary), var(--purple-dark));
  color: #fff;
  box-shadow: 0 4px 15px var(--purple-glow);
}
.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(124, 58, 237, 0.6);
  transform: translateY(-2px);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: transparent;
  color: var(--purple-light);
  border: 1px solid var(--border-hover);
}
.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--purple-primary);
  color: var(--text-primary);
  box-shadow: 0 0 15px var(--purple-glow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 8px 16px;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.btn-danger {
  background: linear-gradient(135deg, #EF4444, #B91C1C);
  color: #fff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  box-shadow: 0 6px 25px rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
  color: #fff;
}

.btn-sm {
  padding: 7px 16px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 14px 36px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-icon {
  padding: 10px;
  border-radius: var(--radius-md);
}

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

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.card-flat {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* ---------- Inputs ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

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

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

.form-control:focus {
  border-color: var(--purple-primary);
  background: rgba(124, 58, 237, 0.06);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-control:invalid.touched {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A78BFA' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

select.form-control option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  display: none;
}
.form-error.visible { display: block; }

/* Signup field validation highlight */
.form-control.input-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ---------- Checkboxes & Radios ---------- */
.checkbox-group, .radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.checkbox-item, .radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"],
.radio-item input[type="radio"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-hover);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
  background: transparent;
  position: relative;
}

.radio-item input[type="radio"] {
  border-radius: 50%;
}

.checkbox-item input[type="checkbox"]:checked,
.radio-item input[type="radio"]:checked {
  background: var(--purple-primary);
  border-color: var(--purple-primary);
}

.checkbox-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.radio-item input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.checkbox-item label,
.radio-item label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-purple {
  background: rgba(124, 58, 237, 0.2);
  color: var(--purple-light);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ---------- Spinner ---------- */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--purple-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

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

/* ---------- Toast / Alert ---------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  min-width: 280px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInUp 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--purple-primary); }

.toast-icon { font-size: 1.1rem; }
.toast-message { font-size: 0.9rem; flex: 1; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 26, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 640px;
  width: 100%;
  transform: scale(0.95);
  transition: var(--transition);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  padding: 4px;
  transition: var(--transition-fast);
  border-radius: var(--radius-sm);
}
.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

/* ============================================================
   LAYOUT — NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: rgba(15, 10, 26, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar-logo { flex-shrink: 0; }

.navbar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.navbar-spacer { flex: 1; }

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.navbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-primary), var(--purple-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  flex-direction: column;
  gap: 5px;
  transition: var(--transition-fast);
}

.hamburger:hover { background: var(--bg-card); }

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   LAYOUT — SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height));
  background: rgba(26, 17, 40, 0.95);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  overflow-y: auto;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.3s ease;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
  position: relative;
}

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

.sidebar-link.active {
  background: rgba(124, 58, 237, 0.15);
  color: var(--purple-light);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--purple-primary);
  border-radius: 0 3px 3px 0;
}

.sidebar-link .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link.active .icon,
.sidebar-link:hover .icon { opacity: 1; }

.sidebar-divider {
  height: 1px;
  background: var(--border-color);
  margin: 12px 0;
}

.sidebar-spacer { flex: 1; }

/* ============================================================
   LAYOUT — MAIN CONTENT
   ============================================================ */
.page-wrapper {
  margin-left: var(--sidebar-width);
  margin-top: var(--navbar-height);
  min-height: calc(100vh - var(--navbar-height));
  padding: 32px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.page-header p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

/* Particles */
.particles-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--purple-primary);
  opacity: 0;
  animation: floatParticle var(--dur, 8s) ease-in-out var(--delay, 0s) infinite;
}

@keyframes floatParticle {
  0%   { opacity: 0; transform: translateY(0) scale(0); }
  20%  { opacity: 0.15; }
  80%  { opacity: 0.08; }
  100% { opacity: 0; transform: translateY(-120vh) scale(1.5); }
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--purple-light);
  margin-bottom: 24px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: fadeInDown 0.6s ease forwards;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
  margin-bottom: 20px;
  animation: fadeInUp 0.7s ease 0.1s both;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--purple-light), #F0ABFC, var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200%;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  animation: fadeInUp 0.7s ease 0.2s both;
}

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

/* Services preview */
.services-section {
  padding: 80px 24px;
  position: relative;
  z-index: 1;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 48px auto 0;
}

.service-preview-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.service-preview-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: var(--shadow-glow);
}

.service-preview-card:hover::before {
  opacity: 1;
}

.service-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(76, 29, 149, 0.2));
  border: 1px solid rgba(124, 58, 237, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
  transition: var(--transition);
}

.service-preview-card:hover .service-icon-wrap {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(76, 29, 149, 0.35));
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.service-preview-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.service-preview-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Login section */
.login-section {
  padding: 60px 24px 80px;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.login-card {
  background: rgba(26, 17, 40, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-glow-lg);
}

.login-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-card-header h2 { margin-bottom: 6px; }
.login-card-header p  { font-size: 0.9rem; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

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

/* ============================================================
   DASHBOARD PAGE
   ============================================================ */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
}

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

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.stat-change {
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 500;
}

.service-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple-primary), var(--purple-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition);
}

.service-card:hover {
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.service-card:hover::after { transform: scaleX(1); }

.service-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(76, 29, 149, 0.25));
  border: 1px solid rgba(124, 58, 237, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.service-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.service-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.7;
}

.service-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.email-channel-panel {
  margin-top: 28px;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.email-channel-main {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.email-channel-main h2 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.email-channel-main p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.panel-kicker {
  color: var(--purple-light) !important;
  font-size: 0.75rem !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.email-channel-address {
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: var(--radius-md);
  background: rgba(124, 58, 237, 0.08);
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

/* Recent submissions table */
.submissions-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.submissions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.submissions-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.submissions-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(167,139,250,0.07);
  color: var(--text-secondary);
}

.submissions-table tr:last-child td { border-bottom: none; }

.submissions-table tr:hover td {
  background: rgba(124, 58, 237, 0.04);
}

/* ============================================================
   DEMOS PAGE
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  transition: var(--transition-fast);
  letter-spacing: 0.02em;
}

.filter-btn:hover {
  border-color: var(--purple-light);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--purple-primary);
  border-color: var(--purple-primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--purple-glow);
}

.demos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.demo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: var(--transition);
}

.demo-card:hover {
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.demo-thumbnail {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  background: var(--bg-tertiary);
  overflow: hidden;
}

.demo-thumbnail img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 10, 26, 0.5);
  transition: var(--transition-fast);
}

.demo-play-btn span {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 20px var(--purple-glow);
  transition: var(--transition);
}

.demo-card:hover .demo-play-btn span {
  transform: scale(1.1);
  box-shadow: 0 0 30px var(--purple-glow);
}

.demo-card-body {
  padding: 1.25rem;
}

.demo-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple-light);
  margin-bottom: 8px;
}

.demo-card-body h4 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.demo-card-body p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Video modal */
.video-modal .modal {
  max-width: 840px;
  padding: 1.5rem;
}

.video-embed-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.video-embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================================
   FORMS PAGE
   ============================================================ */
.form-page-wrapper {
  margin-left: var(--sidebar-width);
  margin-top: var(--navbar-height);
  padding: 40px;
  min-height: calc(100vh - var(--navbar-height));
  max-width: calc(var(--sidebar-width) + 800px);
}

.form-container {
  max-width: 760px;
  margin: 0 auto;
}

.form-header {
  text-align: center;
  margin-bottom: 40px;
}

.form-header .service-icon-wrap {
  margin-bottom: 20px;
}

.form-header h1 { margin-bottom: 10px; }

.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 24px;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--purple-light);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

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

/* Voice Recording */
.voice-recorder {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
}

.voice-recorder.recording {
  border-color: var(--danger);
  border-style: solid;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.voice-recorder.has-recording {
  border-color: var(--success);
  border-style: solid;
}

.voice-recorder-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.1);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px;
  transition: var(--transition);
  cursor: pointer;
}

.voice-recorder.recording .voice-recorder-icon {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
  animation: recordPulse 1s ease infinite;
}

@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50%       { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}

.voice-recorder-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.voice-recorder-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.recorder-timer {
  font-family: 'Space Grotesk', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: none;
}

.recorder-timer.visible { display: block; }

/* Waveform */
.waveform-canvas {
  width: 100%;
  height: 60px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  display: none;
}

.waveform-canvas.visible { display: block; }

.recorder-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.transcription-box {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
  min-height: 60px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: none;
}

.transcription-box.visible { display: block; }

.transcription-box .transcription-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.audio-playback {
  display: none;
  width: 100%;
  margin-top: 12px;
  border-radius: var(--radius-md);
  filter: invert(1) hue-rotate(240deg);
}

.audio-playback.visible { display: block; }

/* File upload */
.file-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(0,0,0,0.15);
}

.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: var(--purple-primary);
  background: rgba(124, 58, 237, 0.05);
}

.file-upload-area input[type="file"] {
  display: none;
}

.file-upload-icon { font-size: 2rem; margin-bottom: 8px; }

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

.file-upload-text span {
  color: var(--purple-light);
  font-weight: 600;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  text-align: left;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.file-item-name { flex: 1; }

.file-item-remove {
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-fast);
  background: none;
  border: none;
  font-size: 1rem;
  line-height: 1;
  padding: 2px;
}

.file-item-remove:hover { color: var(--danger); }

/* Form submit */
.form-submit-area {
  text-align: center;
  padding-top: 8px;
}

/* ============================================================
   SUCCESS MODAL
   ============================================================ */
.success-modal .modal {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 440px;
}

.success-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 24px;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0%   { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 3s ease forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

/* ============================================================
   LOGO SVG
   ============================================================ */
.logo-svg {
  width: 36px;
  height: 36px;
}

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

.footer a {
  color: var(--purple-light);
  font-weight: 500;
}

/* ============================================================
   SKELETON LOADER
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-md);
  height: 1em;
}

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

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-title {
  text-align: center;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto;
}

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

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

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

.fade-in-up {
  animation: fadeInUp 0.6s ease both;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* gradient text utility */
.gradient-text {
  background: linear-gradient(135deg, var(--purple-light), #F0ABFC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   RESPONSIVE — MOBILE FIRST
   ============================================================ */

/* Tablet and below */
@media (max-width: 1024px) {
  .page-wrapper,
  .form-page-wrapper {
    margin-left: 0;
    padding: 24px;
  }

  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }

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

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--navbar-height);
    background: rgba(15, 10, 26, 0.7);
    z-index: 190;
  }

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

  .hamburger { display: flex; }
}

@media (max-width: 900px) {
  .hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-title {
    font-size: 2.25rem;
    width: calc(100vw - 32px);
    max-width: 358px;
  }

  .hero-subtitle {
    width: calc(100vw - 32px);
    max-width: 358px;
  }

  .hero-actions {
    width: calc(100vw - 32px);
    max-width: 358px;
  }

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

/* Mobile */
@media (max-width: 640px) {
  .page-wrapper,
  .form-page-wrapper {
    padding: 16px;
  }

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

  .hero-actions {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

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

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

  .email-channel-panel {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .filter-bar {
    gap: 6px;
  }

  .filter-btn {
    padding: 7px 14px;
    font-size: 0.8rem;
  }

  .navbar-user .user-email {
    display: none;
  }

  .login-card {
    padding: 1.75rem;
  }

  .form-section {
    padding: 1.25rem;
  }

  .recorder-controls {
    flex-direction: column;
    align-items: center;
  }

  .modal {
    padding: 1.5rem;
  }

  .video-modal .modal {
    padding: 1rem;
  }
}

/* Desktop wide */
@media (min-width: 1280px) {
  .page-wrapper,
  .form-page-wrapper {
    padding: 40px 48px;
  }

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