/* ============================================================================
   ZETALAB Terminal UI - Enhanced CLI-Inspired Design System
   Advanced animations, micro-interactions & polished aesthetics
   ============================================================================ */

:root {
  /* Core Terminal Colors - Original Green Theme */
  --bg-primary: #0e1b17;
  --bg-secondary: #13251f;
  --bg-tertiary: #1a2f26;
  --bg-hover: #1f3e32;
  
  --text-primary: #e8efe9;
  --text-secondary: #b9c7bf;
  --text-accent: #4f9a65;
  --text-success: #10b981;
  --text-error: #ef4444;
  --text-warning: #f59e0b;
  
  --border-primary: #385f4d;
  --border-secondary: rgba(79,154,101,.15);
  --border-focus: #4f9a65;
  
  /* Terminal Enhancement Colors - Extended Green Spectrum */
  --terminal-green: #4f9a65;
  --terminal-emerald: #10b981;
  --terminal-sage: #9ca3af;
  --terminal-forest: #064e3b;
  --terminal-mint: #6ee7b7;
  --terminal-jade: #34d399;
  --terminal-lime: #84cc16;
  
  /* Enhanced UI Colors */
  --gradient-primary: linear-gradient(135deg, var(--terminal-green), var(--terminal-emerald));
  --gradient-secondary: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
  --gradient-accent: linear-gradient(90deg, var(--terminal-emerald), var(--terminal-jade), var(--terminal-mint));
  
  /* Rainbow RGB Gradients for Separators */
  --rainbow-separator: linear-gradient(90deg, 
    transparent 0%, 
    #ff0080 8%, 
    #ff8000 16%, 
    #ffff00 24%, 
    #80ff00 32%, 
    #00ff80 40%, 
    #00ffff 48%, 
    #0080ff 56%, 
    #8000ff 64%, 
    #ff0080 72%, 
    #ff8000 80%, 
    #ffff00 88%, 
    transparent 100%
  );
  --rainbow-glow: linear-gradient(90deg, 
    rgba(255, 0, 128, 0.3) 8%, 
    rgba(255, 128, 0, 0.3) 16%, 
    rgba(255, 255, 0, 0.3) 24%, 
    rgba(128, 255, 0, 0.3) 32%, 
    rgba(0, 255, 128, 0.3) 40%, 
    rgba(0, 255, 255, 0.3) 48%, 
    rgba(0, 128, 255, 0.3) 56%, 
    rgba(128, 0, 255, 0.3) 64%, 
    rgba(255, 0, 128, 0.3) 72%
  );
  
  /* Interactive States */
  --state-hover: rgba(79, 154, 101, 0.15);
  --state-active: rgba(79, 154, 101, 0.25);
  --state-focus: rgba(79, 154, 101, 0.4);
  --state-disabled: rgba(185, 199, 191, 0.3);
  
  /* Enhanced Spacing System */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;
  --space-4xl: 64px;
  
  /* Border Radius Scale */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;
  
  /* Animation Easing */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* Animation Durations */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;
  --duration-slower: 500ms;
  
  /* Enhanced Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.85rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  
  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  
  /* Enhanced Shadow System */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.15);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.25), 0 0 4px rgba(79,154,101,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.3), 0 0 8px rgba(79,154,101,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.4), 0 0 15px rgba(79,154,101,.1);
  --shadow-xl: 0 20px 50px rgba(0,0,0,.5), 0 0 25px rgba(79,154,101,.15);
  --shadow-glow: 0 0 0 2px rgba(79, 154, 101, 0.4);
  --shadow-glow-lg: 0 0 0 4px rgba(79, 154, 101, 0.3), 0 0 20px rgba(79, 154, 101, 0.2);
  
  /* Interactive Shadows */
  --shadow-hover: 0 8px 25px rgba(0,0,0,.35), 0 0 20px rgba(79,154,101,.12);
  --shadow-active: 0 2px 10px rgba(0,0,0,.4), 0 0 10px rgba(79,154,101,.15);
  --shadow-focus: 0 0 0 3px rgba(79, 154, 101, 0.4), 0 4px 12px rgba(0,0,0,.3);
  
  /* Gradient Shadows */
  --shadow-gradient: 0 8px 32px rgba(79, 154, 101, 0.15), 0 4px 16px rgba(0,0,0,.2);
  
  /* Alias para compatibilidad con modal antiguo */
  --panel: var(--bg-secondary);
  --panel2: var(--bg-tertiary);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --accent: var(--terminal-green);
  --border: var(--border-primary);
}

/* ============================================================================
   Base Styles & Reset
   ============================================================================ */

* { 
  box-sizing: border-box; 
}

html, body { 
  height: 100%; 
  margin: 0;
}

body {
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(79, 154, 101, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at top, #0a1810 0%, var(--bg-primary) 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--font-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  scroll-behavior: smooth;
  
  /* Mobile optimizations */
  -webkit-text-size-adjust: 100%; /* Prevent font scaling on iOS */
  -ms-text-size-adjust: 100%; /* Prevent font scaling on Windows Mobile */
  text-size-adjust: 100%; /* Prevent font scaling */
  
  /* Mobile: Fixed background can cause performance issues */
  @media (max-width: 767px) {
    background-attachment: scroll;
    /* Simplified background for mobile performance */
    background: 
      radial-gradient(ellipse at center, rgba(79, 154, 101, 0.06) 0%, transparent 60%),
      linear-gradient(180deg, #0a1810 0%, var(--bg-primary) 100%);
  }
}

/* ============================================================================
   Layout System - Mobile First Responsive Design
   ============================================================================ */

.container { 
  max-width: 1200px; 
  margin: var(--space-lg) auto; 
  padding: var(--space-md);
  position: relative;
  z-index: 1;
  
  /* Mobile viewport optimization */
  width: 100%;
  min-width: 0;
  
  /* Desktop enhancement */
  @media (min-width: 768px) {
    margin: var(--space-xl) auto;
    padding: var(--space-lg);
  }
}

.row { 
  display: flex; 
  flex-direction: column; /* Mobile first: stack vertically */
  gap: var(--space-md);
  align-items: stretch;
  transition: gap var(--duration-normal) var(--ease-out);
  
  /* Tablet and up: horizontal layout */
  @media (min-width: 768px) {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.col { 
  flex: 1;
  min-width: 0; /* Mobile: allow shrinking */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  
  /* Tablet and up: minimum width */
  @media (min-width: 768px) {
    flex: 1 1 280px; 
    min-width: 280px;
  }
}

/* ============================================================================
   Enhanced Terminal Header System
   ============================================================================ */

.enhanced-header {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  gap: var(--space-md); 
  padding: var(--space-md) var(--space-lg); 
  border-bottom: 1px solid var(--border-primary); 
  position: sticky; 
  top: 0; 
  background: 
    linear-gradient(180deg, var(--bg-primary) 0%, rgba(10, 10, 10, 0.95) 100%),
    linear-gradient(90deg, transparent, rgba(79, 154, 101, 0.02), transparent); 
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  z-index: 100;
  transition: all var(--duration-slow) var(--ease-out);
  animation: headerSlideDown 0.8s var(--ease-bounce);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-md);
  min-height: 64px; /* Mobile optimized height */
  flex-wrap: wrap;
  
  /* Desktop enhancement */
  @media (min-width: 768px) {
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-2xl);
    min-height: 80px;
    flex-wrap: nowrap;
  }
}

.header-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  align-items: flex-start;
}

.brand-pill {
  background: var(--gradient-primary);
  color: white;
  padding: var(--space-sm) var(--space-lg);
  font-weight: var(--font-bold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: var(--shadow-gradient);
}

.brand-logo {
  height: 32px;
  width: 32px;
  border-radius: var(--radius-sm);
  filter: brightness(1.1) contrast(1.05) drop-shadow(0 2px 8px rgba(0,0,0,0.3));
  transition: all var(--duration-slow) var(--ease-bounce);
  margin-right: var(--space-sm);
}

.brand-logo:hover {
  transform: scale(1.15) rotate(5deg) translateY(-2px);
  filter: brightness(1.3) contrast(1.1) drop-shadow(0 4px 16px rgba(79, 154, 101, 0.6));
  border-radius: var(--radius-md);
}

.brand-title {
  font-size: var(--text-lg);
  letter-spacing: 0.025em;
}

.header-subtitle {
  font-size: var(--text-sm);
  margin-left: var(--space-md);
  opacity: 0.8;
  font-style: italic;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  
  /* Mobile: Hide text for compact view */
  @media (max-width: 480px) {
    gap: var(--space-xs);
  }
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--terminal-green);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  font-size: var(--text-lg);
  
  @media (min-width: 768px) {
    display: none;
  }
}

.mobile-nav-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--terminal-green);
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

