/* ============================================
   Rev OS — Funnel Qualification
   DA Reeeve: #3385FF, Inter, Dark
   ============================================ */

:root {
  --bg: #0a0f1a;
  --bg-elevated: #111827;
  --blue: #3385FF;
  --blue-dim: rgba(51, 133, 255, 0.15);
  --blue-glow: rgba(51, 133, 255, 0.06);
  --white: #ffffff;
  --text: rgba(255, 255, 255, 0.9);
  --text-dim: rgba(255, 255, 255, 0.45);
  --text-muted: rgba(255, 255, 255, 0.25);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(51, 133, 255, 0.5);
  --radius: 12px;
  --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── App Container ── */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ── Background Effects ── */
.bg-glow {
  position: fixed;
  width: 800px;
  height: 400px;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, var(--blue-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow-secondary {
  position: fixed;
  width: 400px;
  height: 300px;
  top: 15%;
  right: 10%;
  background: radial-gradient(ellipse, rgba(51, 133, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Progress Bar ── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.progress-bar.visible {
  opacity: 1;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--blue);
  transition: width var(--transition);
  border-radius: 0 2px 2px 0;
}

/* ── Steps ── */
.steps-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.step {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(80px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.step.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.step.exit-left {
  opacity: 0;
  transform: translateX(-80px);
}

.step.exit-right {
  opacity: 0;
  transform: translateX(80px);
}

.step.enter-left {
  transform: translateX(-80px);
}

.step.enter-right {
  transform: translateX(80px);
}

.step-inner {
  width: 100%;
  max-width: 580px;
  padding: 24px;
}

/* ── Landing Screen ── */
.landing {
  text-align: center;
}

.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.logo-diamond {
  width: 28px;
  height: 28px;
  border: 2px solid var(--blue);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(45deg);
}

.logo-diamond-inner {
  width: 11px;
  height: 11px;
  border: 2px solid var(--blue);
  border-radius: 3px;
}

.logo-text {
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.landing-title {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--white);
  line-height: 1;
  margin-bottom: 16px;
}

.landing-subtitle {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.landing-detail {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 40px;
}

/* ── Step Content ── */
.step-counter {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.step-question {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 12px;
}

.step-detail {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.5;
}

/* ── Text Inputs ── */
.input-text,
.input-textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  color: var(--white);
  font-family: var(--font);
  font-size: 22px;
  font-weight: 500;
  padding: 16px 0;
  outline: none;
  transition: border-color 0.3s ease;
  margin-top: 20px;
}

.input-text::placeholder,
.input-textarea::placeholder {
  color: var(--text-muted);
}

.input-text:focus,
.input-textarea:focus {
  border-bottom-color: var(--blue);
}

.input-textarea {
  resize: none;
  line-height: 1.5;
  font-size: 18px;
  min-height: 120px;
}

/* ── Choice Cards ── */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.choice-card:hover {
  background: rgba(51, 133, 255, 0.06);
  border-color: rgba(51, 133, 255, 0.25);
}

.choice-card.selected {
  background: rgba(51, 133, 255, 0.1);
  border-color: var(--blue);
}

.choice-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.choice-card:hover .choice-key {
  border-color: rgba(51, 133, 255, 0.4);
  color: var(--blue);
}

.choice-card.selected .choice-key {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.choice-label {
  font-weight: 500;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--blue);
  color: var(--white);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background: #4d9aff;
  transform: translateY(-1px);
}

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

.btn-large {
  padding: 18px 36px;
  font-size: 17px;
  border-radius: 14px;
}

.step-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
}

.hint {
  font-size: 13px;
  color: var(--text-muted);
}

.hint kbd {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 12px;
}

/* ── Back Button ── */
.btn-back {
  position: fixed;
  bottom: 32px;
  left: 32px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.btn-back.visible {
  opacity: 1;
  pointer-events: auto;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

/* ── Result Screens ── */
.result-screen {
  text-align: center;
}

.result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-bottom: 24px;
}

.result-icon.qualified {
  background: rgba(51, 133, 255, 0.1);
  border: 2px solid rgba(51, 133, 255, 0.3);
}

.result-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--white);
  margin-bottom: 16px;
}

.result-text {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 36px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.btn-secondary-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.btn-secondary-link:hover {
  color: var(--white);
}

/* ── Loader ── */
.loader {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.loader-dot {
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
  animation: loaderPulse 1.2s ease-in-out infinite;
}

.loader-dot:nth-child(2) { animation-delay: 0.15s; }
.loader-dot:nth-child(3) { animation-delay: 0.3s; }

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

.loading-text {
  font-size: 17px;
  color: var(--text-dim);
}

/* ── Shake animation (validation error) ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.4s ease;
}

.input-error {
  border-bottom-color: #ef4444 !important;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .step-inner {
    padding: 20px;
  }

  .landing-title {
    font-size: 42px;
  }

  .landing-subtitle {
    font-size: 17px;
  }

  .landing-detail {
    font-size: 15px;
    margin-bottom: 32px;
  }

  .step-question {
    font-size: 24px;
  }

  .input-text {
    font-size: 18px;
  }

  .choice-card {
    padding: 14px 16px;
    font-size: 15px;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .step-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hint {
    text-align: center;
  }

  .btn-back {
    bottom: 20px;
    left: 20px;
  }

  .result-title {
    font-size: 26px;
  }

  .result-text {
    font-size: 15px;
  }
}

@media (max-width: 380px) {
  .landing-title {
    font-size: 36px;
  }

  .landing-logo {
    margin-bottom: 36px;
  }
}
