html {
  background-color: var(--primary-blue);
  /* This prevents the white flash or white overscroll artifacts */
}

:root {
  --primary-blue: #2C2C83;
  /* Your main brand color */
  --footer-blue: #252358;
  /* Slightly darker for the footer */
  --primary-violet: #7b67a7;
  --secondary-raspberry: #a2137b;
  --text-dark: #121212;
  --text-light: #ffffff;
  --glass-bg: var(--primary-violet);
  /* Solid violet for cards as requested */
  --glass-border: #252358;
  /* Dark blue border */
  --radius-lg: 24px;
  --radius-md: 16px;
  --transition-fast: all 0.2s ease;
  --transition-smooth: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Loader / Splash Screen --- */
#loader {
  position: fixed;
  inset: 0;
  background: var(--primary-blue);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Texture overlay for loader */
#loader::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('texture.svg');
  background-repeat: repeat;
  background-size: 2000px;
  opacity: 0.8;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: soft-light;
  filter: brightness(1.4) grayscale(1);
}

#loader .brand-line {
  z-index: 0;
  animation: slideFromRight 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

#loader .bg-annonceur {
  z-index: 0;
  animation: slideFromLeft 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes slideFromLeft {
  0% {
    transform: translateY(-50%) translateX(-50px);
    opacity: 0;
  }

  100% {
    transform: translateY(-50%) translateX(0);
    opacity: 0.04;
  }
}

@keyframes slideFromRight {
  0% {
    transform: translateX(50px);
    opacity: 0;
  }

  100% {
    transform: translateX(0);
    opacity: 0.06;
  }
}

@keyframes logoPopIn {
  0% {
    transform: scale(0.9);
    opacity: 0;
    filter: blur(10px);
  }

  100% {
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
  }
}

.loader-logo-large {
  position: relative;
  z-index: 2;
  width: 250px;
  animation: logoPopIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  position: relative;
  animation: loaderFadeIn 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes loaderFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
    filter: blur(10px);
  }

  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

.loader-logo-large {
  width: 280px;
  position: relative;
  z-index: 2;
}

.loader-line {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150%;
  opacity: 0.15;
  z-index: 1;
}

/* Base Layout */
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--primary-blue);
  color: var(--text-light);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  /* Match the footer overscroll color */
  background: linear-gradient(to bottom, var(--primary-blue) 0%, var(--primary-blue) 90%, var(--footer-blue) 100%);
}

/* --- Grain Texture Overlay --- */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('texture.svg');
  background-repeat: repeat;
  background-size: 2000px;
  opacity: 0.05;
  /* Drastically reduced to near invisibility */
  pointer-events: none;
  z-index: 0;
  /* Above body background, below content */
  mix-blend-mode: soft-light;
}

body.step1-active {
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('wallpaper.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Restore backgrounds only for Step 1 */
body.step1-active header {
  background: transparent;
  backdrop-filter: blur(20px);
}

body.step1-active footer {
  background: var(--footer-blue);
}

/* Lighten the hero card for better visibility */
body.step1-active .card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  border: none;
  /* Removed border */
}



@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(50px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

header {
  padding: 1.5rem 0;
  background: var(--primary-blue);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  color: white;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  height: 55px;
  width: auto;
  filter: brightness(0) invert(1);
  /* Ensure logo is white on violet background */
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  opacity: 0.7;
  transition: var(--transition-fast);
  font-size: 0.95rem;
}

.nav-link:hover {
  opacity: 1;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}


.btn {
  padding: 0.8rem 2rem;
  border-radius: 50px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  font-family: inherit;
  font-size: 1rem;
}

.btn-expand {
  background: transparent;
  border: none !important;
  color: white;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-expand:hover {
  opacity: 1;
  transform: scale(1.1);
}

.btn-primary {
  background: white;
  color: var(--primary-blue);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
}

.btn-secondary:hover {
  background: white;
  color: var(--primary-violet);
}

.step-section {
  padding: 4rem 0;
  display: none;
  /* Hidden by default */
  animation: fadeIn 0.6s ease-out;
  position: relative;
  z-index: 1;
  /* Above texture */
}

.brand-line {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 800px;
  width: auto;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
  transform: translateY(0) translateX(5%);
  display: block;
}

.step-section.active {
  display: block;
}

/* Card Styles */
/* --- Design System: Minimalist --- */
.card,
.bubble {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  transition: none;
  position: relative;
  overflow: hidden;
  /* Ensures any internal effects stay inside */
}

.bubble {
  padding: 1rem 1.75rem;
  border-radius: 50px;
}

.card>* {
  position: relative;
  z-index: 2;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-light);
}

input,
select,
textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  background: white !important;
  /* Pure white background */
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-dark) !important;
  /* Dark text for readability */
  font-size: 1rem;
  transition: var(--transition-fast);
  font-family: inherit;
}

#userEmail {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white !important;
}

#userEmail::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

input::placeholder,
textarea::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

/* More contrast */

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-violet);
  background: rgba(255, 255, 255, 0.1);
}

/* Validation States */
input.is-valid,
select.is-valid,
textarea.is-valid {
  border-color: #35337B !important; /* Unified with main brand color */
  box-shadow: 0 0 0 4px rgba(53, 51, 123, 0.1);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: #ffb3c1 !important; /* Very light pink instead of red */
  box-shadow: 0 0 0 4px rgba(255, 179, 193, 0.15);
}

select option {
  background: #1a1a1a;
  color: white;
}

