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: 0px;
  --radius-md: 99px;
  --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: 20000;
  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.4;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
  filter: brightness(1.3) 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.4;
  /* Uniform opacity */
  pointer-events: none;
  z-index: 10000;
  /* Now covers the header and everything else */
  mix-blend-mode: overlay;
  filter: brightness(1.3) grayscale(1);
}

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;
}

/* Texture overlay sur step1 (par-dessus le wallpaper) - Standardized to 0.4 */
body.step1-active::before {
  opacity: 0.4;
  mix-blend-mode: overlay;
}

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

/* 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);
  position: sticky;
  top: 0;
  z-index: 1000;
  color: white;
  box-shadow: none;
}

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: var(--radius-md);
  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: var(--radius-md);
}

.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: 25px;
  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;
  margin-bottom: 2rem;
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.highlight-blue {
  background-color: var(--primary-blue);
  padding: 0.2rem 0.6rem;
  border-radius: 0;
  -webkit-text-fill-color: #fff !important;
  display: inline;
  line-height: 1.6;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

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

.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;
  justify-content: center;
}

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

.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.8rem;
}

.format-desc {
  font-size: 0.85rem;
  opacity: 0.6;
  line-height: 1.4;
  margin-top: 0.5rem;
}

.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(var(--header-blur, 0px));
  /* Controlled by JS */
  position: sticky;
  top: 0;
  z-index: 1001;
  /* Header always on top */
  box-shadow: none;
}

.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;
  background: transparent;
  border-radius: 0;
  padding: 0;
  outline: 3px solid transparent;
  outline-offset: 4px;
  transition: outline 0.3s ease;
  cursor: pointer;
}

.gen-img {
  width: 100%;
  /* Ratio dynamique via JS pour correspondre à Gemini */
  background-color: rgba(255, 255, 255, 0.05);
  background-image: none;
  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;
}

.result-overlay {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)) !important;
  backdrop-filter: blur(5px) !important;
  padding: 1rem 1.5rem !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  pointer-events: none;
}

.result-overlay * {
  pointer-events: auto; /* Re-enable for buttons */
}

.gen-overlay h3 {
  margin: 0;
  font-size: 1.1rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.label-city {
  font-size: 0.85em;
  opacity: 0.6;
  font-weight: 400;
}

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

footer {
  background: var(--primary-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) {
  .visual-group {
    flex-direction: column;
    align-items: center;
  }
}

/* --- 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;
  }
}
/* --- Auth Footer Styling (Discrete) --- */
/* --- New Premium Footer Layout --- */
footer {
  margin-top: 8rem;
  padding: 6rem 0 0 0;
  background: var(--footer-blue);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 100;
  text-align: left;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 5rem 2rem;
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 1fr 1.2fr;
  gap: 3rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.footer-col h4 {
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.9;
}

.footer-col ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.footer-col ul li {
  margin-bottom: 1rem;
  position: relative;
  list-style-type: none !important;
  list-style: none !important;
}

/* Force removal of any global bullet points, markers or custom pseudos */
.footer-col ul li::before,
.footer-col ul li::after,
.footer-col ul li::marker {
  content: none !important;
  display: none !important;
}

.footer-col ul li a, 
.footer-col ul li button.text-btn {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.footer-col ul li a:hover,
.footer-col ul li button.text-btn:hover {
  color: white;
  transform: translateX(5px);
}

.footer-logo {
  height: 45px;
  margin-bottom: 1.5rem;
  filter: brightness(0) invert(1);
}

.footer-tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 280px;
}

.footer-socials {
  display: flex;
  gap: 2rem;
}

.social-link {
  color: var(--primary-violet);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.social-link:hover {
  color: white;
  text-shadow: 0 0 10px var(--primary-violet);
}

.footer-auth-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem;
  border-radius: 12px;
  margin-top: 0.5rem;
  transition: all 0.3s ease;
}

.footer-auth-box:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.auth-status {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.status-pill {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-pill::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.status-pill.online::before {
  background: #00ff88;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

#userEmailDisplay {
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  opacity: 0.9;
  word-break: break-all;
}

.logout-pill {
  display: none; /* Managed by JS */
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin-top: 1.2rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  width: fit-content;
}

.logout-pill:hover {
  background: rgba(255, 50, 50, 0.1);
  border-color: rgba(255, 50, 50, 0.2);
  color: #ffb3b3;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
}

.status-dot.online {
  background: #00ff88;
  box-shadow: 0 0 10px #00ff88;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
  padding: 2rem 0;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.2);
  margin: 0;
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  margin-left: 15px;
  transition: color 0.2s;
}

.footer-bottom a:hover {
  color: white;
}

@media (max-width: 1024px) {
  .footer-container {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 2rem;
  }
  .footer-col.auth-col {
    grid-column: span 3;
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  footer {
    text-align: center;
    padding: 4rem 1rem 0 1rem;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .footer-col {
    align-items: center;
    text-align: center;
  }
  .footer-col.auth-col {
    grid-column: span 1;
  }
}

.btn-dashboard-admin:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(123, 103, 167, 0.5);
  background: #8b79b8;
}

@media (max-width: 1024px) {
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-brand, .footer-tools {
    justify-content: center;
    text-align: center;
  }
  .footer-brand p {
    margin: 0 auto;
  }
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4b4b; /* Not connected */
  box-shadow: 0 0 5px rgba(255, 75, 75, 0.5);
}

.status-dot.online {
  background: #00ff88; /* Connected */
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

/* --- Modal Styling --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--primary-blue);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 30000;
  opacity: 0;
  transition: opacity 0.5s ease;
  color: white;
}

.modal-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('texture.svg');
  background-repeat: repeat;
  background-size: 2000px;
  opacity: 0.4;
  pointer-events: none;
  mix-blend-mode: overlay;
  filter: brightness(1.3) grayscale(1);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-overlay .loader-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.modal-overlay h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

/* Loading spinner overlay */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--primary-violet);
  border-radius: 50%;
  animation: spinner 1s linear infinite;
  z-index: 10;
}

@keyframes spinner {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* AI Generation Progress Bar */
.gen-progress-container {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  text-align: center;
  z-index: 10;
  animation: fadeIn 0.5s ease;
}

.loading .gen-progress-container {
  display: block;
}

.gen-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.gen-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffffff 0%, var(--primary-violet) 100%);
  box-shadow: 0 0 20px rgba(123, 103, 167, 0.5);
  transition: width 0.4s cubic-bezier(0.1, 0.7, 1.0, 0.1);
}

.gen-progress-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.8;
}

.gen-progress-percent {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  margin-top: 5px;
  display: block;
}

/* Enhanced Erratic Shiny/Glow effect with Noise */
.skeleton-shiny {
  background-color: rgba(255, 255, 255, 0.05);
  background-image: 
    linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.15) 30%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.15) 70%, transparent 80%),
    linear-gradient(0deg, transparent 10%, rgba(255, 255, 255, 0.1) 50%, transparent 90%);
    
  background-size: 
    400% 400%,
    100% 300%;
    
  background-repeat: repeat;
  animation: erraticGlow 5s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
  pointer-events: none;
}