.mobile-nav-toggle.active {
  background: var(--terminal-green);
  color: var(--bg-primary);
  transform: rotate(90deg);
}

/* Mobile Actions Collapsible */
.header-actions.mobile-collapsed {
  @media (max-width: 767px) {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    padding: var(--space-lg);
    flex-direction: column;
    gap: var(--space-md);
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    animation: mobileMenuSlideDown 0.3s var(--ease-out);
  }
}

.header-actions.mobile-expanded {
  @media (max-width: 767px) {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    padding: var(--space-lg);
    flex-direction: column;
    gap: var(--space-md);
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    animation: mobileMenuSlideDown 0.3s var(--ease-out);
  }
}

@keyframes mobileMenuSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.enhanced-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--rainbow-separator);
  background-size: 200% 100%;
  opacity: 0.6;
  animation: headerGlow 4s ease-in-out infinite, rainbowShift 6s linear infinite;
  will-change: background-position;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.enhanced-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--terminal-mint) 30%, var(--terminal-emerald) 50%, var(--terminal-jade) 70%, transparent 90%);
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out);
}

.enhanced-header:hover::after {
  opacity: 1;
}

.enhanced-header img {
  height: 24px; 
  width: 24px; 
  border-radius: var(--radius-sm);
  transition: all var(--duration-slow) var(--ease-bounce);
  filter: brightness(1.1) contrast(1.05);
}

.enhanced-header img:hover {
  transform: scale(1.2) rotate(8deg) translateY(-2px);
  filter: brightness(1.3) contrast(1.1) drop-shadow(0 0 12px rgba(79, 154, 101, 0.6));
  border-radius: var(--radius-md);
}

@keyframes headerSlideDown {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  60% {
    transform: translateY(5px);
    opacity: 0.8;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes headerGlow {
  0%, 100% {
    opacity: 0.8;
    filter: brightness(1) blur(0px);
    transform: scaleY(1);
  }
  33% {
    opacity: 1;
    filter: brightness(1.4) blur(0.5px);
    transform: scaleY(1.2);
  }
  66% {
    opacity: 0.9;
    filter: brightness(1.2) blur(0px);
    transform: scaleY(1.1);
  }
}

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

/* ============================================================================
   Terminal Card System
   ============================================================================ */

.card {
  background: 
    var(--gradient-secondary),
    radial-gradient(circle at top right, rgba(79, 154, 101, 0.03) 0%, transparent 60%); 
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg); /* Mobile: Smaller radius for better edge tapping */
  padding: var(--space-lg); /* Mobile: Reduced padding */
  box-shadow: 
    var(--shadow-lg), 
    inset 0 1px 0 rgba(255,255,255,.05),
    inset 0 0 1px rgba(79, 154, 101, 0.1);
  position: relative;
  overflow: hidden;
  transition: all var(--duration-slower) var(--ease-out);
  animation: cardSlideUp 0.6s var(--ease-bounce) both;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  
  /* Mobile: Remove margins and optimize spacing */
  margin-bottom: var(--space-md);
  
  /* Desktop enhancement */
  @media (min-width: 768px) {
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: 0;
  }
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0.9;
  transition: all var(--duration-slow) var(--ease-out);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background-size: 200% 100%;
  animation: gradientShift 6s linear infinite;
}

.card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(79, 154, 101, 0.03) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 
    var(--shadow-xl), 
    var(--shadow-glow-lg),
    0 0 40px rgba(79, 154, 101, 0.2),
    0 25px 50px rgba(0, 0, 0, 0.35);
  border-color: rgba(79, 154, 101, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.card:hover::before {
  opacity: 1;
  height: 4px;
  background: var(--gradient-accent);
  filter: brightness(1.3) saturate(1.2);
  box-shadow: 0 0 8px rgba(79, 154, 101, 0.4);
}

.card:hover::after {
  opacity: 1;
}

.card h2 {
  margin: 0 0 var(--space-lg) 0;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card h2::before {
  content: '❯';
  background: var(--rainbow-separator);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--terminal-green); /* Fallback for older browsers */
  font-weight: bold;
  text-shadow: 0 0 8px rgba(255, 128, 0, 0.4);
  animation: rainbowText 4s linear infinite;
  display: inline-block;
  margin-right: var(--space-sm);
}

@keyframes rainbowText {
  0% { 
    filter: hue-rotate(0deg) brightness(1.2) saturate(1.2); 
    text-shadow: 0 0 8px rgba(255, 128, 0, 0.4);
  }
  25% { 
    filter: hue-rotate(90deg) brightness(1.4) saturate(1.4); 
    text-shadow: 0 0 8px rgba(0, 255, 128, 0.4);
  }
  50% { 
    filter: hue-rotate(180deg) brightness(1.2) saturate(1.2); 
    text-shadow: 0 0 8px rgba(0, 128, 255, 0.4);
  }
  75% { 
    filter: hue-rotate(270deg) brightness(1.4) saturate(1.4); 
    text-shadow: 0 0 8px rgba(128, 0, 255, 0.4);
  }
  100% { 
    filter: hue-rotate(360deg) brightness(1.2) saturate(1.2); 
    text-shadow: 0 0 8px rgba(255, 128, 0, 0.4);
  }
}

/* ============================================================================
   Terminal Form Elements
   ============================================================================ */

label {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: var(--space-sm) 0 var(--space-xs);
  font-weight: 500;
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
}

label::before {
  content: '▸';
  color: var(--terminal-green);
  margin-right: var(--space-xs);
  font-size: var(--text-xs);
  text-shadow: 0 0 3px rgba(79, 154, 101, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

label:hover {
  color: var(--text-primary);
  transform: translateX(2px);
}

label:hover::before {
  color: var(--terminal-emerald);
  text-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  transform: translateX(2px) scale(1.1);
}

/* Label focus state (when associated input is focused) */
label:focus-within {
  color: var(--text-accent);
}

label:focus-within::before {
  color: var(--terminal-emerald);
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  animation: labelPulse 1s ease-in-out infinite;
}

@keyframes labelPulse {
  0%, 100% {
    transform: translateX(2px) scale(1.1);
  }
  50% {
    transform: translateX(2px) scale(1.2);
  }
}

input[type="text"], 
input[type="number"], 
input[type="email"],
input[type="password"],
select, 
textarea {
  width: 100%;
  padding: 16px 18px; /* Mobile: Larger touch targets */
  border-radius: var(--radius-lg); /* Mobile: Larger radius for easier touching */
  border: 2px solid var(--border-secondary); /* Mobile: Thicker borders for visibility */
  background: 
    var(--bg-tertiary),
    linear-gradient(145deg, rgba(79, 154, 101, 0.01) 0%, transparent 100%);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-lg); /* Mobile: Larger text for readability */
  font-weight: var(--font-normal);
  outline: none;
  
  /* Mobile optimizations */
  min-height: 48px; /* Touch-friendly minimum height */
  line-height: 1.4;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  
  /* Desktop refinements */
  @media (min-width: 768px) {
    padding: 14px 16px;
    font-size: var(--text-base);
    border-radius: var(--radius-md);
    border-width: 1.5px;
    min-height: auto;
  }
  transition: all var(--duration-slow) var(--ease-out);
  position: relative;
  transform: translateZ(0);
  backdrop-filter: blur(0.5px);
  -webkit-backdrop-filter: blur(0.5px);
  box-shadow: 
    var(--shadow-xs),
    inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--terminal-emerald);
  box-shadow: 
    var(--shadow-focus),
    0 0 0 4px rgba(79, 154, 101, 0.2),
    0 6px 16px rgba(79, 154, 101, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(79, 154, 101, 0.1);
  background: 
    var(--bg-secondary),
    linear-gradient(145deg, rgba(79, 154, 101, 0.03) 0%, transparent 100%);
  transform: translateY(-2px) scale(1.015);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

input:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
  border-color: rgba(79, 154, 101, 0.5);
  background: 
    rgba(26, 47, 38, 0.9),
    linear-gradient(145deg, rgba(79, 154, 101, 0.02) 0%, transparent 100%);
  transform: translateY(-1px) scale(1.005);
  box-shadow: 
    var(--shadow-sm),
    inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
  transition: all var(--duration-normal) var(--ease-out);
  font-style: italic;
}

input:focus::placeholder {
  opacity: 0.3;
  transform: translateX(6px) scale(0.95);
  color: var(--terminal-sage);
}

/* Input validation states */
input:invalid:not(:focus):not(:placeholder-shown) {
  border-color: var(--text-error);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

input:valid:not(:focus):not(:placeholder-shown) {
  border-color: var(--text-success);
}

/* ============================================================================
   Actions Section & Button Groups
   ============================================================================ */

.actions-section {
  position: relative;
}

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

.actions-header h2 {
  margin: 0;
  font-size: var(--text-xl);
  color: var(--text-primary);
}

.actions-note {
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.7;
}

.button-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.primary-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-start;
  flex-wrap: wrap;
}

.secondary-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-start;
  flex-wrap: wrap;
}

.options-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Enhanced Checkbox */
.enhanced-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out);
  user-select: none;
}

