/* ============================================
   ONBOARDING — Terminal / Classified Document
   Fullscreen immersive experience replicating
   the original PodcastOnboarding design.
   ============================================ */

/* === Fullscreen Container === */
.onb-fullscreen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  position: relative;
}

/* === Terminal Window === */
.onb-terminal {
  width: 100%;
  max-width: 700px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(124, 58, 237, 0.1);
}

.onb-terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(124, 58, 237, 0.06);
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}

.onb-terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.onb-terminal-dot:nth-child(1) { background: #EF4444; opacity: 0.8; }
.onb-terminal-dot:nth-child(2) { background: #F59E0B; opacity: 0.8; }
.onb-terminal-dot:nth-child(3) { background: #10B981; opacity: 0.8; }

.onb-terminal-title {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  margin-left: auto;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.onb-terminal-body {
  padding: 24px;
  min-height: 320px;
  max-height: 70vh;
  overflow-y: auto;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85rem;
  line-height: 1.9;
  scrollbar-width: none;
}

.onb-terminal-body::-webkit-scrollbar {
  display: none;
}

/* === Boot Log Lines === */
.onb-boot-line {
  color: rgba(167, 139, 250, 0.8);
  opacity: 0;
  animation: onb-lineIn 0.35s ease forwards;
}

.onb-line--warning {
  color: #F59E0B;
}

.onb-line--success {
  color: #10B981;
}

.onb-line--accent {
  color: #c084fc;
  font-weight: 600;
}

@keyframes onb-lineIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* === Typewriter Cursor (via ::after) === */
.onb-typewriter::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  background: rgba(167, 139, 250, 0.7);
  animation: onb-blink 0.8s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

.onb-typewriter--done::after {
  display: none;
}

@keyframes onb-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}


/* ============================================
   CLASSIFIED STAMP
   ============================================ */

.onb-stamp-container {
  text-align: center;
  padding: 60px 20px;
}

.onb-stamp-folder {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.3s forwards;
}

.onb-stamp {
  display: inline-block;
  padding: 12px 32px;
  border: 3px solid #EF4444;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  color: #EF4444;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transform: rotate(-5deg);
  animation: onb-stampIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  animation-fill-mode: forwards;
}

.onb-stamp--declassified {
  border-color: #10B981;
  color: #10B981;
}

@keyframes onb-stampIn {
  from {
    transform: rotate(-5deg) scale(2.5);
    opacity: 0;
  }
  to {
    transform: rotate(-5deg) scale(1);
    opacity: 1;
  }
}

.onb-stamp-subtitle {
  margin-top: 20px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.08em;
  opacity: 0;
  animation: onb-fadeIn 0.6s ease 0.5s forwards;
}

.onb-stamp-title {
  margin-top: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  opacity: 0;
  animation: onb-fadeIn 0.6s ease 0.7s forwards;
}

.onb-stamp-name {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #a78bfa;
  font-weight: 500;
  letter-spacing: 0.06em;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.9s forwards;
}

@keyframes onb-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ============================================
   SECTION HEADER
   ============================================ */

.onb-section-screen {
  text-align: center;
  padding: 80px 24px;
  max-width: 600px;
  margin: 0 auto;
}

.onb-section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(124, 58, 237, 0.3);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #a78bfa;
  margin-bottom: 20px;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease forwards;
}

.onb-section-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: rgba(167, 139, 250, 0.6);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 16px;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.2s forwards;
}

.onb-section-title {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, #c084fc, #a78bfa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.4s forwards;
}

.onb-section-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.6;
  max-width: 460px;
  margin: 0 auto 24px;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.6s forwards;
}

.onb-section-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  margin: 0 auto;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.8s forwards;
}


/* ============================================
   QUESTION LAYOUT
   ============================================ */

.onb-question-screen {
  max-width: 620px;
  margin: 0 auto;
  padding: 40px 24px 100px;
}

.onb-question-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.18em;
  margin-bottom: 8px;
  opacity: 0;
  animation: onb-fadeIn 0.3s ease forwards;
}

.onb-question-label {
  font-size: 1.4rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 12px;
  opacity: 0;
  animation: onb-fadeIn 0.4s ease 0.1s forwards;
}

.onb-question-prompt {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.7;
  margin-bottom: 28px;
  min-height: 1.7em;
}

.onb-question-context {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 2px solid rgba(124, 58, 237, 0.2);
  opacity: 0;
  animation: onb-fadeIn 0.4s ease 0.3s forwards;
}

.onb-question-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 12px;
  padding: 16px 18px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.onb-question-input::placeholder {
  color: rgba(255, 255, 255, 0.15);
}

.onb-question-input:focus {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
  outline: none;
}

@keyframes onb-slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ============================================
   ACTIONS / BUTTONS
   ============================================ */

.onb-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 12px;
}

.onb-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border: 1px solid rgba(124, 58, 237, 0.4);
  border-radius: 10px;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.onb-submit:hover {
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

.onb-submit:active {
  transform: translateY(0);
}

.onb-submit svg {
  transition: transform 0.3s;
}

.onb-submit:hover svg {
  transform: translateX(3px);
}

.onb-btn-prev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 10px;
  color: rgba(167, 139, 250, 0.7);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
}

.onb-btn-prev:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.3);
  color: #a78bfa;
}

.onb-btn-prev:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}


/* ============================================
   EXIT BUTTON (Continue Later)
   ============================================ */

