/* ============================================================
   ENTREVUED — Design System & Global Styles
   Mobile-first, dark-theme, premium aesthetic
   ============================================================ */

/* Fonts loaded via <link> in HTML for parallel discovery (no @import waterfall) */

/* ── CSS Design Tokens ──────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-0: #04040a;
  --bg-1: #080810;
  --bg-2: #0e0e1a;
  --bg-3: #141422;
  --bg-card: rgba(255, 255, 255, 0.025);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --bg-glass: rgba(14, 14, 26, 0.8);

  /* Accent Palette — Indigo/Violet spectrum */
  --accent-50:  #eef2ff;
  --accent-100: #e0e7ff;
  --accent-200: #c7d2fe;
  --accent-400: #818cf8;
  --accent-500: #6366f1;
  --accent-600: #4f46e5;
  --accent-700: #4338ca;
  --violet:     #8b5cf6;
  --purple:     #a855f7;
  --pink:       #ec4899;
  --cyan:       #06b6d4;
  --emerald:    #10b981;
  --amber:      #f59e0b;
  --rose:       #f43f5e;

  /* Glow */
  --glow-accent: rgba(99, 102, 241, 0.35);
  --glow-violet: rgba(139, 92, 246, 0.3);
  --glow-emerald: rgba(16, 185, 129, 0.3);

  /* Borders */
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong:  rgba(255, 255, 255, 0.18);
  --border-accent:  rgba(99, 102, 241, 0.4);

  /* Text */
  --text-primary:   #f0f0fa;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;
  --text-disabled:  #2d3748;

  /* Gradients */
  --grad-primary:   linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --grad-vibrant:   linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
  --grad-hero-mesh:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(99,102,241,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(139,92,246,0.14) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 60% 80%, rgba(168,85,247,0.08) 0%, transparent 50%);
  --grad-card:      linear-gradient(145deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  --grad-text:      linear-gradient(135deg, #f0f0fa 0%, #a5b4fc 50%, #c4b5fd 100%);
  --grad-brand:     linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --brand-glow:     0 0 12px rgba(99,102,241,0.35);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Font sizes (fluid) */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;
  --sp-32: 8rem;

  /* Border radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-2xl:  28px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs:    0 1px 2px rgba(0,0,0,0.5);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.5);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.6);
  --shadow-xl:    0 16px 64px rgba(0,0,0,0.7);
  --shadow-glow:  0 0 40px rgba(99,102,241,0.2), 0 0 80px rgba(99,102,241,0.1);
  --shadow-card:  0 1px 1px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);

  /* Transitions */
  --t-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base:   250ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow:   400ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index scale */
  --z-base:    0;
  --z-raised:  10;
  --z-overlay: 100;
  --z-modal:   1000;
  --z-toast:   2000;
  --z-nav:     500;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* prevent horizontal scroll at root level */
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-0);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-500); }

/* ── Selection ──────────────────────────────────────────────── */
::selection { background: rgba(99,102,241,0.3); color: var(--text-primary); }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.2rem, 6vw, var(--text-6xl)); }
h2 { font-size: clamp(1.8rem, 4vw, var(--text-4xl)); }
h3 { font-size: clamp(1.3rem, 3vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

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

a { color: var(--accent-400); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-200); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-3);
  padding: 0.15em 0.4em;
  border-radius: var(--r-sm);
  color: var(--accent-200);
  border: 1px solid var(--border-subtle);
}

/* ── Container ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

@media (min-width: 640px)  { .container { padding-inline: var(--sp-6); } }
@media (min-width: 1024px) { .container { padding-inline: var(--sp-8); } }

/* ── Grid ───────────────────────────────────────────────────── */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--sp-6); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--sp-6); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: var(--sp-4); }

/* ── Flex Utilities ─────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* ── Spacing Utilities ──────────────────────────────────────── */
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.pt-24 { padding-top: var(--sp-24); }

/* ── Text Utilities ─────────────────────────────────────────── */
.text-center { text-align: center; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-lg { font-size: var(--text-lg); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-400); }
.text-gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.font-mono { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ── ─────────────────────────────────────────────────────────
   NAVIGATION
   ───────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: var(--sp-4) 0;
  transition: all var(--t-base);
}

.nav.scrolled {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--sp-3) 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.nav-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--grad-primary);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--shadow-glow);
}

.nav-links {
  display: none;
  align-items: center;
  gap: var(--sp-6);
  list-style: none;
}

@media (min-width: 768px) { .nav-links { display: flex; } }

.nav-links a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--t-fast);
}
.nav-links a:hover { color: var(--text-primary); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* On mobile: hide text nav buttons, show only hamburger */
@media (max-width: 767px) {
  .nav-actions > a { display: none !important; }
}

/* Hamburger */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--sp-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  flex-shrink: 0;
}