.enhanced-checkbox:hover {
  background: rgba(79, 154, 101, 0.05);
  transform: translateY(-1px);
}

.enhanced-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-secondary);
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  position: relative;
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: bold;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--duration-normal) var(--ease-bounce);
}

.enhanced-checkbox input:checked + .checkbox-custom {
  background: var(--gradient-primary);
  border-color: var(--terminal-emerald);
  box-shadow: 0 0 8px rgba(79, 154, 101, 0.4);
}

.enhanced-checkbox input:checked + .checkbox-custom::after {
  opacity: 1;
  transform: scale(1);
}

.enhanced-checkbox:hover .checkbox-custom {
  border-color: var(--terminal-green);
  box-shadow: 0 0 5px rgba(79, 154, 101, 0.2);
}

.checkbox-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  transition: color var(--duration-normal) var(--ease-out);
}

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

/* Tooltips */
[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  white-space: nowrap;
  z-index: 1000;
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-md);
  opacity: 0;
  animation: tooltipFadeIn var(--duration-normal) var(--ease-out) forwards;
}

[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  border: 4px solid transparent;
  border-top-color: var(--border-primary);
  z-index: 1000;
  opacity: 0;
  animation: tooltipFadeIn var(--duration-normal) var(--ease-out) forwards;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px) scale(1);
  }
}

/* ============================================================================
   Legacy Terminal Button System (Maintained for compatibility)
   ============================================================================ */

button {
  padding: 16px 20px; /* Mobile: Larger touch targets */
  border-radius: var(--radius-lg); /* Mobile: Larger radius for finger taps */
  border: 2px solid var(--border-primary); /* Mobile: Thicker borders */
  cursor: pointer;
  background: 
    var(--gradient-secondary),
    radial-gradient(circle at center, rgba(79, 154, 101, 0.05) 0%, transparent 70%);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-base); /* Mobile: Larger text */
  font-weight: var(--font-semibold);
  letter-spacing: 0.025em;
  transition: all var(--duration-slow) var(--ease-out);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center; /* Mobile: Center content */
  gap: var(--space-sm);
  transform: translateZ(0);
  user-select: none;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  box-shadow: var(--shadow-sm);
  
  /* Mobile optimizations */
  min-height: 48px; /* Touch-friendly minimum height */
  min-width: 48px; /* Touch-friendly minimum width */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  
  /* Desktop refinements */
  @media (min-width: 768px) {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    border-width: 1px;
    font-size: var(--text-sm);
    gap: var(--space-xs);
    min-height: auto;
    min-width: auto;
  }
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg, 
    transparent, 
    rgba(79, 154, 101, 0.4), 
    rgba(255,255,255,.15), 
    rgba(16, 185, 129, 0.4), 
    transparent
  );
  transition: left var(--duration-slower) var(--ease-out);
  pointer-events: none;
  opacity: 0.8;
}

button:hover::before {
  left: 100%;
}

button:hover {
  background: 
    linear-gradient(135deg, var(--bg-hover), var(--bg-tertiary)),
    radial-gradient(circle at center, rgba(79, 154, 101, 0.08) 0%, transparent 70%);
  border-color: var(--terminal-green);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 
    var(--shadow-hover),
    0 0 20px rgba(79, 154, 101, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

button:active {
  transform: translateY(-1px) scale(0.97);
  transition: all var(--duration-fast) var(--ease-in);
  box-shadow: var(--shadow-active);
}

button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 154, 101, 0.4);
}

