/*
 * RolePilot Design System - "Intellectual Empathy"
 * Warm Dark + Editorial Tech + Digital Paper
 *
 * Philosophy: "Calming professionalism"
 * Target: Job seekers under stress need calmness, not aggression
 */

/* ============================================
   1. DESIGN TOKENS (CSS Custom Properties)
   ============================================ */

:root {
  /* === Colors === */
  --color-canvas: #0f1115;
  /* Warm charcoal (not pure black) */
  --color-surface: #1c1f26;
  /* Card backgrounds */
  --color-surface-highlight: #2a2e37;
  /* Hover states */
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 255, 255, 0.15);

  /* Brand Colors */
  --color-text-primary: #f3f4f6;
  --color-text-secondary: #9ca3af;
  /* Muted gray */
  --color-accent: #ff8fab;
  /* Warm Coral (humanity, warmth) */
  --color-tech: #4cc9f0;
  /* Calm Blue (technology, intelligence) */
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;

  /* Status Colors (used across multiple page components) */
  --color-status-amber: #fbbf24;
  /* Saved/pending states, warnings, badges */
  --color-status-green: #4ade80;
  /* Active/online/success indicators */
  --color-status-blue: #60a5fa;
  /* Info, links, interview states */

  /* Extended Accent Palette */
  --color-accent-indigo: #6366f1;
  /* Primary indigo - gradients, buttons */
  --color-accent-light: #818cf8;
  /* Light indigo - active links, highlights */
  --color-accent-purple: #a78bfa;
  /* Purple - beta badges, decorative */
  --color-text-muted: #6b7280;
  /* Muted text - admin, placeholders */
  --color-text-tertiary: rgba(255, 255, 255, 0.4);
  /* Tertiary text - hints, descriptions, meta */

  /* Semantic Aliases (referenced in page CSS) */
  --color-primary: #6366f1;
  /* Alias for accent-indigo - buttons, borders */
  --color-secondary: #a78bfa;
  /* Alias for accent-purple - gradients, decorative */
  --color-bg: var(--color-canvas);
  /* Alias for canvas - modal backgrounds */
  --color-background: var(--color-canvas);
  /* Alias for canvas - section backgrounds */
  --color-glass-fill: rgba(28, 31, 38, 0.4);
  /* Glass morphism fill - dropdowns, cards */
  --color-tech-hover: #3db8e0;
  /* Tech color hover state - darker variant */

  /* === Typography === */
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Font Sizes (Mobile-first) */
  --text-xs: 0.75rem;
  /* 12px */
  --text-sm: 0.875rem;
  /* 14px */
  --text-base: 1rem;
  /* 16px */
  --text-lg: 1.125rem;
  /* 18px */
  --text-xl: 1.25rem;
  /* 20px */
  --text-2xl: 1.5rem;
  /* 24px */
  --text-3xl: 1.875rem;
  /* 30px */
  --text-4xl: 2.25rem;
  /* 36px */
  --text-5xl: 3rem;
  /* 48px */
  --text-6xl: 3.75rem;
  /* 60px */
  --text-7xl: 4.5rem;
  /* 72px */

  /* === Spacing === */
  --space-1: 0.25rem;
  /* 4px */
  --space-2: 0.5rem;
  /* 8px */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.25rem;
  /* 20px */
  --space-6: 1.5rem;
  /* 24px */
  --space-8: 2rem;
  /* 32px */
  --space-10: 2.5rem;
  /* 40px */
  --space-12: 3rem;
  /* 48px */
  --space-16: 4rem;
  /* 64px */
  --space-20: 5rem;
  /* 80px */
  --space-24: 6rem;
  /* 96px */

  /* === Border Radius === */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* === Effects === */
  --glass-bg: rgba(28, 31, 38, 0.4);
  --glass-bg-hover: rgba(28, 31, 38, 0.6);
  --glass-blur: blur(12px);
  --glass-border: 1px solid rgba(255, 255, 255, 0.05);
  --glass-border-hover: 1px solid rgba(255, 255, 255, 0.15);

  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px -5px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px -10px rgba(0, 0, 0, 0.4);
  --shadow-glow-white: 0 0 20px -5px rgba(255, 255, 255, 0.3);
  --shadow-glow-accent: 0 0 30px -5px rgba(255, 143, 171, 0.3);
  --shadow-glow-tech: 0 0 30px -5px rgba(76, 201, 240, 0.3);

  /* === Transitions === */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-slower: 500ms ease;

  /* === Z-Index === */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-tooltip: 60;
}

