/* ==========================================================================
   MAVALA Career Fit Quiz - Modern Mobile UI/UX Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties / Design Tokens
   -------------------------------------------------------------------------- */
:root {
  --color-primary: #E03C1F;
  --color-primary-dark: #C52F14;
  --color-primary-light: #FFF2EF;
  --color-primary-border: #FCD6CE;
  --color-accent-gold: #F59E0B;
  --color-accent-green: #10B981;
  --color-accent-green-bg: #ECFDF5;
  --color-dark: #0F0F12;
  --color-card-dark: #18181F;
  --color-bg-page: #0C0C0F;
  --color-text-main: #111827;
  --color-text-muted: #6B7280;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Montserrat', 'Inter', sans-serif;
  --radius-card: 20px;
  --radius-btn: 14px;
  --desktop-scale: 1;
}

/* --------------------------------------------------------------------------
   2. Base & Typography Resets
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-page);
  color: var(--color-text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  user-select: none;
  touch-action: manipulation;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(224, 60, 31, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.08) 0%, transparent 50%);
}

@media (min-width: 640px) {
  :root {
    --desktop-scale: clamp(0.55, calc((100vh - 36px) / 840), 1);
    --desktop-scale: clamp(0.55, calc((100dvh - 36px) / 840), 1);
  }

  body {
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

.font-display {
  font-family: var(--font-display);
}

/* --------------------------------------------------------------------------
   3. Custom Smooth Scrollbars
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(224, 60, 31, 0.25);
  border-radius: 9999px;
}

/* --------------------------------------------------------------------------
   4. Desktop Compatibility Wrapper & Mobile App Shell Container
   -------------------------------------------------------------------------- */
.desktop-device-wrapper {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.mobile-app-shell {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
}

@media (min-width: 640px) {
  .desktop-device-wrapper {
    width: auto;
    min-height: 0;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
  }

  .mobile-app-shell {
    width: 414px;
    height: 840px;
    max-height: 840px;
    min-height: 0;
    border-radius: 44px;
    border: 7px solid #23232A;
    box-shadow: 
      0 30px 90px rgba(0, 0, 0, 0.75),
      0 0 0 1px rgba(255, 255, 255, 0.08);
    margin: auto;
    flex-shrink: 0;
    zoom: var(--desktop-scale, 1);
  }

  @supports not (zoom: 1) {
    .desktop-device-wrapper {
      width: calc(414px * var(--desktop-scale, 1));
      height: calc(840px * var(--desktop-scale, 1));
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      margin: auto;
    }
    .mobile-app-shell {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(var(--desktop-scale, 1));
      transform-origin: center center;
    }
  }
}

/* Phone Speaker & Dynamic Island simulation for desktop frame */
.mobile-top-notch {
  display: none;
}
@media (min-width: 640px) {
  .mobile-top-notch {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 8px;
    padding-bottom: 2px;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 40;
  }
  .dynamic-island-pill {
    width: 96px;
    height: 18px;
    background: #000000;
    border-radius: 20px;
  }
}

/* --------------------------------------------------------------------------
   5. Clean Mobile Header
   -------------------------------------------------------------------------- */
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #f1f2f4;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  outline: none;
  transition: transform 0.15s ease;
}
.brand-logo-link:active {
  transform: scale(0.96);
}

.brand-logo-img {
  display: block;
  width: 235px;
  max-width: 88vw;
  height: auto;
  object-fit: contain;
  background: transparent;
}

/* --------------------------------------------------------------------------
   6. Instagram-Style Story Progress Bar (4 Segments)
   -------------------------------------------------------------------------- */
.story-progress-container {
  display: flex;
  gap: 6px;
  width: 100%;
  padding: 0.5rem 0 1rem;
}

.story-progress-segment {
  flex: 1;
  height: 4px;
  border-radius: 9999px;
  background-color: #E5E7EB;
  overflow: hidden;
  position: relative;
}

.story-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #E03C1F 0%, #FF5A36 100%);
  border-radius: 9999px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.story-progress-segment.completed .story-progress-fill {
  width: 100%;
}

.story-progress-segment.active .story-progress-fill {
  width: 100%;
}

/* --------------------------------------------------------------------------
   7. Main Interactive Quiz Stage
   -------------------------------------------------------------------------- */