button.primary {
  border-color: var(--terminal-emerald);
  background: 
    var(--gradient-primary),
    radial-gradient(ellipse at top, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  color: white;
  font-weight: var(--font-bold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 
    var(--shadow-gradient),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  position: relative;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

button.primary::after {
  content: '→';
  margin-left: var(--space-xs);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

button.primary::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), rgba(16, 185, 129, 0.3), rgba(255, 255, 255, 0.4), transparent);
}

button.primary:hover {
  background: 
    linear-gradient(135deg, var(--terminal-jade), var(--terminal-emerald)),
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  box-shadow: 
    var(--shadow-xl),
    0 0 30px rgba(79, 154, 101, 0.7),
    0 12px 32px rgba(79, 154, 101, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  transform: translateY(-4px) scale(1.06);
  border-color: var(--terminal-jade);
  filter: brightness(1.1) contrast(1.05);
}

button.primary:hover::after {
  transform: translateX(4px) scale(1.2);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

button.primary:active {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 
    var(--shadow-active),
    0 0 20px rgba(79, 154, 101, 0.6),
    0 6px 16px rgba(79, 154, 101, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all var(--duration-fast) var(--ease-in);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Button variants */
button[data-mult],
button[data-ml] {
  font-size: var(--text-xs);
  padding: 8px 12px;
  border-color: var(--border-secondary);
  background: var(--bg-primary);
}

button[data-mult]:hover,
button[data-ml]:hover {
  background: var(--terminal-green);
  color: var(--bg-primary);
  border-color: var(--terminal-green);
}

/* ============================================================================
   Terminal UI Components
   ============================================================================ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: 
    var(--gradient-secondary),
    radial-gradient(ellipse at center, rgba(79, 154, 101, 0.04) 0%, transparent 70%);
  border: 1px solid var(--border-secondary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--duration-slow) var(--ease-out);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  user-select: none;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  box-shadow: var(--shadow-xs);
}

.pill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(79, 154, 101, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.pill:hover {
  background: 
    linear-gradient(135deg, var(--bg-hover), var(--bg-tertiary)),
    radial-gradient(ellipse at center, rgba(79, 154, 101, 0.08) 0%, transparent 70%);
  border-color: rgba(79, 154, 101, 0.5);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 
    var(--shadow-hover),
    0 0 20px rgba(79, 154, 101, 0.15);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.pill:hover::before {
  opacity: 1;
}

.pill:active {
  transform: translateY(0) scale(0.98);
  transition: all 0.1s ease;
}

.pill img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.pill:hover img {
  transform: scale(1.1) rotate(2deg);
}

/* Subscription status styles */
.pill.trial {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  color: white;
  border-color: #60a5fa;
}

.pill.monthly {
  background: linear-gradient(135deg, var(--accent), #059669);
  color: white;
  border-color: var(--accent);
}

.pill.premium {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: #8b5cf6;
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
  animation: premium-glow 2s ease-in-out infinite alternate;
}

@keyframes premium-glow {
  0% {
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
  }
  100% {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
  }
}

.pill.trial:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px) scale(1.05);
}

.pill.monthly:hover {
  background: linear-gradient(135deg, #10b981, #047857);
  transform: translateY(-1px) scale(1.05);
}

.pill.premium:hover {
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
  transform: translateY(-1px) scale(1.05);
}

/* Upgrade Premium Button styles removed - button eliminated */

/* Status indicators */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terminal-green);
  display: inline-block;
  margin-right: var(--space-xs);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================================
   Terminal Typography & Content
   ============================================================================ */

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

.accent { 
  color: var(--text-accent); 
}

.mono {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

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

/* Rainbow RGB Dividers - Terminal Style */
.hr {
  height: 2px;
  background: var(--rainbow-separator);
  background-size: 200% 100%;
  margin: var(--space-lg) calc(-1 * var(--space-xl));
  border: none;
  opacity: 0.8;
  position: relative;
  border-radius: var(--radius-full);
  animation: rainbowShift 3s linear infinite;
  overflow: hidden;
  will-change: background-position;
}

.hr::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--rainbow-glow);
  opacity: 0.6;
  filter: blur(4px);
  animation: rainbowPulse 2s ease-in-out infinite alternate;
}

/* Rainbow animation keyframes */
@keyframes rainbowShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes rainbowPulse {
  0% { opacity: 0.4; transform: scaleY(0.8); }
  100% { opacity: 0.8; transform: scaleY(1.2); }
}

/* ============================================================================
   Terminal KPI & Tiles System
   ============================================================================ */

.kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.tile {
  background: 
    var(--gradient-secondary),
    radial-gradient(ellipse at top left, rgba(79, 154, 101, 0.04) 0%, transparent 60%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--duration-slow) var(--ease-out);
  position: relative;
  overflow: hidden;
  animation: tileSlideIn 0.5s var(--ease-bounce) both;
  backdrop-filter: blur(0.5px);
  -webkit-backdrop-filter: blur(0.5px);
  box-shadow: 
    var(--shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-accent);
  opacity: 0.9;
  transition: all var(--duration-slow) var(--ease-out);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background-size: 100% 200%;
  animation: gradientShift 8s linear infinite;
}

.tile::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(45deg, transparent, rgba(79, 154, 101, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tile:hover {
  background: 
    linear-gradient(145deg, var(--bg-hover), var(--bg-tertiary)),
    radial-gradient(ellipse at center, rgba(79, 154, 101, 0.08) 0%, transparent 70%);
  transform: translateY(-4px) scale(1.025);
  box-shadow: 
    var(--shadow-hover),
    0 0 25px rgba(79, 154, 101, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-color: rgba(79, 154, 101, 0.4);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.tile:hover::before {
  width: 8px;
  opacity: 1;
  background: var(--gradient-accent);
  filter: brightness(1.3) saturate(1.2);
  box-shadow: 
    0 0 15px rgba(79, 154, 101, 0.5),
    inset 0 0 3px rgba(255, 255, 255, 0.2);
}

.tile:hover::after {
  opacity: 1;
}

.tile h3 {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.75px;
  font-weight: var(--font-semibold);
  transition: color var(--duration-normal) var(--ease-out);
  position: relative;
}

.tile p {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  transition: all var(--duration-normal) var(--ease-out);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   Terminal Auth Bar - Enhanced
   ============================================================================ */

#auth-bar {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  display: flex;
  gap: var(--space-md);
  align-items: center;
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.95), rgba(19, 37, 31, 0.95));
  color: var(--text-primary);
  padding: var(--space-md) var(--space-lg);
  border-radius: 12px;
  box-shadow: var(--shadow-lg), 0 0 20px rgba(79, 154, 101, 0.1);
  z-index: 9999;
  border: 1px solid rgba(79, 154, 101, 0.2);
  font-size: var(--text-sm);
  backdrop-filter: blur(16px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: authBarSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

#auth-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--terminal-green), var(--terminal-emerald), var(--terminal-green), transparent);
  border-radius: 12px 12px 0 0;
  opacity: 0.8;
}

#auth-bar:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(79, 154, 101, 0.2);
  border-color: rgba(79, 154, 101, 0.4);
}

#auth-email {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
  font-weight: 500;
  opacity: 0.9;
  transition: all 0.2s ease;
  position: relative;
  padding-left: var(--space-lg);
}

#auth-email::before {
  content: '●';
  position: absolute;
  left: 0;
  color: var(--terminal-emerald);
  font-size: 12px;
  animation: authStatusPulse 2s ease-in-out infinite;
  text-shadow: 0 0 5px rgba(16, 185, 129, 0.6);
}

#auth-email:hover {
  opacity: 1;
  color: var(--terminal-green);
}

#logout-btn {
  background: linear-gradient(135deg, var(--bg-hover), var(--bg-tertiary));
  color: var(--text-primary);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-width: 60px;
  text-align: center;
}

#logout-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

#logout-btn:hover::before {
  left: 100%;
}