/* ============================================
   2. BASE STYLES
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-canvas);
  overflow-x: hidden;
}

::-moz-selection {
  background-color: var(--color-tech);
  color: black;
}

::selection {
  background-color: var(--color-tech);
  color: black;
}

/* Custom scrollbar - dark theme consistent */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   ACCESSIBILITY STYLES
   ============================================ */

/* Focus outline for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-tech);
  outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--color-tech);
  color: black;
  font-weight: 600;
  border-radius: var(--radius-md);
  z-index: 9999;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: var(--space-4);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===========================================
   ENHANCED FOCUS STYLES - Keyboard Navigation
   ============================================ */

/* Job cards - keyboard accessible */
.job-card:focus-visible {
  outline: 2px solid var(--color-accent, #ec4899);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.15);
}

/* Kanban columns - highlight on child focus */
.kanban-column:focus-within {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--color-tech, #4cc9f0);
}

/* Tabs */
.studio-tab:focus-visible,
.demo__mode:focus-visible {
  outline: 2px solid var(--color-tech, #4cc9f0);
  outline-offset: -2px;
}

/* Buttons - enhanced focus ring */
button:focus-visible,
.btn:focus-visible,
.rp-btn:focus-visible {
  outline: 2px solid var(--color-tech, #4cc9f0);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(76, 201, 240, 0.15);
}

/* Links */
a:focus-visible {
  outline: 2px solid var(--color-tech, #4cc9f0);
  outline-offset: 2px;
}

/* Form inputs */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-tech, #4cc9f0);
  outline-offset: 0;
  border-color: var(--color-tech, #4cc9f0);
}

/* ============================================
   3. TEXTURE & AMBIENT EFFECTS
   ============================================ */

/* Noise texture for "expensive paper" feel */
.rp-texture {
  position: fixed;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
  background-image: url('../images/assets/patterns/rp-pattern-noise.webp');
  background-size: 512px 512px;
  background-repeat: repeat;
}

/* Ambient glow spots */
.rp-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.rp-glow--primary {
  width: 600px;
  height: 600px;
  background: rgba(99, 102, 241, 0.1);
  opacity: 0.4;
}

.rp-glow--accent {
  width: 400px;
  height: 400px;
  background: rgba(255, 143, 171, 0.08);
  opacity: 0.5;
}

.rp-glow--tech {
  width: 500px;
  height: 500px;
  background: rgba(76, 201, 240, 0.08);
  opacity: 0.4;
}

/* Pulsing animation for glows */
@keyframes pulse-soft {

  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.5;
  }
}

.rp-glow--animated {
  animation: pulse-soft 6s ease-in-out infinite;
}

/* ============================================
   4. TYPOGRAPHY
   ============================================ */

/* Headings - Instrument Serif */
.rp-heading {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.rp-heading--xl {
  font-size: var(--text-4xl);
}

.rp-heading--lg {
  font-size: var(--text-3xl);
}

.rp-heading--md {
  font-size: var(--text-2xl);
}

.rp-heading--sm {
  font-size: var(--text-xl);
}

/* Responsive headings */
@media (min-width: 768px) {
  .rp-heading--xl {
    font-size: var(--text-5xl);
  }

  .rp-heading--lg {
    font-size: var(--text-4xl);
  }
}

@media (min-width: 1024px) {
  .rp-heading--xl {
    font-size: var(--text-7xl);
  }

  .rp-heading--lg {
    font-size: var(--text-5xl);
  }
}

/* Gradient text effect */
.rp-text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Body text */
.rp-text {
  font-family: var(--font-sans);
  color: var(--color-text-secondary);
}

.rp-text--lg {
  font-size: var(--text-lg);
  line-height: 1.7;
}

.rp-text--sm {
  font-size: var(--text-sm);
}

.rp-text--xs {
  font-size: var(--text-xs);
}

.rp-text--muted {
  color: var(--color-text-secondary);
}

.rp-text--white {
  color: var(--color-text-primary);
}

/* ============================================
   5. GLASS CARDS (Glassmorphism 2.0)
   ============================================ */

.rp-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-slow);
}

.rp-card:hover {
  background: var(--glass-bg-hover);
  border: var(--glass-border-hover);
  transform: translateY(-2px);
}

.rp-card--static {
  transition: none;
}

.rp-card--static:hover {
  transform: none;
}

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

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

.rp-card--lg {
  padding: var(--space-8);
}

/* ============================================
   6. BUTTONS
   ============================================ */

.rp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
}

/* Primary - White on dark */
.rp-btn--primary {
  background: white;
  color: var(--color-canvas);
  box-shadow: var(--shadow-glow-white);
}

.rp-btn--primary:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
  box-shadow: 0 0 25px -5px rgba(255, 255, 255, 0.4);
}

