/* ============================================================
   VAULT ONBOARDING - PROFESSIONAL DESIGN
   ============================================================ */

:root {
  /* Colors - Dark Theme */
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-tertiary: #18181b;
  --bg-elevated: #1c1c1f;
  
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.15);
  
  --primary: #6366f1;
  --primary-hover: #7c3aed;
  --primary-light: rgba(99, 102, 241, 0.1);
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ============================================================
   ONBOARDING CONTAINER
   ============================================================ */

.onboarding {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 32px;
  position: relative;
}

/* Background Pattern */
.onboarding::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   HEADER
   ============================================================ */

.onboarding-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 64px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.4));
}

.logo-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Progress Bar */
.progress-bar {
  display: flex;
  gap: 48px;
  align-items: center;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.4;
  transition: opacity var(--transition);
}

.progress-step.active {
  opacity: 1;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: all var(--transition);
}

.progress-step.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.step-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ============================================================
   STEP CONTENT
   ============================================================ */

.onboarding-step {
  position: relative;
  z-index: 1;
  flex: 1;
  display: none;
  animation: fadeIn 400ms ease-out;
}

.onboarding-step.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-content {
  max-width: 1000px;
  margin: 0 auto;
}

.step-header {
  text-align: center;
  margin-bottom: 48px;
}

.step-header h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.step-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================================
   VAULT GRID (STEP 1)
   ============================================================ */

.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.vault-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.vault-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  transform: scaleX(0);
  transition: transform var(--transition);
}

.vault-card:hover {
  border-color: var(--border-default);
  background: var(--bg-tertiary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.vault-card:hover::before {
  transform: scaleX(1);
}

.vault-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.vault-card.active::before {
  transform: scaleX(1);
}

.vault-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.vault-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.vault-icon.personal {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

.vault-icon.family {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.vault-icon.work {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.vault-icon.custom {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.vault-card:hover .vault-icon {
  transform: scale(1.1) rotate(5deg);
}

.vault-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition);
}

.vault-card.active .vault-check {
  opacity: 1;
  background: var(--primary);
  border-color: var(--primary);
}

.vault-card.active .vault-check svg {
  color: white;
}

.vault-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.vault-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.vault-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.vault-badge.required {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================================
   PREFERENCES GRID (STEP 2)
   ============================================================ */

.preferences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.preference-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.preference-card:hover {
  border-color: var(--border-default);
  background: var(--bg-tertiary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.preference-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.preference-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--primary);
  transition: all var(--transition);
}

.preference-card:hover .preference-icon {
  transform: scale(1.1);
  background: var(--primary-light);
}

.preference-card.active .preference-icon {
  background: var(--primary);
  color: white;
}

.preference-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.preference-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.preference-check {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition);
}

.preference-card.active .preference-check {
  opacity: 1;
  background: var(--primary);
  border-color: var(--primary);
}

.preference-check svg {
  color: white;
}

/* ============================================================
   THEME GRID (STEP 3)
   ============================================================ */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.theme-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.theme-card:hover {
  border-color: var(--border-default);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.theme-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.theme-preview {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-default);
}

.dark-preview {
  background: #0a0a0b;
}

.light-preview {
  background: #ffffff;
}

.auto-preview {
  background: linear-gradient(135deg, #ffffff 50%, #0a0a0b 50%);
}

.preview-sidebar {
  width: 60px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dark-preview .preview-sidebar {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 8px;
}

.light-preview .preview-sidebar {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  padding: 8px;
}

.auto-preview .preview-sidebar.split {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 50%, rgba(255, 255, 255, 0.05) 50%);
  border-radius: 6px;
  padding: 8px;
}

.preview-item {
  height: 20px;
  border-radius: 4px;
  opacity: 0.3;
}

.dark-preview .preview-item {
  background: rgba(255, 255, 255, 0.2);
}

.light-preview .preview-item {
  background: rgba(0, 0, 0, 0.2);
}

.auto-preview .preview-item {
  background: rgba(99, 102, 241, 0.3);
}

.preview-item.active {
  opacity: 1;
}

.dark-preview .preview-item.active {
  background: rgba(99, 102, 241, 0.6);
}

.light-preview .preview-item.active {
  background: rgba(99, 102, 241, 0.6);
}

.preview-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dark-preview .preview-content {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 8px;
}

.light-preview .preview-content {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
  padding: 8px;
}

.auto-preview .preview-content.split {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.03) 50%, rgba(255, 255, 255, 0.03) 50%);
  border-radius: 6px;
  padding: 8px;
}

.preview-bar {
  height: 24px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.dark-preview .preview-bar {
  background: rgba(255, 255, 255, 0.1);
}

.light-preview .preview-bar {
  background: rgba(0, 0, 0, 0.1);
}

.auto-preview .preview-bar {
  background: rgba(99, 102, 241, 0.2);
}

.preview-cards {
  display: flex;
  gap: 6px;
  flex: 1;
}

.preview-card {
  flex: 1;
  border-radius: 4px;
}

.dark-preview .preview-card {
  background: rgba(255, 255, 255, 0.08);
}

.light-preview .preview-card {
  background: rgba(0, 0, 0, 0.08);
}

.auto-preview .preview-card {
  background: rgba(99, 102, 241, 0.15);
}

.theme-info {
  margin-bottom: 12px;
}

.theme-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.theme-info p {
  font-size: 14px;
  color: var(--text-secondary);
}

.theme-check {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition);
}

.theme-card.active .theme-check {
  opacity: 1;
  background: var(--primary);
  border-color: var(--primary);
}

.theme-check svg {
  color: white;
}

/* ============================================================
   FOOTER
   ============================================================ */

.onboarding-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}

.footer-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-text:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.btn-secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-strong);
}

.btn-primary {
  background: var(--primary);
  border: none;
  color: white;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Hint */
.hint {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}

.hint svg {
  flex-shrink: 0;
  color: var(--primary);
}

/* ============================================================
   MODAL
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: slideUp 300ms ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

/* Color Picker */
.color-picker {
  display: flex;
  gap: 12px;
}

.color-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--transition);
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 4px var(--border-default);
}

.color-option[data-color="blue"] { background: #3b82f6; }
.color-option[data-color="purple"] { background: #8b5cf6; }
.color-option[data-color="green"] { background: #10b981; }
.color-option[data-color="orange"] { background: #f59e0b; }
.color-option[data-color="pink"] { background: #ec4899; }
.color-option[data-color="red"] { background: #ef4444; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .onboarding {
    padding: 20px;
  }
  
  .onboarding-header {
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
  }
  
  .progress-bar {
    width: 100%;
    justify-content: space-between;
    gap: 0;
  }
  
  .step-label {
    display: none;
  }
  
  .step-header h1 {
    font-size: 28px;
  }
  
  .vault-grid,
  .preferences-grid,
  .theme-grid {
    grid-template-columns: 1fr;
  }
  
  .onboarding-footer {
    flex-direction: column;
    gap: 16px;
  }
  
  .footer-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .hint {
    display: none;
  }
}