#logout-btn:hover {
  background: linear-gradient(135deg, var(--text-error), #dc2626);
  color: white;
  border-color: var(--text-error);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

#logout-btn:active {
  transform: translateY(0) scale(0.98);
  transition: all 0.1s ease;
}

/* Auth bar animations */
@keyframes authBarSlideIn {
  0% {
    opacity: 0;
    transform: translateX(100%) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translateX(-10%) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes authStatusPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* ============================================================================
   Terminal Loading States - Enhanced
   ============================================================================ */

.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
  transition: all 0.3s ease;
  filter: blur(0.5px);
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--border-secondary);
  border-top-color: var(--terminal-green);
  border-right-color: var(--terminal-emerald);
  border-radius: 50%;
  animation: advancedSpin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  box-shadow: 0 0 10px rgba(79, 154, 101, 0.3);
}

.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 1px solid transparent;
  border-top-color: rgba(79, 154, 101, 0.2);
  border-radius: 50%;
  animation: advancedSpin 2s linear infinite reverse;
}

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

@keyframes advancedSpin {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
  50% {
    transform: rotate(180deg) scale(1.1);
    opacity: 0.8;
  }
  100% {
    transform: rotate(360deg) scale(1);
    opacity: 1;
  }
}

/* Button loading state */
button.loading {
  cursor: not-allowed;
  overflow: hidden;
}

button.loading::after {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-width: 2px;
}

/* Success state animation */
.success-flash {
  animation: successPulse 0.6s ease-out;
  border-color: var(--terminal-emerald) !important;
}

/* Error state animation */
.error-shake {
  animation: errorShake 0.5s ease-in-out;
  border-color: var(--text-error) !important;
}

@keyframes errorShake {
  0%, 20%, 40%, 60%, 80%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-3px);
  }
}

/* ============================================================================
   Terminal Responsive Design
   ============================================================================ */

/* ============================================================================
   Enhanced Responsive Design
   ============================================================================ */

@media (max-width: 1024px) {
  .enhanced-header {
    padding: var(--space-md) var(--space-xl);
    min-height: 70px;
  }
  
  .header-brand {
    gap: var(--space-xs);
  }
  
  .header-actions {
    gap: var(--space-sm);
  }
  
  .button-groups {
    gap: var(--space-md);
  }
  
  .primary-actions,
  .secondary-actions {
    gap: var(--space-sm);
  }
}

@media (max-width: 900px) {
  .kpi {
    grid-template-columns: 1fr;
  }
  
  .container {
    margin: var(--space-md) auto;
    padding: var(--space-md);
  }
  
  .enhanced-header {
    padding: var(--space-md);
    flex-direction: column;
    gap: var(--space-md);
    align-items: stretch;
    min-height: auto;
  }
  
  .header-brand {
    align-items: center;
    text-align: center;
  }
  
  .header-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .card {
    padding: var(--space-lg);
  }
  
  .col {
    min-width: 100%;
  }
  
  .button-groups {
    gap: var(--space-md);
  }
  
  .primary-actions,
  .secondary-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .primary-actions button,
  .secondary-actions button {
    width: 100%;
    justify-content: center;
  }
  
  /* Auth bar responsive adjustments */
  #auth-bar {
    top: var(--space-sm);
    right: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    flex-direction: column;
    gap: var(--space-sm);
    min-width: 120px;
  }
  
  #auth-email {
    font-size: var(--text-xs);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  #logout-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
  }
}

@media (max-width: 600px) {
  .enhanced-header {
    padding: var(--space-sm) var(--space-md);
  }
  
  .brand-title {
    font-size: var(--text-base);
  }
  
  .header-subtitle {
    font-size: var(--text-xs);
    text-align: center;
    margin-left: 0;
  }
  
  .enhanced-btn .btn-text {
    display: none;
  }
  
  .enhanced-btn .btn-icon {
    font-size: var(--text-xl);
  }
  
  .enhanced-checkbox {
    flex-direction: column;
    gap: var(--space-xs);
    text-align: center;
  }
  
  .actions-header {
    flex-direction: column;
    gap: var(--space-xs);
    align-items: stretch;
    text-align: center;
  }
  
  .card h2 {
    font-size: var(--text-lg);
    text-align: center;
  }
}

/* ============================================================================
   Modal de Suscripción Simplificado
   ============================================================================ */

/* Modal overlay y base - Fixed z-index and backdrop blur conflicts */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 100000; /* Higher z-index to avoid conflicts */
  display: flex;
  align-items: center;
  justify-content: center;
  /* Prevent backdrop blur from affecting modal content */
  will-change: backdrop-filter;
}

.mercadopago-modal {
  background: var(--bg-secondary);
  border: 2px solid var(--border-primary);
  border-radius: 16px;
  padding: 0;
  max-width: 520px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease-out;
  /* Ensure modal content is above backdrop blur */
  position: relative;
  z-index: 100001;
  /* Disable backdrop filter on modal content */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

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

.modal-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--text-xl);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  padding: var(--space-xs);
  line-height: 1;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-xl);
}

/* Plan único display */
.single-plan-display {
  text-align: center;
}

.plan-hero-section {
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl);
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-hover) 100%);
  border-radius: 16px;
  border: 2px solid var(--terminal-green);
  position: relative;
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--terminal-green);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-hero-section h3 {
  margin: 16px 0;
  color: var(--text-primary);
  font-size: var(--text-lg);
}

.price-section {
  margin: 20px 0;
  font-weight: 700;
}

.currency {
  font-size: 1.2em;
  color: var(--terminal-green);
  vertical-align: top;
}

.amount {
  font-size: 3em;
  color: var(--terminal-green);
}

.period {
  font-size: 1em;
  color: var(--text-secondary);
  vertical-align: bottom;
}

.plan-desc {
  color: var(--text-secondary);
  font-size: 1em;
  line-height: 1.5;
  margin: 16px 0 0;
}

/* Features section */
.features-section {
  text-align: left;
  margin-bottom: var(--space-2xl);
}

.features-section h4 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-primary);
  font-size: var(--text-lg);
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  padding: 8px 0;
  color: var(--text-primary);
  font-size: 15px;
  display: flex;
  align-items: center;
}

/* CTA Section */
.cta-section {
  text-align: center;
}

.subscribe-btn {
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--terminal-green) 0%, var(--terminal-emerald) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(79, 154, 101, 0.3);
}

.subscribe-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(79, 154, 101, 0.4);
  background: linear-gradient(135deg, var(--terminal-emerald) 0%, var(--terminal-green) 100%);
}