/* Secondary - Ghost */
.rp-btn--secondary {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.rp-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--color-border-hover);
}

/* Accent - Coral */
.rp-btn--accent {
  background: var(--color-accent);
  color: white;
  box-shadow: var(--shadow-glow-accent);
}

.rp-btn--accent:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Tech - Blue */
.rp-btn--tech {
  background: var(--color-tech);
  color: var(--color-canvas);
  box-shadow: var(--shadow-glow-tech);
}

.rp-btn--tech:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Ghost - Transparent with light text */
.rp-btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: none;
}

.rp-btn--ghost:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Outline - Bordered with light text */
.rp-btn--outline {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.rp-btn--outline:hover {
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
  background: rgba(255, 255, 255, 0.05);
}

/* Button sizes */
.rp-btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.rp-btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

/* Full width on mobile */
@media (max-width: 640px) {
  .rp-btn--mobile-full {
    width: 100%;
  }

  /* WCAG 2.1 AA: touch targets >= 44x44px */
  .rp-btn--sm {
    padding: var(--space-3) var(--space-4);
    min-height: 44px;
  }
}

/* ============================================
   7. NAVIGATION
   ============================================ */

.rp-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.rp-nav-item:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.rp-nav-item.active,
.rp-nav-item--active {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.rp-nav-item__icon {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

/* ============================================
   8. FORMS
   ============================================ */

.rp-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  outline: none;
}

.rp-input:focus {
  border-color: var(--color-tech);
  box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.1);
}

.rp-input::-moz-placeholder {
  color: var(--color-text-secondary);
  opacity: 0.6;
}

.rp-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.6;
}

.rp-input--error {
  border-color: var(--color-error);
}

.rp-input--error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

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

.rp-label--block {
  display: block;
}

.rp-label--lg {
  font-size: var(--text-base);
  margin-bottom: var(--space-3);
}

.rp-hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
  line-height: 1.4;
}

.rp-textarea--tall {
  min-height: 150px;
}

.form-group__input-spacing {
  margin-bottom: var(--space-2);
}

.pdf-preview-frame {
  width: 100%;
  height: 60vh;
  min-height: 400px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
}

.rp-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  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='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* ============================================
   9. STATUS BADGES
   ============================================ */

.rp-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
}

.rp-badge--saved {
  background: rgba(156, 163, 175, 0.15);
  color: var(--color-text-secondary);
}

.rp-badge--applied {
  background: rgba(76, 201, 240, 0.15);
  color: var(--color-tech);
}

.rp-badge--interview {
  background: rgba(255, 143, 171, 0.15);
  color: var(--color-accent);
}

.rp-badge--offer {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

.rp-badge--rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
}