/* Stepper Navigation */
.stepper-container {
  max-width: 800px;
  margin: 3.5rem auto 0.5rem;
  /* Reduced bottom margin */
  padding: 0 1rem;
  display: none;
  /* Initially hidden on Step 1 */
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 2;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.step-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.step-connector {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 1.2rem;
  /* Align with dots center horizontally */
  z-index: 1;
}

/* Active & Completed States */
.step-item.active .step-dot {
  background: var(--primary-violet);
  border-color: var(--primary-violet);
  color: white;
  transform: scale(1.1);
}

.step-item.active .step-label {
  color: white;
}

.step-item.completed .step-dot {
  background: rgba(123, 103, 167, 0.2);
  border-color: var(--primary-violet);
  color: var(--primary-violet);
}

.step-item.completed .step-label {
  color: rgba(255, 255, 255, 0.7);
}

.step-item:hover .step-dot {
  border-color: var(--primary-violet);
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 600px) {
  .step-label {
    display: none;
  }
}

/* Specific Step Styles */
.hero {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.5rem;
  color: white;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.95;
  /* More luminous */
  margin-bottom: 2.5rem;
  font-weight: 300;
}

.grid,
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  gap: 2.5rem;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {

  .grid,
  .result-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1.5rem;
  }

  .step-section {
    padding: 2.5rem 0;
  }
}

@media (max-width: 600px) {
  header .logo {
    height: 40px;
  }

  .nav-link {
    display: none;
    /* Simplify header for mobile */
  }

  .step-label {
    display: none;
  }

  .stepper-container {
    margin-top: 2rem;
  }
}

.result-grid {
  grid-template-columns: 1fr 1fr;
  /* Force 2 columns for final mockup */
  max-width: 1200px;
  margin: 0 auto;
}

.bus-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.bus-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.bus-card.selected {
  border: 2px solid var(--primary-violet);
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.filter-group label {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-bottom: 0;
}

.bubble-group {
  display: flex;
  flex-wrap: wrap;
  /* Allows bubbles to wrap for themes/sectors */
  gap: 0.75rem;
  margin-top: 1rem;
}

.bubble {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.bubble:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.bubble.active {
  background: var(--primary-violet);
  border-color: var(--primary-violet);
  box-shadow: 0 4px 20px rgba(123, 103, 167, 0.4);
}

.visual-group {
  gap: 1.5rem;
}

.visual-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  min-width: 220px;
  height: auto;
  border-radius: var(--radius-lg);
}

.visual-bubble img {
  width: 100%;
  max-width: 180px;
  height: 60px;
  object-fit: contain;
  opacity: 0.5;
  /* Reduced opacity */
  transition: var(--transition-smooth);
}

.visual-bubble:hover img {
  opacity: 0.8;
  /* Subtle highlight on hover */
}

.bubble-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.bubble-title {
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.info-icon {
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: help;
  transition: var(--transition-fast);
}

.info-icon:hover {
  background: var(--primary-violet);
  border-color: var(--primary-violet);
  transform: scale(1.1);
}

header {
  padding: 1.5rem 0;
  background: transparent;
  backdrop-filter: blur(20px);
  /* Strong blur */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 1001;
  /* Header always on top */
}

.audience-tooltip {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  background: rgba(123, 103, 167, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.2rem;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 400;
  color: white;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 9999;
  line-height: 1.5;
  text-align: center;
}

.info-icon:hover .audience-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Tooltip arrow */
.audience-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: rgba(123, 103, 167, 0.95) transparent transparent transparent;
}

.bubble-dim {
  font-size: 0.8rem;
  opacity: 0.6;
  font-weight: 400;
}


.gen-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.gen-card {
  text-align: center;
}

.gen-img {
  width: 100%;
  aspect-ratio: 16/9;
  background-image: url('wallpaper.png');
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-end;
  /* Text at the bottom */
  position: relative;
  overflow: hidden;
  border: none;
}

.gen-overlay {
  width: 100%;
  padding: 1.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  backdrop-filter: blur(5px);
  color: white;
  text-align: left;
}

.gen-overlay h3 {
  margin: 0;
  font-size: 1.1rem;
  color: white;
}

.gen-overlay p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.8;
}

footer {
  background: var(--footer-blue);
  color: white;
  padding: 4rem 0;
  margin-top: 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

footer img.logo {
  cursor: pointer;
}

footer p {
  opacity: 0.5;
  /* More transparent for a grayish look */
  font-weight: 300;
  color: var(--text-light);
}

/* --- Loader Refinement --- */
.loader-line {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  /* Spans full height */
  width: auto;
  opacity: 0.15;
  z-index: 1;
}

/* --- Mobile Utility --- */
#mobileFilterToggle {
  display: none;
  /* Hidden by default */
}

@media (max-width: 768px) {
  #mobileFilterToggle {
    display: inline-flex;
    align-items: center;
    width: 100%;
    justify-content: center;
    margin-bottom: 1rem;
  }

  .filters {
    display: none !important;
    flex-direction: column;
    gap: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
  }

  .filters.show {
    display: flex !important;
  }
}

/* --- Advertiser BG (Step 2+) --- */
.bg-annonceur {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 70vh;
  width: auto;
  opacity: 0.04;
  z-index: 0;
  /* Match texture z-index for visibility on Page 1 */
  pointer-events: none;
  display: block;
  transition: opacity 0.6s ease;
}

/* No longer hidden on Step 1 */
body.step1-active .bg-annonceur {
  display: block;
}

@media (max-width: 768px) {
  .bg-annonceur {
    height: 40vh;
    opacity: 0.02;
  }
}