.onb-exit-btn {
  position: fixed;
  top: 14px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: color 0.2s;
  z-index: 200;
  background: none;
  border: none;
  font-family: inherit;
  letter-spacing: 0.03em;
  -webkit-tap-highlight-color: transparent;
}

.onb-exit-btn:hover {
  color: rgba(167, 139, 250, 0.7);
}


/* ============================================
   PROGRESS BAR (fixed bottom)
   ============================================ */

.onb-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(124, 58, 237, 0.08);
  z-index: 200;
}

.onb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

.onb-progress-text {
  position: fixed;
  bottom: 10px;
  right: 16px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0.08em;
  z-index: 200;
}


/* ============================================
   SECTION COMPLETE (checkmark screen)
   ============================================ */

.onb-complete-screen {
  text-align: center;
  padding: 80px 24px;
}

.onb-complete-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10B981;
  animation: onb-stampIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onb-complete-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.3s forwards;
}

.onb-complete-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.5s forwards;
}


/* ============================================
   FINALE (completion screen)
   ============================================ */

.onb-finale {
  text-align: center;
  padding: 60px 24px;
  max-width: 500px;
  margin: 0 auto;
}

.onb-finale-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.08);
  border: 2px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: onb-stampIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onb-finale-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #10B981, #34D399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.3s forwards;
}

.onb-finale-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.7;
  margin-bottom: 32px;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.5s forwards;
}

.onb-finale-bar {
  width: 100%;
  height: 4px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 4px;
  margin-bottom: 24px;
  overflow: hidden;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.6s forwards;
}

.onb-finale-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #10B981, #34D399);
  border-radius: 4px;
  transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.onb-finale-redirect {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.1em;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.8s forwards;
}


/* ============================================
   REVIEW / SUMMARY (already completed view)
   ============================================ */

.onb-review-screen {
  max-width: 620px;
  margin: 0 auto;
  padding: 20px 24px 80px;
  width: 100%;
}

.onb-review-header {
  text-align: center;
  margin-bottom: 32px;
}

.onb-review-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: onb-stampIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onb-review-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 8px;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.2s forwards;
}

.onb-review-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.6;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.35s forwards;
}

.onb-review-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.5s forwards;
}

.onb-btn-review {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.onb-btn-review:hover {
  color: #a78bfa;
}

/* Answer Summary */
.onb-summary {
  margin-top: 8px;
  text-align: left;
  opacity: 0;
  animation: onb-fadeIn 0.5s ease 0.6s forwards;
}

.onb-summary-section {
  margin-bottom: 24px;
}

.onb-summary-section-title {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(167, 139, 250, 0.6);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}

.onb-summary-item {
  margin-bottom: 16px;
}

.onb-summary-q {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
}

.onb-summary-a {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.6;
  font-style: italic;
}

.onb-summary-empty {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.15);
  font-style: italic;
}


/* ============================================
   SCREEN TRANSITIONS
   ============================================ */

.onb-screen-enter {
  animation: onb-screenIn 0.5s ease;
}

@keyframes onb-screenIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onb-screen-exit {
  animation: onb-screenOut 0.3s ease forwards;
}

@keyframes onb-screenOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}


/* ============================================
   SCANLINE EFFECT
   ============================================ */

.onb-scanline {
  position: relative;
  overflow: hidden;
}

.onb-scanline::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.08), transparent);
  animation: onb-scan 1.5s ease-in-out;
}

@keyframes onb-scan {
  from { left: -100%; }
  to { left: 100%; }
}


/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
  .onb-terminal {
    border-radius: 12px;
  }

  .onb-terminal-body {
    padding: 16px;
    font-size: 0.78rem;
    min-height: 260px;
  }

  .onb-stamp {
    font-size: 1.2rem;
    padding: 10px 24px;
  }

  .onb-section-title {
    font-size: 1.3rem;
  }

  .onb-section-screen {
    padding: 50px 16px;
  }

  .onb-question-label {
    font-size: 1.15rem;
  }

  .onb-question-screen {
    padding: 24px 16px 100px;
  }

  .onb-question-input {
    min-height: 80px;
  }

  .onb-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .onb-submit {
    padding: 10px 22px;
    font-size: 0.84rem;
  }

  .onb-btn-prev {
    padding: 8px 16px;
    font-size: 0.78rem;
  }

  .onb-finale {
    padding: 40px 16px;
  }

  .onb-review-screen {
    padding: 16px 16px 80px;
  }
}


/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .onb-boot-line,
  .onb-stamp,
  .onb-section-code,
  .onb-section-title,
  .onb-section-desc,
  .onb-section-divider,
  .onb-section-number,
  .onb-question-code,
  .onb-question-label,
  .onb-question-context,
  .onb-question-input,
  .onb-actions,
  .onb-complete-icon,
  .onb-complete-title,
  .onb-complete-sub,
  .onb-finale-icon,
  .onb-finale-title,
  .onb-finale-text,
  .onb-finale-bar,
  .onb-finale-redirect,
  .onb-stamp-folder,
  .onb-stamp-subtitle,
  .onb-stamp-title,
  .onb-stamp-name,
  .onb-review-title,
  .onb-review-text,
  .onb-review-actions,
  .onb-review-icon,
  .onb-summary {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .onb-typewriter::after {
    animation: none !important;
    opacity: 0.5 !important;
  }
}
