:root {
  --bg-dark: #0a0a0c;
  --bg-surface: rgba(20, 20, 25, 0.7);
  --bg-surface-light: rgba(30, 30, 38, 0.8);
  
  --primary-color: #8b5cf6; /* Indigo/Purple */
  --primary-hover: #a78bfa;
  --primary-glow: rgba(139, 92, 246, 0.5);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(139, 92, 246, 0.3);
  
  --danger: #ef4444;
  --success: #10b981;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-panel:hover {
  border-color: var(--border-glow);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px var(--primary-glow);
  transition: all 0.3s ease;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-surface-light);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-muted);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-control {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Layout */
header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 10, 12, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
}

.view-container {
  width: 100%;
  max-width: 1200px;
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.view-container.active {
  display: flex;
  flex-direction: column;
}

/* Auth View */
.auth-wrapper {
  max-width: 450px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem;
}

/* Dashboard View */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.envelopes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.envelope-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  width: max-content;
}

.status-draft { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.status-sent { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.status-completed { background: rgba(16, 185, 129, 0.2); color: #34d399; }

/* Wizard View */
.wizard-container {
  display: flex;
  gap: 2rem;
  height: calc(100vh - 150px);
}

.wizard-sidebar {
  width: 300px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wizard-main {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.3s;
}

.step-indicator.active {
  background: var(--primary-glow);
  color: white;
  border-left: 4px solid var(--primary-color);
}

.dropzone {
  flex: 1;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(0,0,0,0.2);
}

.dropzone:hover {
  border-color: var(--primary-color);
  background: rgba(139, 92, 246, 0.05);
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  color: var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Toast */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  background: var(--bg-surface-light);
  border-left: 4px solid var(--primary-color);
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}
