/* ==========================================================================
   LineInjector Pro - Modern Glassmorphism & High-Contrast Design System
   ========================================================================== */

:root {
  /* Color Palette - Dark Luxe (Default) */
  --bg-main: #0b0f19;
  --bg-gradient: radial-gradient(circle at 15% 15%, #18223c 0%, #0b0f19 55%, #070a12 100%);
  --surface-card: rgba(18, 26, 46, 0.7);
  --surface-card-border: rgba(255, 255, 255, 0.08);
  --surface-card-hover: rgba(24, 34, 58, 0.85);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-amber: #f59e0b;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --input-bg: rgba(11, 17, 32, 0.75);
  --input-border: rgba(148, 163, 184, 0.15);
  --input-border-focus: #6366f1;
  --input-text: #f1f5f9;
  
  --pill-bg: rgba(255, 255, 255, 0.04);
  --pill-border: rgba(255, 255, 255, 0.07);
  --pill-active-bg: rgba(99, 102, 241, 0.15);
  --pill-active-border: #6366f1;
  --pill-active-text: #a5b4fc;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--surface-card-border);
  --shadow-glow: 0 0 25px var(--primary-glow);
  --transition-smooth: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
body.theme-light {
  --bg-main: #f8fafc;
  --bg-gradient: radial-gradient(circle at 10% 10%, #e0e7ff 0%, #f8fafc 60%, #f1f5f9 100%);
  --surface-card: rgba(255, 255, 255, 0.88);
  --surface-card-border: rgba(226, 232, 240, 0.95);
  --surface-card-hover: rgba(255, 255, 255, 0.98);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --input-bg: rgba(248, 250, 252, 0.95);
  --input-border: #cbd5e1;
  --input-border-focus: #6366f1;
  --input-text: #0f172a;

  --pill-bg: #f1f5f9;
  --pill-border: #e2e8f0;
  --pill-active-bg: #e0e7ff;
  --pill-active-border: #6366f1;
  --pill-active-text: #4338ca;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 0 0 1px var(--surface-card-border);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Glow Orbs */
.app-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
  transition: transform 12s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #6366f1, #3b82f6);
  top: -150px;
  left: -100px;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #d946ef, #8b5cf6);
  top: 40%;
  right: -150px;
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #06b6d4, #10b981);
  bottom: -100px;
  left: 25%;
  animation: floatOrb 15s ease-in-out infinite alternate;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* Container */
.app-container {
  max-width: 1540px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 1.25rem;
}

/* Glass Card */
.glass-card {
  background: var(--surface-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 0.25rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-badge {
  position: relative;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.5);
  transition: var(--transition-smooth);
}

.brand-icon:hover {
  transform: rotate(5deg) scale(1.05);
}

.version-tag {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: #10b981;
  color: #022c22;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.brand-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.brand-title span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.brand-subtitle strong {
  color: #a5b4fc;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px -2px rgba(99, 102, 241, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -3px rgba(99, 102, 241, 0.65);
}

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

.btn-secondary {
  background: var(--pill-bg);
  border-color: var(--surface-card-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--surface-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

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

.btn-ghost:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--pill-bg);
  border-color: var(--surface-card-border);
  color: var(--text-secondary);
}

.btn-icon:hover {
  color: var(--text-primary);
  background: var(--surface-card-hover);
}

.btn-xs {
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
}

.btn-kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.85);
  margin-left: 0.35rem;
}

/* Control Panel */
.control-panel {
  padding: 1.35rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  border-left: 4px solid var(--primary);
}

.control-row {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.primary-controls {
  display: grid;
  grid-template-columns: minmax(300px, 1.2fr) minmax(380px, 2fr) auto;
  gap: 1.25rem;
  align-items: flex-end;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.label-icon {
  font-size: 1rem;
}

.label-badge {
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.15);
  color: var(--pill-active-text);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  margin-left: auto;
}

/* Inputs */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.primary-input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 125px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--input-text);
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  outline: none;
  transition: var(--transition-smooth);
}

.primary-input:focus {
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(15, 23, 42, 0.9);
}

.btn-input-action {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-input-action:hover {
  background: var(--primary);
  color: white;
}

/* Mode Pills */
.mode-pills {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--surface-card-border);
  overflow-x: auto;
}

.mode-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.5rem 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  text-align: left;
  white-space: nowrap;
}

.mode-pill strong {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.mode-pill small {
  font-size: 0.7rem;
  opacity: 0.75;
}

.mode-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.mode-pill.active {
  background: var(--pill-active-bg);
  border-color: var(--pill-active-border);
  color: var(--pill-active-text);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.pill-dot {
  display: none;
}

/* Process Button in Primary Controls */
.action-btn-group .btn-primary {
  height: 48px;
  padding: 0 1.5rem;
  font-size: 0.95rem;
}

/* Options Row */
.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-delimiter-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.option-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.mini-input {
  width: 90px;
  padding: 0.35rem 0.65rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--input-text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
}

.mini-input:focus {
  border-color: var(--primary);
}

.checkbox-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: var(--transition-smooth);
}

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

.custom-checkbox input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.custom-checkbox input:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.custom-checkbox input:checked + .checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

/* Highlight Bold Number Toggle */
.highlight-checkbox {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--text-primary) !important;
}

.bold-label-text b {
  color: #a5b4fc;
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite;
}

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

/* Editor Grid */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  flex: 1;
  min-height: 520px;
}