/* ============================================
   10. LAYOUT UTILITIES
   ============================================ */

.rp-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 768px) {
  .rp-container {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1024px) {
  .rp-container {
    padding: 0 var(--space-8);
  }
}

.rp-section {
  padding: var(--space-16) 0;
}

@media (min-width: 768px) {
  .rp-section {
    padding: var(--space-24) 0;
  }
}

/* Flexbox */
.rp-flex {
  display: flex;
}

.rp-flex--center {
  align-items: center;
  justify-content: center;
}

.rp-flex--between {
  justify-content: space-between;
}

.rp-flex--col {
  flex-direction: column;
}

.rp-flex--gap-sm {
  gap: var(--space-2);
}

.rp-flex--gap-md {
  gap: var(--space-4);
}

.rp-flex--gap-lg {
  gap: var(--space-6);
}

/* Grid */
.rp-grid {
  display: grid;
  gap: var(--space-4);
}

.rp-grid--2 {
  grid-template-columns: 1fr;
}

.rp-grid--3 {
  grid-template-columns: 1fr;
}

.rp-grid--4 {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .rp-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .rp-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (min-width: 1024px) {
  .rp-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

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

/* ============================================
   11. SIDEBAR LAYOUT
   ============================================ */

.rp-layout {
  display: flex;
  min-height: 100vh;
}

.rp-sidebar {
  width: 100%;
  max-width: 260px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  background: rgba(15, 17, 21, 0.5);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--color-border);
  z-index: var(--z-fixed);
  transform: translateX(-100%);
  transition: transform var(--transition-slow);
}

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

@media (min-width: 1024px) {
  .rp-sidebar {
    position: sticky;
    transform: translateX(0);
  }
}

.rp-sidebar__logo {
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-3);
}

.rp-sidebar__nav {
  flex: 1;
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.rp-sidebar__footer {
  padding: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.rp-main {
  flex: 1;
  min-height: 100vh;
  overflow-y: auto;
  position: relative;
  z-index: var(--z-base);
}

@media (min-width: 1024px) {
  .rp-main {
    margin-left: 0;
  }
}

/* ============================================
   12. MOBILE NAVIGATION
   ============================================ */

.rp-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--space-4);
  background: var(--color-canvas);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

@media (min-width: 1024px) {
  .rp-mobile-header {
    display: none;
  }
}

.rp-mobile-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
}

.rp-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-fixed) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.rp-mobile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   13. ANIMATIONS
   ============================================ */

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.rp-animate-float {
  animation: float 6s ease-in-out infinite;
}

.rp-animate-float-delayed {
  animation: float 6s ease-in-out 3s infinite;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.rp-animate-fade-in {
  animation: fade-in 0.5s ease-out forwards;
}

/* Staggered animations */
.rp-stagger>*:nth-child(1) {
  animation-delay: 0ms;
}

.rp-stagger>*:nth-child(2) {
  animation-delay: 100ms;
}

.rp-stagger>*:nth-child(3) {
  animation-delay: 200ms;
}

.rp-stagger>*:nth-child(4) {
  animation-delay: 300ms;
}

.rp-stagger>*:nth-child(5) {
  animation-delay: 400ms;
}

/* ============================================
   14. EMPTY STATES
   ============================================ */

.rp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-4);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-2xl);
  background: rgba(28, 31, 38, 0.3);
}

.rp-empty__icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(76, 201, 240, 0.1);
  color: var(--color-tech);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-glow-tech);
}

.rp-empty__title {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.rp-empty__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  max-width: 320px;
  margin-bottom: var(--space-8);
}

/* ============================================
   15. STAT CARDS
   ============================================ */

.rp-stat {
  position: relative;
}

.rp-stat__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-4);
}

.rp-stat__label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.rp-stat__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
  opacity: 0.5;
  transition: opacity var(--transition-base);
}

.rp-card:hover .rp-stat__icon {
  opacity: 1;
}

.rp-stat__icon--tech {
  color: var(--color-tech);
}

