/* ============================================
   MBF DRIFT AUDIT - Styles
   Mobile-first | Dark premium aesthetic
   ============================================ */

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

:root {
  --bg: #0A0A0A;
  --card: #1A1A1A;
  --accent: #afb4e3;
  --white: #FFFFFF;
  --gray: #A0A0A0;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  font-family: var(--font);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  background-color: #0a0a0a;
  background-image:
    repeating-linear-gradient(
      135deg,
      rgba(255,255,255,0.03) 0px,
      rgba(255,255,255,0.03) 1px,
      transparent 1px,
      transparent 50%
    ),
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.03) 0px,
      rgba(255,255,255,0.03) 1px,
      transparent 1px,
      transparent 50%
    );
  background-size: 6px 6px;
}

/* --- Logo Header --- */
.logo-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 8px 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
}

.mbf-logo {
  height: 44px;
  width: auto;
  display: inline-block;
}

/* Faint brand glow behind logo */

.logo-header::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 130px;
  background: radial-gradient(ellipse at center, rgba(175,180,227,0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* --- Screens --- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  z-index: 0;
  overflow-x: hidden;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* Spotlight glow - faint blue radial from top center */
.screen::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(175,180,227,0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.screen > * {
  position: relative;
  z-index: 1;
}

.screen-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 168px 24px 40px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- Intro Screen --- */
.intro-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  align-items: center;
}

.brand-wordmark {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.intro-text-card {
  background: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  padding: 28px 24px;
  margin: 0 auto 48px;
  max-width: 420px;
  width: 100%;
}

.content-card {
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  padding: 28px 24px;
  margin: 0 auto 24px;
  max-width: 420px;
  width: 100%;
  box-sizing: border-box;
}

.intro-rule {
  border: none;
  border-top: 1px solid rgba(175, 180, 227, 0.4);
  width: 80%;
  margin: 12px auto;
  display: block;
}

.intro-headline {
  font-size: 42px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 6px;
  text-shadow: 0 0 40px rgba(175, 180, 227, 0.3);
  margin-bottom: 16px;
}

.intro-sub {
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray);
  margin-bottom: 0;
}

.intro-detail {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
  text-align: center;
  margin-top: 16px;
}

#start-btn {
  margin-top: 32px;
}

/* Staggered fade-in on page load */
.intro-stagger {
  opacity: 0;
  transform: translateY(12px);
}

.intro-stagger:nth-child(1) { animation-delay: 0.1s; }

/* Button and detail line are outside intro-content */
#start-btn.intro-stagger {
  animation-delay: 0.4s;
}

.intro-detail.intro-stagger {
  animation-delay: 0.55s;
}

.arrow-pulse {
  display: inline-block;
}

/* --- Honesty Screen --- */
#honesty,
#result {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#honesty .screen-inner {
  flex: none;
  height: auto;
  min-height: unset;
  overflow: visible;
  padding-bottom: 60px;
  justify-content: flex-start;
  opacity: 0;
  transform: translateY(12px);
}

#honesty.active .screen-inner {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease-out 0.1s, transform 0.35s ease-out 0.1s;
}

.honesty-content {
  display: flex;
  flex-direction: column;
}

.honesty-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.honesty-headline {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 24px;
}

.honesty-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.honesty-body p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--gray);
}

/* --- Integrity Checkbox --- */
.integrity-check {
  margin: 24px 0 20px;
  text-align: left;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
}

.checkbox-custom {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid rgba(175, 180, 227, 0.4);
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-top: 2px;
}

.checkbox-label input:checked + .checkbox-custom {
  background: #afb4e3;
  border-color: #afb4e3;
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '\2713';
  color: #0a0a0a;
  font-size: 14px;
  font-weight: 900;
}

.checkbox-text {
  color: #a0a0a0;
  font-size: 13px;
  line-height: 1.6;
}

input[type="checkbox"] {
  display: none;
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

/* --- Primary Button --- */
.btn-primary {
  display: block;
  width: 100%;
  padding: 18px 32px;
  background: var(--accent);
  color: #000;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(175, 180, 227, 0.4);
}

.btn-primary:hover {
  background: #c0c4ec;
  box-shadow: 0 0 28px rgba(175, 180, 227, 0.55);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.2s ease;
}

.btn-primary:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease-out 0.08s, transform 0.2s ease-out 0.08s, background 0.2s ease;
}

/* --- Progress Bar --- */
.progress-bar-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.06);
  z-index: 101;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(175, 180, 227, 0.6), 0 0 20px rgba(175, 180, 227, 0.3);
}