.editor-column {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--surface-card-border);
  gap: 0.75rem;
}

.editor-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.editor-icon {
  font-size: 1.1rem;
}

.editor-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.badge-format {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.editor-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* View Switch Pills */
.view-switch-pills {
  display: flex;
  gap: 3px;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--surface-card-border);
}

.view-pill {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.view-pill:hover {
  color: var(--text-primary);
}

.view-pill.active {
  background: var(--primary);
  color: white;
}

.output-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-copy {
  background: #10b981;
  border-color: #059669;
  box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.4);
}

.btn-copy:hover {
  background: #059669;
  box-shadow: 0 6px 18px -2px rgba(16, 185, 129, 0.55);
}

.btn-copy.copied {
  background: #047857 !important;
}

/* Rich Text & Textarea Editors */
.editor-body {
  flex: 1;
  position: relative;
  display: flex;
  overflow: hidden;
}

.rich-editor {
  width: 100%;
  height: 100%;
  min-height: 440px;
  max-height: 600px;
  overflow-y: auto;
  padding: 1.25rem 1.35rem;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}

.rich-editor b, 
.rich-editor strong {
  font-weight: 800;
  color: #ffffff;
}

body.theme-light .rich-editor b,
body.theme-light .rich-editor strong {
  color: #0f172a;
}

/* Highlighted Bold Injected Number */
.injected-num {
  font-weight: 800;
  color: #ffffff !important;
  background: rgba(99, 102, 241, 0.22);
  border-radius: 4px;
  padding: 0 3px;
  border-bottom: 2px solid #6366f1;
  display: inline;
}

body.theme-light .injected-num {
  color: #1e1b4b !important;
  background: rgba(99, 102, 241, 0.15);
  border-bottom: 2px solid #4f46e5;
}

.rich-editor[contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  opacity: 0.65;
  pointer-events: none;
  display: block;
}

.rich-output {
  background: rgba(0, 0, 0, 0.08);
}

.content-textarea {
  width: 100%;
  height: 100%;
  min-height: 440px;
  padding: 1.25rem 1.35rem;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
}

/* Custom Scrollbars */
.rich-editor::-webkit-scrollbar,
.content-textarea::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.rich-editor::-webkit-scrollbar-track,
.content-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.rich-editor::-webkit-scrollbar-thumb,
.content-textarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.rich-editor::-webkit-scrollbar-thumb:hover,
.content-textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: white;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px -3px rgba(16, 185, 129, 0.5);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
  pointer-events: none;
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

/* Footer */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-tip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tip-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
}

.footer-shortcuts {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.shortcut-item kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--pill-bg);
  border: 1px solid var(--surface-card-border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

/* Responsive Breakpoints */
@media (max-width: 1080px) {
  .primary-controls {
    grid-template-columns: 1fr;
  }
  
  .editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-container {
    padding: 1rem;
  }

  .options-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .control-panel {
    padding: 1rem;
  }

  .mode-pills {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   Runaway Login Modal Gate & User Session Styles (Instagram Reel @code_and_chill)
   ========================================================================== */

/* Header User Badge & Lock Button */
.user-session-badge {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  animation: fadeIn 0.3s ease;
}

.user-avatar-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #34d399;
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #fca5a5;
  transform: translateY(-1px);
}

/* Runaway Auth Fullscreen Overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
}

.auth-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 17, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

/* Ambient glow in auth */
.auth-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
}

.orb-auth-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
  top: 15%;
  left: 20%;
  animation: floatOrb 9s ease-in-out infinite alternate;
}