.subscribe-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.payment-note {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

/* Loading state */
.mp-loading {
  text-align: center;
  padding: var(--space-2xl);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-secondary);
  border-top: 3px solid var(--terminal-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments for modal */
@media (max-width: 600px) {
  .mercadopago-modal {
    max-width: 95%;
    margin: var(--space-lg);
  }
  
  .modal-header,
  .modal-body {
    padding: var(--space-lg);
  }
  
  .plan-hero-section {
    padding: var(--space-lg);
  }
  
  .amount {
    font-size: 2.5em;
  }
  
  .subscribe-btn {
    font-size: 16px;
    padding: 16px 20px;
  }
}

/* ============================================================================
   Mobile-First Responsive Breakpoints - Enhanced Terminal UI
   ============================================================================ */

/* Mobile Portrait (320px - 479px) */
@media (max-width: 479px) {
  .container {
    margin: var(--space-xs) auto;
    padding: var(--space-xs);
    width: calc(100% - var(--space-sm));
  }
  
  .enhanced-header {
    padding: var(--space-sm);
    min-height: 56px;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: stretch;
  }
  
  .header-brand {
    align-items: center;
    text-align: center;
  }
  
  .brand-title {
    font-size: var(--text-base);
  }
  
  .header-subtitle {
    font-size: var(--text-xs);
    display: none; /* Hide subtitle on very small screens */
  }
  
  .header-actions {
    justify-content: center;
    width: 100%;
  }
  
  .card {
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-md);
  }
  
  .card h2 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-md);
  }
  
  /* Mobile-optimized form layout */
  .row {
    gap: var(--space-sm);
  }
  
  .col {
    min-width: 100%;
  }
  
  /* Touch-optimized buttons */
  .button-groups {
    gap: var(--space-sm);
    flex-direction: column;
  }
  
  .primary-actions,
  .secondary-actions {
    gap: var(--space-sm);
    justify-content: stretch;
    width: 100%;
  }
  
  .primary-actions button,
  .secondary-actions button {
    flex: 1;
    min-width: 0;
  }
  
  /* Compact button display */
  .enhanced-btn .btn-text {
    display: none;
  }
  
  .enhanced-btn .btn-icon {
    font-size: var(--text-xl);
    margin: 0;
  }
  
  .enhanced-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-full);
    justify-content: center;
  }
  
  /* Mobile KPI layout */
  .kpi {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  
  .tile {
    padding: var(--space-sm) var(--space-md);
    text-align: center;
  }
  
  .tile h3 {
    font-size: var(--text-sm);
  }
  
  .tile p {
    font-size: var(--text-lg);
  }
  
  /* Simplified navigation */
  .pill .btn-text {
    display: none;
  }
  
  .pill {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }
  
  .brand-pill {
    padding: var(--space-xs) var(--space-md);
  }
}

/* Mobile Landscape (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
  .container {
    margin: var(--space-sm) auto;
    padding: var(--space-sm);
  }
  
  .enhanced-header {
    padding: var(--space-sm) var(--space-md);
    min-height: 64px;
  }
  
  .card {
    padding: var(--space-lg);
  }
  
  /* Two-column KPI layout for landscape */
  .kpi {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Show some button text on landscape */
  .enhanced-btn .btn-text {
    display: inline;
    font-size: var(--text-xs);
  }
  
  .enhanced-btn {
    padding: var(--space-sm) var(--space-md);
    width: auto;
    height: auto;
    border-radius: var(--radius-lg);
  }
  
  .enhanced-btn .btn-icon {
    font-size: var(--text-lg);
    margin: 0;
  }
  
  .button-groups {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
  }
}

/* ============================================================================
   Terminal Animation System - Enhanced
   ============================================================================ */