.rp-stat__icon--accent {
  color: var(--color-accent);
}

.rp-stat__value {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  color: var(--color-text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.rp-stat__subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

/* ============================================
   16. RESPONSIVE HELPERS
   ============================================ */

.rp-hide-mobile {
  display: none;
}

@media (min-width: 768px) {
  .rp-hide-mobile {
    display: block;
  }

  .rp-hide-desktop {
    display: none;
  }
}

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

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

@media (min-width: 768px) {
  .rp-text-center-mobile {
    text-align: left;
  }
}

/* ============================================
   17. MODALS
   ============================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   18. TOAST NOTIFICATIONS
   ============================================ */

.rp-toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  animation: toastSlide 0.3s ease;
}

@keyframes toastSlide {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.rp-toast--error {
  border-color: var(--color-error);
  background: rgba(239, 68, 68, 0.1);
}

.rp-toast--success {
  border-color: var(--color-success);
  background: rgba(34, 197, 94, 0.1);
}

.rp-toast button {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: var(--text-lg);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.rp-toast button:hover {
  color: var(--color-text-primary);
}

/* ============================================
   16. HELP WIDGET - Contextual "?" FAB
   ============================================ */

/* FAB Button */
.rp-help-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-base);
}

.rp-help-fab:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    var(--shadow-glow-tech);
}

.rp-help-fab--active {
  background: var(--color-tech);
  color: var(--color-canvas);
  border-color: var(--color-tech);
}

/* Pulse animation for first 3 views */
@keyframes help-pulse {

  0%,
  100% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }

  50% {
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.4),
      0 0 0 8px rgba(76, 201, 240, 0.15);
  }
}

.rp-help-fab--pulse {
  animation: help-pulse 2.5s ease-in-out infinite;
}

/* Popup Panel */
.rp-help-popup {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 340px;
  max-height: 70vh;
  background: rgba(15, 17, 21, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-2xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  z-index: 9001;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.rp-help-popup--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Popup Header */
.rp-help-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-help-popup__title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  letter-spacing: 0.02em;
}

.rp-help-popup__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 18px;
  transition: all var(--transition-fast);
}

.rp-help-popup__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-primary);
}

/* Popup Body */
.rp-help-popup__body {
  padding: 8px;
  overflow-y: auto;
  max-height: calc(70vh - 56px);
}

/* Section items */
.rp-help-section {
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast);
}

.rp-help-section__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
  border-radius: var(--radius-lg);
  text-align: left;
  transition: background var(--transition-fast);
}

.rp-help-section__toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.rp-help-section__icon {
  font-size: 16px;
  flex-shrink: 0;
}

.rp-help-chevron {
  margin-left: auto;
  opacity: 0.4;
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.rp-help-section__toggle--open .rp-help-chevron {
  transform: rotate(180deg);
}

/* Section body */
.rp-help-section__body {
  padding: 0 12px 12px;
}

.rp-help-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* FAQ items */
.rp-help-faq-item {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.rp-help-faq-item:first-child {
  border-top: none;
}

.rp-help-faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  text-align: left;
  transition: color var(--transition-fast);
}

.rp-help-faq-q:hover {
  color: var(--color-tech);
}

.rp-help-faq-q .rp-help-chevron {
  opacity: 0.3;
}

.rp-help-faq-q--open .rp-help-chevron {
  transform: rotate(180deg);
}

.rp-help-faq-a {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  padding: 0 4px 10px;
}

/* Report bug link */
.rp-help-section--link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast);
  text-decoration: none;
}

.rp-help-section--link:hover {
  background: rgba(255, 255, 255, 0.05);
}

.rp-help-external {
  margin-left: auto;
  opacity: 0.3;
  flex-shrink: 0;
}

/* ============================================
   19. COOKIE CONSENT BANNER (minimal pill)
   ============================================ */

.cookie-consent {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: auto;
  z-index: 9998;
  transform: translateY(20px);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s ease;
  pointer-events: none;
}