@media (min-width: 768px) { .nav-hamburger { display: none; } }

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--r-full);
  transition: all var(--t-base);
}

/* Mobile menu */
.nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--sp-4) var(--sp-5);
  flex-direction: column;
  gap: var(--sp-3);
}

.nav-mobile.open { display: flex; }
.nav-mobile a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* ── ─────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.625rem var(--sp-5);
  border-radius: var(--r-lg);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--t-base);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.btn:hover::after { opacity: 0.06; }
.btn:active::after { opacity: 0.12; }

.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 2px 12px rgba(99,102,241,0.4), 0 1px 0 rgba(255,255,255,0.1) inset;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99,102,241,0.5), 0 1px 0 rgba(255,255,255,0.1) inset;
  color: white;
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  color: var(--text-primary);
}

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

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

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.btn-sm { padding: 0.4rem var(--sp-4); font-size: var(--text-xs); border-radius: var(--r-md); }
.btn-lg { padding: 0.875rem var(--sp-8); font-size: var(--text-base); border-radius: var(--r-xl); }
.btn-xl { padding: 1rem var(--sp-10); font-size: var(--text-lg); border-radius: var(--r-xl); }
@media (max-width: 639px) {
  .btn-xl { padding: 0.875rem var(--sp-6); font-size: var(--text-base); }
}
.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-loading { pointer-events: none; }
.btn-loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: var(--sp-2);
}

/* ── ─────────────────────────────────────────────────────────
   CARDS
   ───────────────────────────────────────────────────────── */
.card {
  background: var(--grad-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-card);
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  pointer-events: none;
}

.card-hover:hover {
  transform: translateY(-3px);
  border-color: var(--border-default);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-subtle);
}

.card-glow:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow), var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.card-body { flex: 1; }
.card-footer {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
}

/* ── ─────────────────────────────────────────────────────────
   FORMS
   ───────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem var(--sp-4);
  background: var(--bg-2);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  transition: all var(--t-fast);
  outline: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-500);
  background: var(--bg-3);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

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

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: var(--sp-10);
}

.form-select option { background: var(--bg-2); }

.form-error {
  font-size: var(--text-xs);
  color: var(--rose);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Input with icon */
.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.input-wrapper .form-input { padding-left: calc(var(--sp-4) * 2 + 16px); }

/* ── ─────────────────────────────────────────────────────────
   BADGES
   ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-default { background: var(--bg-3); color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.badge-accent  { background: rgba(99,102,241,0.15); color: var(--accent-200); border: 1px solid rgba(99,102,241,0.3); }
.badge-success { background: rgba(16,185,129,0.15); color: #6ee7b7; 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); }
.badge-danger  { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.badge-violet  { background: rgba(139,92,246,0.15); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.3); }

/* ── ─────────────────────────────────────────────────────────
   SECTION STYLES
   ───────────────────────────────────────────────────────── */
.section {
  padding: var(--sp-20) 0;
}

.section-sm { padding: var(--sp-12) 0; }
.section-lg { padding: var(--sp-32) 0; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-400);
  margin-bottom: var(--sp-4);
}

.section-label::before,
.section-label::after {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent-500);
}

/* ── ─────────────────────────────────────────────────────────
   SKILL SCALE COMPONENT
   ───────────────────────────────────────────────────────── */
.skill-scale {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}

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

.skill-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.skill-value {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent-400);
  font-family: var(--font-mono);
}

.skill-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: var(--r-full);
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--r-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(99,102,241,0.4);
}

.skill-dots {
  display: flex;
  gap: var(--sp-1);
}

.skill-dot {
  width: 24px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--bg-3);
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
}

.skill-dot.active { background: var(--accent-500); }
.skill-dot:hover { transform: scaleY(1.4); }

/* ── ─────────────────────────────────────────────────────────
   AVATAR
   ───────────────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-sm  { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-md  { width: 40px; height: 40px; font-size: var(--text-sm); }
.avatar-lg  { width: 52px; height: 52px; font-size: var(--text-base); }
.avatar-xl  { width: 72px; height: 72px; font-size: var(--text-xl); }

.avatar-gradient { background: var(--grad-primary); color: white; }
.avatar-violet   { background: linear-gradient(135deg, var(--violet), var(--purple)); color: white; }
.avatar-emerald  { background: linear-gradient(135deg, var(--emerald), var(--cyan)); color: white; }

/* ── ─────────────────────────────────────────────────────────
   PROGRESS / STEPS
   ───────────────────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  overflow: hidden;
}

.step-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--bg-3);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--t-base);
}

.step-item.active .step-number {
  background: var(--accent-500);
  border-color: var(--accent-500);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.2);
  color: white;
}

.step-item.done .step-number {
  background: var(--emerald);
  border-color: var(--emerald);
  color: white;
}

.step-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
}

.step-item.active .step-label { color: var(--text-primary); }
.step-item.done .step-label   { color: var(--text-secondary); }

.step-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.step-item.done + .step-line { background: var(--emerald); }

/* ── ─────────────────────────────────────────────────────────
   STAT CARDS
   ───────────────────────────────────────────────────────── */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-6);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
}