/* Page entrance animations */
.fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.slide-in {
  animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
  from {
    transform: translateX(-30px);
    opacity: 0;
  }
  60% {
    transform: translateX(5px);
    opacity: 0.8;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Card entrance animation */
@keyframes cardSlideUp {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  60% {
    opacity: 0.8;
    transform: translateY(-5px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Tile entrance animation */
@keyframes tileSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-20px) scale(0.9);
  }
  60% {
    opacity: 0.8;
    transform: translateX(3px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Terminal cursor effect */
.terminal-cursor::after {
  content: '_';
  color: var(--terminal-green);
  animation: blink 1.2s infinite ease-in-out;
  text-shadow: 0 0 8px rgba(79, 154, 101, 0.6);
  display: inline-block;
}

@keyframes blink {
  0%, 45% { 
    opacity: 1; 
    transform: scaleY(1);
  }
  50%, 95% { 
    opacity: 0; 
    transform: scaleY(0.1);
  }
  100% { 
    opacity: 1; 
    transform: scaleY(1);
  }
}

/* Pulse animation for success states */
@keyframes successPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    transform: scale(1);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    transform: scale(1);
  }
}

/* Loading shimmer effect */
@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.loading-shimmer {
  background: linear-gradient(90deg, var(--bg-tertiary) 0%, rgba(79, 154, 101, 0.1) 20%, var(--bg-tertiary) 40%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite linear;
}

/* Stagger animation for multiple elements */
.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }
.card:nth-child(5) { animation-delay: 0.4s; }
.card:nth-child(6) { animation-delay: 0.5s; }

.tile:nth-child(1) { animation-delay: 0.1s; }
.tile:nth-child(2) { animation-delay: 0.2s; }
.tile:nth-child(3) { animation-delay: 0.3s; }
.tile:nth-child(4) { animation-delay: 0.4s; }
.tile:nth-child(5) { animation-delay: 0.5s; }
.tile:nth-child(6) { animation-delay: 0.6s; }

/* Enhanced focus states */
.input-focused {
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}

label.focused {
  color: var(--terminal-emerald) !important;
  font-weight: 600;
}

label.focused::before {
  animation: labelPulse 1s ease-in-out infinite;
}

/* Idle pulse animation for auth bar */
.idle-pulse {
  animation: idlePulse 3s ease-in-out infinite;
}

@keyframes idlePulse {
  0%, 100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translateY(-2px) scale(1.02);
  }
}

/* Smooth transitions for all interactive elements */
* {
  -webkit-tap-highlight-color: transparent;
}

button, 
input, 
select, 
textarea, 
.pill, 
.tile, 
.card {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* ============================================================================
   Performance Optimizations & Hardware Acceleration
   ============================================================================ */

.card, 
.tile, 
button, 
.pill, 
.enhanced-btn,
.enhanced-header {
  will-change: transform;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* GPU acceleration for smooth animations */
@supports (backdrop-filter: blur(1px)) {
  .enhanced-header,
  .card,
  input:focus,
  button:hover {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

/* ============================================================================
   Mobile Touch & Gesture Optimizations 
   ============================================================================ */

/* Optimize for touch devices - Remove hover effects, add touch feedback */
@media (hover: none) and (pointer: coarse) {
  /* Disable hover animations on touch devices */
  button:hover,
  .pill:hover,
  .card:hover,
  .tile:hover {
    transform: none;
    box-shadow: var(--shadow-md);
  }
  
  .enhanced-btn:hover .btn-icon {
    transform: none;
  }
  
  /* Enhanced touch feedback */
  button:active,
  .pill:active,
  .enhanced-btn:active {
    transform: scale(0.95);
    background: var(--state-active);
    transition: all 0.1s ease-out;
  }
  
  /* Touch-friendly interactive elements */
  button,
  .pill,
  .enhanced-btn,
  input,
  select {
    -webkit-tap-highlight-color: rgba(79, 154, 101, 0.3);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  
  input,
  textarea {
    -webkit-user-select: text;
    user-select: text;
  }
  
  /* Larger touch targets for mobile */
  .pill,
  button {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Scrollable areas with momentum */
  .card,
  .container {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

/* Mobile-specific gestures and interactions */
@media (max-width: 767px) {
  /* Swipeable cards */
  .card {
    touch-action: pan-y; /* Allow vertical scrolling only */
    overscroll-behavior-x: contain;
  }
  
  /* Prevent zoom on double tap */
  * {
    touch-action: manipulation;
  }
  
  /* Allow zoom only on inputs */
  input,
  textarea,
  select {
    touch-action: auto;
  }
  
  /* Enhanced scrolling for mobile */
  body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  
  /* Mobile-optimized focus states */
  input:focus,
  select:focus,
  textarea:focus {
    transform: scale(1.02);
    border-width: 3px;
    box-shadow: var(--shadow-focus);
  }
}

/* ============================================================================
   Accessibility & Reduced Motion Support
   ============================================================================ */

@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;
  }
  
  .card,
  .tile,
  .enhanced-header,
  #auth-bar {
    animation: none !important;
  }
  
  button:hover,
  .enhanced-btn:hover {
    transform: none !important;
  }
  
  .card:hover,
  .tile:hover {
    transform: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-primary: #ffffff;
    --border-secondary: #cccccc;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --bg-tertiary: #222222;
  }
  
  .card,
  .tile,
  button,
  .pill {
    border-width: 2px;
  }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
  :root {
    --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.4), 0 0 4px rgba(79,154,101,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.5), 0 0 8px rgba(79,154,101,.12);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.6), 0 0 15px rgba(79,154,101,.15);
  }
}

/* ============================================================================
   Mobile Performance & Utility Classes 
   ============================================================================ */

/* Touch device specific styles */
.touch-device {
  /* Optimize scrolling performance on touch devices */
  -webkit-overflow-scrolling: touch;
  
  /* Prevent selection on UI elements */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.touch-device input,
.touch-device textarea {
  /* Allow text selection in inputs */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Mobile-specific utility classes */
.mobile-hidden {
  @media (max-width: 767px) {
    display: none !important;
  }
}

.mobile-only {
  display: none;
  @media (max-width: 767px) {
    display: block !important;
  }
}

.mobile-flex {
  @media (max-width: 767px) {
    display: flex !important;
  }
}

/* Responsive text sizing */
.responsive-text {
  font-size: clamp(0.875rem, 2.5vw, 1.125rem);
}

.responsive-title {
  font-size: clamp(1.25rem, 4vw, 2rem);
}

/* Mobile-optimized spacing */
.mobile-padding {
  @media (max-width: 767px) {
    padding: var(--space-sm) !important;
  }
}

.mobile-margin {
  @media (max-width: 767px) {
    margin: var(--space-sm) 0 !important;
  }
}

/* Safe area handling for iOS devices with notches */
@supports (padding: max(0px)) {
  .container {
    padding-left: max(var(--space-md), env(safe-area-inset-left));
    padding-right: max(var(--space-md), env(safe-area-inset-right));
  }
  
  .enhanced-header {
    padding-top: max(var(--space-md), env(safe-area-inset-top));
    padding-left: max(var(--space-md), env(safe-area-inset-left));
    padding-right: max(var(--space-md), env(safe-area-inset-right));
  }
  
  /* Handle bottom safe area for floating elements */
  .floating-bottom {
    padding-bottom: max(var(--space-md), env(safe-area-inset-bottom));
  }
}

/* Mobile viewport optimization */
@viewport {
  width: device-width;
  initial-scale: 1.0;
  maximum-scale: 5.0;
  user-scalable: yes;
}

/* Mobile-first grid system */
.mobile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  
  @media (min-width: 480px) {
    grid-template-columns: repeat(2, 1fr);
  }
  
  @media (min-width: 768px) {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================================
   Advanced Terminal Effects & Utility Classes
   ============================================================================ */

/* Glowing terminal cursor effect */
.terminal-typing {
  position: relative;
}

.terminal-typing::after {
  content: '_';
  color: var(--terminal-emerald);
  font-weight: bold;
  animation: terminalBlink 1s infinite;
  text-shadow: 0 0 10px currentColor;
}

@keyframes terminalBlink {
  0%, 50% {
    opacity: 1;
    transform: scaleY(1);
  }
  51%, 100% {
    opacity: 0;
    transform: scaleY(0.1);
  }
}

/* Matrix-style background effect */
.matrix-bg {
  position: relative;
  overflow: hidden;
}

.matrix-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(79, 154, 101, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(79, 154, 101, 0.05) 0%, transparent 70%);
  animation: matrixMove 20s linear infinite;
  pointer-events: none;
}

@keyframes matrixMove {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* Enhanced focus states with terminal aesthetics */
.terminal-focus-ring {
  position: relative;
}

.terminal-focus-ring:focus::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px dashed var(--terminal-emerald);
  border-radius: inherit;
  animation: dashRotate 2s linear infinite;
  pointer-events: none;
}

@keyframes dashRotate {
  0% {
    border-color: var(--terminal-emerald);
    opacity: 1;
  }
  50% {
    border-color: var(--terminal-jade);
    opacity: 0.7;
  }
  100% {
    border-color: var(--terminal-emerald);
    opacity: 1;
  }
}

/* Scanline effect for terminal aesthetics */
.scanlines {
  position: relative;
  overflow: hidden;
}

.scanlines::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(
      transparent 50%,
      rgba(79, 154, 101, 0.02) 50%,
      rgba(79, 154, 101, 0.02) 51%,
      transparent 51%
    );
  background-size: 100% 4px;
  pointer-events: none;
  animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 4px;
  }
}

/* Terminal-style loading bars */
.terminal-loader {
  position: relative;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  height: 8px;
  overflow: hidden;
}

.terminal-loader::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-accent);
  animation: terminalLoad 2s ease-in-out infinite;
}

@keyframes terminalLoad {
  0% {
    left: -100%;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

/* ============================================================================
   Legacy Terminal Special Effects (Maintained for compatibility)
   ============================================================================ */

.glow {
  box-shadow: 0 0 20px rgba(79, 154, 101, 0.4);
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(79, 154, 101, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(79, 154, 101, 0.6);
  }
}

.terminal-shadow {
  box-shadow: 
    0 1px 3px rgba(0,0,0,.12),
    0 1px 2px rgba(0,0,0,.24),
    inset 0 1px 0 rgba(255,255,255,.05);
}

/* Terminal focus ring */
.terminal-focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 154, 101, 0.4);
}

/* Ripple effect for buttons */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(79, 154, 101, 0.6) 0%, transparent 70%);
  border-radius: 50%;
  transform: scale(0);
  pointer-events: none;
  transition: transform 0.5s ease-out;
}

.ripple:active::after {
  transform: scale(4);
  opacity: 0;
}

/* Floating animation */
.float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Typing animation */
.typing {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--terminal-green) }
}

/* Bounce attention effect */
.bounce-attention {
  animation: bounceAttention 1s ease-in-out;
}

@keyframes bounceAttention {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Highlight flash effect */
.highlight-flash {
  animation: highlightFlash 1s ease-out;
}

@keyframes highlightFlash {
  0% {
    background-color: rgba(79, 154, 101, 0.3);
  }
  100% {
    background-color: transparent;
  }
}

/* Scale on hover utility */
.scale-hover:hover {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

/* Rotate on hover utility */
.rotate-hover:hover {
  transform: rotate(5deg);
  transition: transform 0.3s ease;
}

/* Slide reveal animation */
.slide-reveal {
  clip-path: inset(0 100% 0 0);
  animation: slideReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideReveal {
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
  }
  
  .card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
  
  #auth-bar {
    display: none;
  }
}

/* ============================================================================
   Help Text and Tips Styles
   ============================================================================ */

small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

small:hover {
  opacity: 1;
}

small strong {
  color: var(--terminal-green);
  font-weight: 600;
}

/* Tip text styling */
.row small {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* Help text under inputs */
.col small {
  font-style: italic;
  margin-top: 2px;
}

/* ============================================================================
   MercadoPago Modal Styles
   ============================================================================ */

/* Merge with above modal styles - use single definition */
.modal-content {
  background: var(--bg-primary);
  border-radius: 16px;
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow: auto;
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Ensure modal content is above backdrop blur */
  position: relative;
  z-index: 100001;
  /* Disable backdrop filter on modal content */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
}

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

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

.modal-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--text-2xl);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: scale(1.1);
}