.quiz-main-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Red Branded Stage for Hero Screen */
.hero-stage {
  background: linear-gradient(165deg, #E03C1F 0%, #C92F14 55%, #15151A 100%);
  color: #ffffff;
  padding: 1.5rem 1.15rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  min-height: 100%;
}

/* Simplified 6 Career Tracks Showcase (Clean & Mobile-Friendly) */
.track-simple-box {
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.track-simple-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.track-simple-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  transition: all 0.2s ease;
  user-select: none;
}

.track-simple-card:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.track-simple-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

.track-simple-title {
  font-family: var(--font-display);
  font-size: 0.77rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

/* Modern Card Stage for Questions & Leads */
.card-stage {
  background-color: #F8F9FA;
  padding: 1rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

/* --------------------------------------------------------------------------
   8. Question Card & Options UX
   -------------------------------------------------------------------------- */
.quiz-card {
  background: #ffffff;
  border-radius: var(--radius-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  border: 1px solid #EAEBEF;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

/* Option Buttons for Mobile Thumbs */
.mobile-option-btn {
  width: 100%;
  min-height: 64px;
  text-align: left;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1.5px solid #E5E7EB;
  background-color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.mobile-option-btn:hover {
  border-color: rgba(224, 60, 31, 0.5);
  background-color: #FFF7F5;
  transform: translateY(-1px);
}

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

/* Active / Selected State */
.mobile-option-btn.selected {
  border-color: var(--color-primary);
  background-color: #FFF1EE;
  box-shadow: 0 0 0 3px rgba(224, 60, 31, 0.14), 0 4px 12px rgba(224, 60, 31, 0.08);
}

.option-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background-color: #F3F4F6;
  border: 1px solid #E5E7EB;
  color: #374151;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.mobile-option-btn:hover .option-badge,
.mobile-option-btn.selected .option-badge {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.option-radio-check {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  border: 2px solid #D1D5DB;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.mobile-option-btn.selected .option-radio-check {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   9. Primary Mobile CTA Buttons
   -------------------------------------------------------------------------- */
.mobile-primary-btn {
  width: 100%;
  min-height: 54px;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-btn);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: none;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(224, 60, 31, 0.28);
}

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

.btn-white {
  background-color: #ffffff;
  color: #0c0c0e;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
.btn-white:hover {
  background-color: #f8fafc;
}

.btn-red {
  background: linear-gradient(135deg, #E03C1F 0%, #C92F14 100%);
  color: #ffffff;
}
.btn-red:hover {
  opacity: 0.96;
}

/* --------------------------------------------------------------------------
   10. Form Input Fields (Mobile Friendly)
   -------------------------------------------------------------------------- */
.mobile-input-group {
  position: relative;
  margin-bottom: 1rem;
}

.mobile-input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mobile-text-input {
  width: 100%;
  height: 52px;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border-radius: 14px;
  border: 1.5px solid #E5E7EB;
  background-color: #FFFFFF;
  color: #111827;
  font-size: 0.95rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mobile-text-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(224, 60, 31, 0.12);
}

.input-icon-left {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  pointer-events: none;
  z-index: 10;
}

/* Phone input with flag & prefix */
.phone-input-wrapper {
  display: flex;
  gap: 8px;
}

.country-code-pill {
  height: 52px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1.5px solid #E5E7EB;
  background: #F9FAFB;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #374151;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   11. Results Screen Cards & Match Score Ring
   -------------------------------------------------------------------------- */
.result-header-card {
  background: linear-gradient(135deg, #FFF4F1 0%, #FFFFFF 100%);
  border-radius: 24px;
  border: 2px solid rgba(224, 60, 31, 0.2);
  padding: 1.5rem 1.25rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}

.result-header-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(224, 60, 31, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.match-percentage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  background-color: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #FCD6CE;
  color: var(--color-primary-dark);
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(224, 60, 31, 0.04);
}

.perks-card {
  background: #F9FAFB;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  border: 1px solid #E5E7EB;
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   12. Confetti Particle Canvas
   -------------------------------------------------------------------------- */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* --------------------------------------------------------------------------
   13. Animations & Transitions
   -------------------------------------------------------------------------- */
@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.step-enter {
  animation: stepFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(224, 60, 31, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(224, 60, 31, 0);
  }
}

.pulse-glow {
  animation: pulseGlow 2.4s infinite;
}

/* Safe area padding for iPhones and Android bars */
.mobile-safe-bottom {
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

/* MAVALA — polished intro and interaction */
.hero-stage {
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(255, 255, 255, 0.16),
      transparent 36%
    ),
    linear-gradient(155deg, #E03C1F 0%, #C52F14 62%, #7C2116 100%);
  padding: 1.25rem 1.1rem 1.35rem;
  gap: 0.95rem;
}

.track-simple-box {
  background: rgba(65, 13, 6, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 20px;
  padding: 0.85rem;
  box-shadow: 0 14px 32px rgba(75, 16, 8, 0.18);
}

.track-simple-grid {
  gap: 8px;
}

.track-simple-card {
  min-height: 62px;
  padding: 0.55rem 0.65rem;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.track-simple-card:hover,
.track-simple-card:focus-within {
  background: rgba(255, 255, 255, 0.19);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.track-simple-icon {
  font-size: 1.3rem;
}

.track-simple-title {
  font-size: 0.72rem;
  line-height: 1.35;
}

.mobile-primary-btn {
  min-height: 56px;
  border-radius: 16px;
  font-size: 0.93rem;
  letter-spacing: 0;
}

.btn-white {
  color: #9F2B18;
  box-shadow: 0 8px 22px rgba(60, 12, 5, 0.22);
}

.btn-white:hover {
  background: #FFF2EF;
}

.mobile-option-btn:focus-visible,
.mobile-primary-btn:focus-visible,
button:focus-visible {
  outline: 3px solid #F59E0B;
  outline-offset: 3px;
}

/* Allow users to select and copy text when needed. */
body {
  user-select: text;
  -webkit-user-select: text;
}

/* --------------------------------------------------------------------------
   Enrollment & Upskill Callout Card on Result Screen
   -------------------------------------------------------------------------- */
.enrollment-upskill-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(224, 60, 31, 0.22);
  background: linear-gradient(135deg, #fff7f5 0%, #fffdfa 50%, #ffffff 100%);
  border-radius: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.enrollment-upskill-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(224, 60, 31, 0.09);
}

@media (max-width: 360px) {
  .hero-stage {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .track-simple-grid {
    gap: 6px;
  }

  .track-simple-card {
    padding: 0.55rem;
  }

  .track-simple-title {
    font-size: 0.66rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