/* --- Quiz Screen --- */
.quiz-inner {
  justify-content: flex-start;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-sizing: border-box;
  padding-top: 168px;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 80px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.question-counter {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.question-text {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.3px;
  margin-bottom: 0;
}

/* --- Option Cards --- */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

.option-card {
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  background: rgba(175, 180, 227, 0.06);
  border: 1px solid rgba(175, 180, 227, 0.25);
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 14px 18px;
  cursor: pointer;
  min-height: 48px;
  text-align: left;
  margin: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: border-color 0.2s ease, border-left-color 0.2s ease, background 0.2s ease, transform 0.15s ease, opacity 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.option-card.card-visible {
  opacity: 1;
  transform: translateY(0);
}

.option-card:hover {
  background: rgba(175, 180, 227, 0.1);
  border-top-color: rgba(175, 180, 227, 0.5);
  border-right-color: rgba(175, 180, 227, 0.5);
  border-bottom-color: rgba(175, 180, 227, 0.5);
}

.option-card:active {
  transform: scale(0.985);
}

.option-card.selected {
  background: rgba(175, 180, 227, 0.15);
  border-color: #afb4e3;
  border-left-color: #afb4e3;
}

.option-card p {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--gray);
  transition: color 0.2s ease;
}

.option-card.selected p {
  color: var(--white);
}

/* Quiz content slide transition - exit left, enter from right */
.quiz-inner.slide-out .content-card,
.quiz-inner.slide-out .options-container {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.quiz-inner.slide-in .content-card,
.quiz-inner.slide-in .options-container {
  opacity: 0;
  transform: translateX(24px);
}

.quiz-inner .content-card,
.quiz-inner .options-container {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* --- Result Screen --- */
.result-inner {
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding-top: 168px;
  overflow-y: auto;
}

/* Score ring */
.score-ring-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  margin-bottom: 24px;
}

.score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 6;
}

.score-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 553;        /* 2 * PI * 88 */
  stroke-dashoffset: 553;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 6px rgba(175, 180, 227, 0.5));
}

/* Pulse class applied via JS - animation defined in motion media query */

.score-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 88px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -2px;
}

.score-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 20px;
}

.result-score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.result-divider {
  border: none;
  height: 1px;
  width: 60px;
  background: rgba(175, 180, 227, 0.4);
  margin-bottom: 24px;
}

.result-tier {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 1.15;
  margin-top: 8px;
  margin-bottom: 16px;
  color: var(--accent);
}

.result-description {
  font-size: 15px;
  line-height: 1.65;
  color: var(--gray);
  max-width: 360px;
  margin-bottom: 28px;
  padding-bottom: 32px;
  text-align: left;
}

.result-description p {
  margin-bottom: 18px;
}

.result-description p:last-child {
  margin-bottom: 0;
  color: var(--white);
  font-weight: 600;
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}

.social-proof {
  font-size: 13px;
  font-style: italic;
  color: var(--gray);
  margin-top: 28px;
  margin-bottom: 16px;
}

.cta-btn {
  flex-shrink: 0;
}

.cta-urgency {
  font-size: 12px;
  line-height: 1.55;
  color: var(--gray);
  text-align: center;
  margin-top: 12px;
  margin-bottom: 20px;
  max-width: 340px;
}



/* --- CTA shimmer --- */
.cta-btn {
  position: relative;
  overflow: hidden;
}

.cta-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.15),
    transparent
  );
  pointer-events: none;
}

/* --- All keyframe animations - respect reduced motion --- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes intro-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .intro-stagger {
    animation: intro-fade-in 0.3s ease-out forwards;
  }

  @keyframes arrow-nudge {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50%      { transform: translateX(4px); opacity: 0.6; }
  }

  .arrow-pulse {
    animation: arrow-nudge 1.8s ease-in-out infinite;
  }

  @keyframes ring-pulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(175, 180, 227, 0.5)); }
    50%      { filter: drop-shadow(0 0 18px rgba(175, 180, 227, 0.8)); }
  }

  .score-ring-fill.pulse {
    animation: ring-pulse 2.4s ease-in-out infinite;
  }

  @keyframes card-select-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.02); }
    100% { transform: scale(1); }
  }

  .option-card.select-pulse {
    animation: card-select-pulse 0.12s ease-out;
  }

  @keyframes cta-shimmer {
    0%   { left: -100%; }
    100% { left: 120%; }
  }

  .cta-btn::after {
    animation: cta-shimmer 3s ease-in-out infinite;
  }
}

/* Reduced motion - disable animations, show content immediately */
@media (prefers-reduced-motion: reduce) {
  .intro-stagger {
    opacity: 1;
    transform: none;
  }
  .arrow-pulse {
    animation: none;
  }
  .score-ring-fill.pulse {
    animation: none;
  }
  .option-card {
    opacity: 1;
    transform: none;
  }
  #honesty .screen-inner {
    opacity: 1;
    transform: none;
  }
  .cta-btn::after {
    animation: none;
  }
}

/* --- Responsive - small screens need breathing room --- */
@media (max-width: 390px) {
  .result-inner {
    padding-left: 28px;
    padding-right: 28px;
  }
  .screen-inner,
  .quiz-inner,
  .result-inner {
    padding-top: 148px;
  }
}

/* --- Responsive - larger screens get more room --- */
@media (min-width: 600px) {
  .intro-headline {
    font-size: 52px;
  }
  .question-text {
    font-size: 26px;
  }
  .score-number {
    font-size: 100px;
  }
}