.modal-body {
  padding: var(--space-xl);
}

.subscription-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.plan-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-secondary);
  border-radius: 16px;
  padding: var(--space-xl);
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.plan-card:hover {
  border-color: var(--terminal-green);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.plan-card.featured {
  border-color: var(--terminal-green);
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--terminal-green);
  color: white;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: var(--text-sm);
  font-weight: 600;
}

.plan-header h3 {
  color: var(--text-primary);
  font-size: var(--text-xl);
  margin: 0 0 var(--space-sm) 0;
}

.price {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--terminal-green);
  margin-bottom: var(--space-sm);
}

.price span {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.savings {
  color: var(--text-success);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: var(--space-lg) 0;
}

.plan-features li {
  color: var(--text-secondary);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(79, 154, 101, 0.1);
}

.plan-features li:last-child {
  border-bottom: none;
}

.plan-btn {
  width: 100%;
  background: var(--terminal-green);
  color: white;
  border: none;
  padding: var(--space-lg);
  border-radius: 12px;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: var(--space-lg);
}

.plan-btn:hover {
  background: var(--terminal-emerald);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 154, 101, 0.3);
}

.plan-btn:active {
  transform: translateY(0);
}

.annual-btn {
  background: linear-gradient(135deg, var(--terminal-green), var(--terminal-emerald));
}

.mp-loading {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-secondary);
  border-top: 3px solid var(--terminal-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-lg) auto;
}

.subscription-btn {
  display: flex !important;
  align-items: center;
  gap: var(--space-sm);
  transition: all 0.3s ease;
}

/* ============================================================================
   Enhanced Button System & Components
   ============================================================================ */

.enhanced-btn {
  position: relative;
  overflow: hidden;
  transition: all var(--duration-slow) var(--ease-out);
}

.enhanced-btn .btn-icon {
  font-size: var(--text-lg);
  transition: all var(--duration-normal) var(--ease-out);
}

.enhanced-btn:hover .btn-icon {
  transform: scale(1.2) rotate(5deg);
  text-shadow: 0 0 8px rgba(79, 154, 101, 0.6);
}

.enhanced-btn .btn-text {
  font-weight: var(--font-semibold);
  transition: all var(--duration-normal) var(--ease-out);
}

.enhanced-btn:hover .btn-text {
  transform: translateX(2px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Button Variants */
button.secondary {
  background: 
    linear-gradient(135deg, var(--bg-hover), var(--bg-secondary)),
    radial-gradient(circle at center, rgba(79, 154, 101, 0.06) 0%, transparent 70%);
  border-color: var(--terminal-sage);
  color: var(--text-primary);
  font-weight: var(--font-semibold);
}

button.secondary:hover {
  background: 
    linear-gradient(135deg, var(--terminal-sage), var(--bg-hover)),
    radial-gradient(circle at center, rgba(79, 154, 101, 0.1) 0%, transparent 70%);
  border-color: var(--terminal-green);
  color: var(--text-primary);
}

button.utility {
  background: 
    linear-gradient(135deg, rgba(79, 154, 101, 0.1), rgba(79, 154, 101, 0.05)),
    var(--bg-tertiary);
  border-color: rgba(79, 154, 101, 0.2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  padding: var(--space-sm) var(--space-md);
}

button.utility:hover {
  background: 
    linear-gradient(135deg, rgba(79, 154, 101, 0.2), rgba(79, 154, 101, 0.1)),
    var(--bg-secondary);
  border-color: var(--terminal-green);
  color: var(--text-primary);
}

.subscription-btn {
  background: linear-gradient(135deg, #009EE3, #0084C7) !important;
  color: white !important;
  border: none !important;
  font-weight: var(--font-bold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 
    0 4px 12px rgba(0, 158, 227, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.subscription-btn:hover {
  background: linear-gradient(135deg, #0084C7, #006BA6) !important;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 
    0 8px 20px rgba(0, 158, 227, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nav-link {
  background: 
    linear-gradient(135deg, rgba(79, 154, 101, 0.15), rgba(79, 154, 101, 0.08)),
    var(--bg-tertiary);
  border-color: rgba(79, 154, 101, 0.3);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-link:hover {
  background: 
    linear-gradient(135deg, var(--terminal-green), var(--terminal-emerald)),
    var(--bg-secondary);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.status-indicator {
  background: var(--gradient-secondary);
  border-color: var(--border-primary);
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.02);
  }
}

/* Responsive design for modal */
@media (max-width: 900px) {
  .subscription-plans {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .modal-content {
    width: 95%;
    margin: var(--space-lg);
  }
  
  .modal-header,
  .modal-body {
    padding: var(--space-lg);
  }
  
  .price {
    font-size: 2rem;
  }
}

@media (max-width: 600px) {
  .modal-header h2 {
    font-size: var(--text-xl);
  }
  
  .price {
    font-size: 1.8rem;
  }
  
  .plan-card {
    padding: var(--space-lg);
  }
}

/* ============================================================================
   ACCESS CONTROL - PREMIUM INDICATORS
   Visual indicators for premium features
   ============================================================================ */

.premium-indicator {
  display: inline-block;
  color: #FFD700;
  font-size: 0.8em;
  margin-left: 4px;
  cursor: help;
  animation: premiumGlow 2s ease-in-out infinite alternate;
  text-shadow: 0 0 3px rgba(255, 215, 0, 0.3);
}

@keyframes premiumGlow {
  from {
    opacity: 0.7;
    text-shadow: 0 0 3px rgba(255, 215, 0, 0.3);
  }
  to {
    opacity: 1;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  }
}

/* Premium disabled state styles applied by access control system */
.premium-disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  position: relative;
}

.premium-disabled::after {
  content: '⭐';
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  z-index: 10;
  pointer-events: none;
  animation: premiumPulse 2s infinite;
}

@keyframes premiumPulse {
  0%, 100% { 
    transform: scale(1); 
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4); 
  }
  50% { 
    transform: scale(1.1); 
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0); 
  }
}

/* Enhanced button premium indicators */
button .premium-indicator {
  margin-left: 6px;
  font-size: 0.7em;
}

/* Premium overlay for page-level blocking */
.premium-page-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 20px;
}

.premium-page-overlay .content {
  max-width: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

.premium-page-overlay h2 {
  color: #FFD700;
  margin-bottom: 16px;
  font-size: 1.5em;
}

.premium-page-overlay p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.premium-page-overlay button {
  background: linear-gradient(135deg, var(--terminal-green), #5a9d6b);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.premium-page-overlay button:hover {
  background: linear-gradient(135deg, #5a9d6b, var(--terminal-green));
  transform: scale(1.05);
}