@keyframes erraticGlow {
  0% { 
      background-position: 150% 150%, 0% 0%; 
      box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05); 
  }
  25% { 
      background-position: 50% 100%, 0% 150%; 
      box-shadow: inset 0 0 35px rgba(255, 255, 255, 0.15); 
  }
  50% { 
      background-position: -50% 50%, 0% -50%; 
      box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.08); 
  }
  75% { 
      background-position: -150% 0%, 0% 50%; 
      box-shadow: inset 0 0 60px rgba(255, 255, 255, 0.3); 
  }
  100% { 
      background-position: -250% -50%, 0% 100%; 
      box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05); 
  }
}

/* Simple Action Spinner (for Step 5) */
.ai-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: var(--primary-violet);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  z-index: 20;
  pointer-events: none;
}

/* --- Barre de progression de génération --- */
.gen-progress-overlay {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  text-align: center;
  z-index: 20;
  pointer-events: none;
}

.gen-progress-bar-wrap {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}

.gen-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-violet), #b39ddb);
  border-radius: 99px;
  box-shadow: 0 0 12px rgba(123, 103, 167, 0.6);
  transition: width 0.4s ease-out;
}

.gen-progress-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 1px;
}


@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --- Notification System --- */
.notification-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(123, 103, 167, 0.95);
    backdrop-filter: blur(15px);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 30000;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    transform: translateY(150%) scale(0.9);
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

.notification-toast.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.notification-toast .btn-close-toast {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-left: 10px;
}

/* --- Integrated Terminal / Debug Panel --- */
.debug-terminal {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 450px;
    height: 300px;
    background: rgba(10, 10, 20, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    z-index: 25000;
    display: none;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    font-family: 'Fira Code', 'Courier New', monospace;
    transition: all 0.3s ease;
}

.debug-terminal.active {
    display: flex;
}

.debug-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.debug-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ff88;
}

.debug-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.debug-close:hover {
    opacity: 1;
}

.debug-output {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #00ff88;
}

.debug-line {
    margin-bottom: 6px;
    display: flex;
    gap: 10px;
}

.debug-timestamp {
    color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

.debug-msg {
    word-break: break-all;
}

.debug-error {
    color: #ff4444 !important;
}

.btn-show-logs {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 10px;
}

.btn-show-logs:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}


#step5 .card,
#step5 .gen-img,
#step5 .mockup-scene-wrapper,
#step5 .mockup-scene {
    border-radius: 0 !important;
}

.loading .ai-spinner {
    display: block;
}

.mockup-scene-wrapper {
    opacity: 1;
    transition: filter 0.4s ease;
}

.loading .mockup-scene-wrapper {
    filter: blur(12px) brightness(0.7);
}

/* Animations OTP */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}
