/* onboarding.css — First-run setup wizard */

/* ===== Full-screen overlay ===== */

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000; /* above modal (10000) and everything else */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: ob-overlay-in 0.3s ease-out forwards;
}

.onboarding-overlay.onboarding-exit {
  animation: ob-overlay-out 0.4s ease-in forwards;
}

@keyframes ob-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes ob-overlay-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ===== Card ===== */

.onboarding-card {
  width: min(520px, calc(100vw - var(--space-xl)));
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow-lg), 0 0 60px rgba(99, 102, 241, 0.15);
  padding: var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);

  /* Start invisible; JS adds class to animate in */
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transition:
    opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onboarding-card.onboarding-card-enter {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== Step dots ===== */

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--glass-border-light);
  transition: background var(--transition-normal), transform var(--transition-normal);
}

.onboarding-dot.active {
  background: var(--accent-primary);
  transform: scale(1.25);
}

/* ===== Body ===== */

.onboarding-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

/* ===== Avatar hero (step 1) ===== */

.onboarding-avatar-hero {
  animation: ob-pulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
  margin-bottom: var(--space-xs);
}

@keyframes ob-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5)); }
  50%       { transform: scale(1.04); filter: drop-shadow(0 0 28px rgba(99, 102, 241, 0.8)); }
}

/* ===== Typography ===== */

.onboarding-title {
  font-size: var(--font-size-xl, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.onboarding-desc {
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* ===== Form fields ===== */

.onboarding-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  width: 100%;
  text-align: left;
}

.onboarding-label {
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 500;
  color: var(--text-secondary);
}

.onboarding-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm, 0.875rem);
  font-family: var(--font-mono);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.onboarding-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.onboarding-input::placeholder {
  color: var(--text-disabled);
}

.onboarding-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  min-height: 1em;
}

.onboarding-hint-ok {
  color: var(--success);
}

/* ===== Avatar style grid (step 3) ===== */

.onboarding-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  width: 100%;
}

.onboarding-avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-xs);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--text-secondary);
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast);
  user-select: none;
}

.onboarding-avatar-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.onboarding-avatar-option:hover {
  border-color: var(--glass-border-light);
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.onboarding-avatar-option.selected {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

/* ===== Navigation row ===== */

.onboarding-nav {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  width: 100%;
  margin-top: var(--space-xs);
}

/* ===== Buttons ===== */

.onboarding-btn-primary {
  padding: var(--space-sm) var(--space-xl);
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}

.onboarding-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.onboarding-btn-ghost {
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-size-sm, 0.875rem);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.onboarding-btn-ghost:hover {
  border-color: var(--glass-border-light);
  color: var(--text-primary);
}

/* ===== Success icon (step 4) ===== */

.onboarding-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success-bg);
  border: 2px solid var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--success);
  animation: ob-success-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ob-success-pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ===== Tour list (step 4) ===== */

.onboarding-tour {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  text-align: left;
}

.onboarding-tour li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.onboarding-tour li strong {
  color: var(--text-primary);
}

.ob-icon {
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1.4;
}

/* ===== Responsive ===== */

@media (max-width: 560px) {
  .onboarding-card {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
  }

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