.stat-delta {
  font-size: var(--text-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.stat-delta.up   { color: var(--emerald); }
.stat-delta.down { color: var(--rose); }

/* ── ─────────────────────────────────────────────────────────
   TABS
   ───────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--sp-1);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-1);
}

.tab-btn {
  flex: 1;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all var(--t-fast);
  text-align: center;
}

.tab-btn:hover { color: var(--text-secondary); }

.tab-btn.active {
  background: var(--bg-3);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── ─────────────────────────────────────────────────────────
   MODAL
   ───────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 10, 0.8);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  align-items: flex-end;
  justify-content: center;
  padding: var(--sp-4);
  animation: fadeIn var(--t-base) ease;
}

@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-default);
  border-radius: var(--r-2xl);
  padding: var(--sp-6);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--t-spring) ease;
}

@media (min-width: 640px) {
  .modal { animation: scaleIn var(--t-spring) ease; }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  border: none;
  background: var(--bg-3);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

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

/* ── ─────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-4);
  left: var(--sp-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-3);
  pointer-events: none;
}

@media (min-width: 480px) {
  .toast-container { left: auto; right: var(--sp-6); }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-3);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: slideInRight var(--t-spring) ease;
  max-width: min(380px, calc(100vw - var(--sp-8)));
  width: max-content;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-body { flex: 1; }
.toast-title { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.toast-msg   { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }

.toast.success { border-left: 3px solid var(--emerald); }
.toast.error   { border-left: 3px solid var(--rose); }
.toast.warning { border-left: 3px solid var(--amber); }
.toast.info    { border-left: 3px solid var(--accent-500); }

/* ── ─────────────────────────────────────────────────────────
   LOADING STATES
   ───────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease infinite;
  border-radius: var(--r-md);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-500);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,4,10,0.7);
  backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--sp-4);
}

/* ── ─────────────────────────────────────────────────────────
   SIDEBAR LAYOUT
   ───────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: var(--z-nav);
  transform: translateX(-100%);
  transition: transform var(--t-base);
}

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

body.sidebar-open { overflow: hidden; }

@media (min-width: 1024px) {
  .sidebar { position: fixed; transform: translateX(0); }
  body.sidebar-open { overflow: auto; }
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--sp-6) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
}

.sidebar-nav {
  flex: 1;
  padding: var(--sp-4) var(--sp-3);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all var(--t-fast);
  text-decoration: none;
  width: 100%;
  text-align: left;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

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

.nav-item.active {
  background: rgba(99,102,241,0.12);
  color: var(--accent-400);
  border: 1px solid rgba(99,102,241,0.15);
}

.nav-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--sp-3) var(--sp-4) var(--sp-2);
  margin-top: var(--sp-4);
}

.sidebar-footer {
  padding: var(--sp-4) var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: var(--sp-4);
}

@media (min-width: 640px) {
  .main-content { padding: var(--sp-6); }
}

@media (min-width: 1024px) {
  .main-content { margin-left: 260px; padding: var(--sp-8); }
}

.page-header {
  margin-bottom: var(--sp-8);
}

.page-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* ── ─────────────────────────────────────────────────────────
   INTERVIEW / CODING INTERFACE
   ───────────────────────────────────────────────────────── */
.interview-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  min-height: calc(100vh - 80px);
}

@media (min-width: 1024px) {
  .interview-layout { grid-template-columns: 1fr 1fr; }
}

.code-editor {
  background: var(--bg-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.code-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-subtle);
}

.code-dots {
  display: flex;
  gap: var(--sp-2);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dot:nth-child(1) { background: #ff5f57; }
.code-dot:nth-child(2) { background: #febc2e; }
.code-dot:nth-child(3) { background: #28c840; }

.code-area {
  flex: 1;
  padding: var(--sp-4);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  min-height: 400px;
  tab-size: 2;
}

/* AI Interviewer */
.ai-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--r-full);
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.2), var(--shadow-glow);
  position: relative;
}

.ai-avatar::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: var(--r-full);
  border: 2px solid var(--accent-500);
  opacity: 0;
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.ai-avatar.speaking::after { opacity: 1; }

.chat-bubble {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-xl);
  max-width: 85%;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.chat-bubble.ai {
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: var(--r-sm);
  color: var(--text-primary);
  align-self: flex-start;
}

.chat-bubble.user {
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.2);
  border-bottom-right-radius: var(--r-sm);
  color: var(--text-primary);
  align-self: flex-end;
}

/* ── ─────────────────────────────────────────────────────────
   PRICING CARDS
   ───────────────────────────────────────────────────────── */
.pricing-card {
  background: var(--grad-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-2xl);
  padding: var(--sp-8);
  position: relative;
  transition: all var(--t-base);
}

.pricing-card.featured {
  background: linear-gradient(145deg, rgba(99,102,241,0.12) 0%, rgba(139,92,246,0.08) 100%);
  border-color: rgba(99,102,241,0.35);
  box-shadow: var(--shadow-glow);
  transform: scale(1.02);
}

.pricing-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-default);
}