.cookie-consent--visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cookie-consent__inner {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 14px;
  background: rgba(28, 31, 38, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.cookie-consent__text {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cookie-consent__text svg,
.cookie-consent__text i {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--color-accent);
  opacity: 0.6;
}

.cookie-consent__text a {
  color: var(--color-tech);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.cookie-consent__text a:hover {
  color: #7dd8f5;
  text-decoration: underline;
}

.cookie-consent__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cookie-consent__actions .rp-btn {
  font-size: 11px;
  padding: 4px 10px;
  min-height: auto;
  line-height: 1.3;
}

/* Mobile: still compact, full-width pill */
@media (max-width: 640px) {
  .cookie-consent {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .cookie-consent__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    border-radius: var(--radius-xl);
    padding: 12px 16px;
  }

  .cookie-consent__text {
    white-space: normal;
    font-size: 12px;
    line-height: 1.5;
  }

  .cookie-consent__actions {
    align-self: flex-end;
    gap: 6px;
  }

  .cookie-consent__actions .rp-btn {
    font-size: 12px;
    padding: 6px 14px;
  }
}

/* ============================================
   SKELETON LOADING SCREEN
   ============================================ */

@keyframes rp-shimmer {
  0% {
    background-position: -400px 0;
  }

  100% {
    background-position: 400px 0;
  }
}

.rp-skeleton {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  animation: fadeIn 0.2s ease;
}

.rp-skeleton__line {
  height: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg,
      var(--color-surface) 25%,
      var(--color-surface-highlight) 50%,
      var(--color-surface) 75%);
  background-size: 800px 100%;
  animation: rp-shimmer 1.8s ease-in-out infinite;
}

.rp-skeleton__line--title {
  height: 20px;
  width: 55%;
  margin-bottom: var(--space-2);
}

.rp-skeleton__line--short {
  width: 40%;
}

.rp-skeleton__line--medium {
  width: 70%;
}

.rp-skeleton__line--long {
  width: 90%;
}

.rp-skeleton__line--full {
  width: 100%;
}

.rp-skeleton__block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.rp-skeleton__divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-2) 0;
}

/* Generating tips */
.gen-tips {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: rgba(76, 201, 240, 0.06);
  border: 1px solid rgba(76, 201, 240, 0.1);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  animation: fadeIn 0.5s ease;
  min-height: 40px;
}

.gen-tips__icon {
  flex-shrink: 0;
  color: var(--color-tech);
  opacity: 0.7;
}

.gen-tips__text {
  transition: opacity 0.3s ease;
}

/* Spinner (global reusable) */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

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

/* Gen progress bar */
.gen-progress {
  margin-bottom: var(--space-3);
}

.gen-progress__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.gen-progress__label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.gen-progress__step {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.gen-progress__track {
  width: 100%;
  height: 4px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.gen-progress__bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-tech), var(--color-accent));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {

  /* Reset dark theme for print */
  :root {
    --color-canvas: #ffffff;
    --color-surface: #ffffff;
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #4a4a4a;
    --color-border: #e0e0e0;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
  }

  /* Hide non-essential UI */
  .rp-texture,
  .rp-glow,
  .sidebar,
  .rp-sidebar,
  .top-nav,
  .cookie-consent,
  .help-widget,
  .toast-container,
  .save-indicator,
  .powered-by,
  .rp-btn,
  .send-btn,
  .hire-btn,
  .lang-switcher,
  .suggestions,
  .input-area,
  footer,
  nav,
  .plan-badge,
  .notify-banner,
  .usage-meter,
  .rejection-shield {
    display: none !important;
  }

  /* Cards → flat white */
  .rp-card {
    background: white !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  /* No transforms or animations */
  * {
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  /* Full width content */
  main,
  .main-content,
  .main__content {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Links show URL */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  /* Page breaks */
  h1,
  h2,
  h3 {
    page-break-after: avoid;
  }

  .rp-card,
  .app-card,
  .job-card {
    page-break-inside: avoid;
  }
}