.orb-auth-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #d946ef 0%, rgba(217, 70, 239, 0) 70%);
  bottom: 15%;
  right: 20%;
  animation: floatOrb 11s ease-in-out infinite alternate-reverse;
}

/* Login Card */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(17, 24, 43, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  padding: 2.2rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 35px rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
  user-select: none;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

/* Error Shake */
.auth-card.shake {
  animation: cardShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.35);
}

@keyframes cardShake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Auth Header */
.auth-header {
  margin-bottom: 1.5rem;
}

.auth-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.auth-avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.3));
  border: 2px solid rgba(165, 180, 252, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a5b4fc;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.3);
  transition: var(--transition-smooth);
}

.auth-card.unlocked .auth-avatar-circle {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.3));
  border-color: rgba(52, 211, 153, 0.5);
  color: #34d399;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.45);
}

.auth-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Error Alert */
.auth-error-alert {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  animation: fadeIn 0.2s ease;
}

/* Inputs */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  text-align: left;
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-smooth);
}

.auth-input {
  width: 100%;
  padding: 0.85rem 2.8rem 0.85rem 2.8rem;
  background: rgba(11, 17, 32, 0.85);
  border: 1.5px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  transition: var(--transition-smooth);
  outline: none;
}

.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(14, 22, 42, 0.95);
}

.auth-input:focus + .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
  color: var(--primary);
}

.btn-toggle-pwd {
  position: absolute;
  right: 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

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

/* Reel Interactive Dodge Status Indicator */
.dodge-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  transition: var(--transition-smooth);
}

.dodge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b; /* Amber = bolting */
  box-shadow: 0 0 8px #f59e0b;
  transition: var(--transition-smooth);
}

.dodge-indicator.half-travel .dodge-dot {
  background: #06b6d4; /* Cyan = slowing down */
  box-shadow: 0 0 8px #06b6d4;
}

.dodge-indicator.locked .dodge-dot {
  background: #10b981; /* Emerald = snapped & locked */
  box-shadow: 0 0 10px #10b981;
}

.dodge-indicator.locked {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}

/* Runaway Action Arena */
.auth-action-arena {
  position: relative;
  width: 100%;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

/* The Infamous Runaway Button */
.btn-login-runaway {
  position: relative;
  width: 100%;
  max-width: 240px;
  padding: 0.88rem 1.8rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  border: none;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  box-shadow: 0 6px 20px -3px rgba(99, 102, 241, 0.45);
  user-select: none;
  transform: translate(0px, 0px);
  will-change: transform;
  transition: transform 0.16s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s ease, background 0.25s ease;
}

/* State: Bolting (Empty form) */
.btn-login-runaway.is-bolting {
  transition: transform 0.12s cubic-bezier(0.1, 1.3, 0.3, 1);
  box-shadow: 0 8px 25px -3px rgba(245, 158, 11, 0.5);
}

/* State: Half Travel (1 field filled) */
.btn-login-runaway.is-slowed {
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.4, 1);
  box-shadow: 0 8px 25px -3px rgba(6, 182, 212, 0.5);
}

/* State: Snapped Home & Locked (Both fields filled!) */
.btn-login-runaway.snapped-home {
  transform: translate(0px, 0px) !important;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5), 0 8px 25px -3px rgba(16, 185, 129, 0.6);
  cursor: pointer;
  animation: pulseSnap 0.4s ease;
}

@keyframes pulseSnap {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.btn-login-arrow {
  transition: transform 0.25s ease;
}

.btn-login-runaway:hover .btn-login-arrow {
  transform: translateX(4px);
}

/* Accessible: Tab key always catches it and halts dodging */
.btn-login-runaway:focus-visible {
  transform: translate(0px, 0px) !important;
  outline: 3px solid #a5b4fc;
  outline-offset: 4px;
}

/* Footer Notice */
.auth-footer {
  margin-top: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