.pricing-card.featured:hover {
  transform: scale(1.02) translateY(-4px);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--grad-primary);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: var(--r-full);
  white-space: nowrap;
}

.pricing-price {
  font-size: var(--text-5xl);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
}

.pricing-period {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 400;
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: var(--sp-6) 0;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.pricing-features li .check {
  width: 18px;
  height: 18px;
  border-radius: var(--r-full);
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── ─────────────────────────────────────────────────────────
   DIVIDERS
   ───────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--sp-6) 0;
}

.divider-gradient {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-default), transparent);
  margin: var(--sp-8) 0;
}

/* ── ─────────────────────────────────────────────────────────
   EMPTY STATE
   ───────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-16) var(--sp-8);
  gap: var(--sp-4);
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--r-2xl);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: var(--sp-2);
}

/* ── ─────────────────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp   { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes scaleIn   { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes ping      { 75%, 100% { transform: scale(1.4); opacity: 0; } }
@keyframes skeleton  { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pulse     { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes float     { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(99,102,241,0.3); }
  50%       { box-shadow: 0 0 40px rgba(99,102,241,0.6), 0 0 80px rgba(99,102,241,0.2); }
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes blink { 50% { border-color: transparent; } }

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* ── ─────────────────────────────────────────────────────────
   MISC UTILITIES
   ───────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* Responsive visibility helpers */
.hide-xs { display: none; }
@media (min-width: 480px) { .hide-xs { display: inline; } }

.hide-mobile { display: none; }
@media (min-width: 640px) { .hide-mobile { display: initial; } }

.hide-desktop { display: initial; }
@media (min-width: 1024px) { .hide-desktop { display: none !important; } }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.w-full { width: 100%; }
.max-w-md { max-width: 480px; }
.max-w-lg { max-width: 600px; }
.max-w-2xl { max-width: 720px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.rounded-full { border-radius: var(--r-full); }
.overflow-hidden { overflow: hidden; }

.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { inset: 0; }

.pointer-events-none { pointer-events: none; }

.opacity-50 { opacity: 0.5; }
.opacity-0  { opacity: 0; }

/* ── ─────────────────────────────────────────────────────────
   GLOW BACKGROUNDS
   ───────────────────────────────────────────────────────── */
.glow-bg {
  position: relative;
}

.glow-bg::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(99,102,241,0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── ─────────────────────────────────────────────────────────
   RESPONSIVE GRID UTILITIES
   ───────────────────────────────────────────────────────── */

/* 2-col → 1-col at 640px */
.r2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
}
@media (max-width: 639px) {
  .r2 { grid-template-columns: 1fr; }
}

/* 2-col form grid → 1-col at 480px */
.r2-sm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
@media (max-width: 479px) {
  .r2-sm { grid-template-columns: 1fr; }
}

/* 3-col → 1-col at 640px */
.r3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
@media (max-width: 639px) {
  .r3 { grid-template-columns: 1fr; }
}

/* 4-col → 2-col at 768px → 1-col at 480px */
.r4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
@media (max-width: 767px) {
  .r4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 479px) {
  .r4 { grid-template-columns: 1fr; }
}

/* 5-col → 2-col at 768px → 1-col at 480px */
.r5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-3);
}
@media (max-width: 767px) {
  .r5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 479px) {
  .r5 { grid-template-columns: 1fr; }
}

/* 2fr 1fr sidebar layout → stacked at 768px */
.r-profile {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--sp-6);
  align-items: start;
}
@media (max-width: 767px) {
  .r-profile { grid-template-columns: 1fr; }
}

/* Stat value size stays readable on mobile */
@media (max-width: 479px) {
  .stat-value { font-size: var(--text-2xl); }
}

/* Noise texture overlay */
.noise::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: var(--z-toast);
  opacity: 0.4;
}
