:root, [data-theme="nebula-dark"] {
  --bg: #050816;
  --surface: rgba(18, 24, 60, 0.24);
  --surface-strong: rgba(18, 24, 60, 0.52);
  --glass: rgba(12, 18, 48, 0.28);
  --glass-border: rgba(215, 223, 255, 0.14);
  --accent: #8b87ff;
  --accent-gradient: linear-gradient(135deg, rgba(147, 141, 255, 0.96), rgba(101, 121, 255, 0.82));
  --text: #f8f9ff;
  --text-muted: #b4baff;
  --shadow: rgba(6, 10, 28, 0.38);
  --input-bg: rgba(15, 20, 50, 0.28);
}

* { box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; -webkit-tap-highlight-color: transparent; }
body { background: radial-gradient(circle at top, rgba(96, 120, 255, 0.12), transparent 22%), radial-gradient(circle at bottom right, rgba(141, 147, 255, 0.1), transparent 20%), var(--bg); color: var(--text); overflow: hidden; transition: background 0.3s ease; }

html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
}

header {
  width: 100%;
  height: 80px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid var(--glass-border) !important;
  box-shadow: none !important;
  position: relative;
  z-index: 40;
}

header .icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
header .icon-btn:hover {
  background: var(--surface-strong);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.spatial-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(circle at 20% 15%, rgba(126, 125, 255, 0.14), transparent 32%),
              radial-gradient(circle at 85% 25%, rgba(100, 120, 255, 0.12), transparent 28%),
              radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.06), transparent 18%);
  filter: blur(18px);
}

.auth-modal-shell {
  position: relative;
  width: min(100%, 520px);
  max-width: 520px;
  margin: 0 auto;
}
.auth-modal-shell::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 38px;
  background: linear-gradient(135deg, rgba(158, 147, 255, 0.48), rgba(121, 95, 255, 0.28), rgba(177, 227, 255, 0.18));
  filter: blur(22px);
  opacity: 0.88;
  pointer-events: none;
}
.auth-modal-shell::after {
  content: '';
  position: absolute;
  top: -10px;
  right: -16px;
  width: 120px;
  height: 260px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 65%);
  transform: rotate(22deg);
  filter: blur(20px);
  opacity: 0.55;
  pointer-events: none;
}
.auth-modal-card {
  position: relative;
  background: rgba(12, 18, 45, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 40px 105px rgba(2, 6, 30, 0.30);
  border-radius: 36px;
  backdrop-filter: blur(42px);
  -webkit-backdrop-filter: blur(42px);
  overflow: hidden;
  background-clip: padding-box;
  max-height: min(82vh, 720px);
  padding: 1.5rem 1.5rem;
}

#authModal {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 1rem;
  overflow: hidden;
}

.auth-modal-shell {
  max-height: calc(100vh - 2rem);
}
.auth-modal-card {
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding-bottom: 1rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.auth-modal-card::-webkit-scrollbar {
  width: 0;
  height: 0;
}

@media (max-width: 640px) {
  #authModal {
    align-items: flex-start;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
  }
  .auth-modal-shell {
    width: min(100%, 96vw);
    max-height: calc(100vh - 1rem);
  }
  .auth-modal-card {
    padding: 0.95rem 0.95rem 1.1rem;
    max-height: calc(100vh - 2rem);
  }
  .auth-modal-card .space-y-2 h2 {
    font-size: 1.55rem;
  }
  .auth-modal-card .space-y-2 p {
    font-size: 0.82rem;
  }
  .auth-modal-card .space-y-6 > * + * {
    margin-top: 0.75rem;
  }
  .input-premium {
    padding: 10px 12px;
  }
  .btn-gradient {
    padding: 10px 14px;
    font-size: 0.84rem;
  }
  .btn-flat {
    padding: 10px 14px;
  }
  .section-carousel {
    flex-wrap: nowrap;
    gap: 0.3rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding: 12px;
  }
  .section-pill {
    min-width: 78px;
    padding: 6px 10px;
    font-size: 0.68rem;
  }
  .auth-modal-card .diamond-sparkle {
    top: 12px;
    right: 12px;
    width: 16px;
    height: 16px;
  }
  .auth-modal-card .light-streak {
    top: 14px;
    left: -18px;
    width: 88px;
    height: 200px;
  }
}
.auth-modal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 38%);
  pointer-events: none;
}
.auth-modal-card .diamond-sparkle {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 56%);
  filter: blur(0.8px);
  opacity: 0.96;
  pointer-events: none;
}
.auth-modal-card .diamond-sparkle::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 60%);
  mix-blend-mode: screen;
  border-radius: 50%;
  transform: rotate(45deg);
}
.auth-modal-card .light-streak {
  position: absolute;
  top: 22px;
  left: -28px;
  width: 118px;
  height: 280px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0) 72%);
  transform: rotate(-18deg);
  filter: blur(14px);
  opacity: 0.56;
  pointer-events: none;
}
.glass-card {
  background: linear-gradient(145deg, rgba(12, 18, 45, 0.22), rgba(20, 28, 68, 0.38));
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(52px);
  -webkit-backdrop-filter: blur(52px);
  box-shadow: 0 45px 120px rgba(2, 6, 30, 0.30);
  border-radius: 36px;
  background-clip: padding-box;
}
.surface-card {
  background: rgba(16, 20, 52, 0.18);
  border: 1px solid rgba(215, 223, 255, 0.10);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

#appNavigationHub {
  background: rgba(12, 16, 38, 0.24) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(42px) !important;
  -webkit-backdrop-filter: blur(42px) !important;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18) !important;
}

.scroll-container { height: calc(100vh - 80px); overflow-y: auto; padding: 24px 24px 120px; }
.scroll-container::-webkit-scrollbar { width: 6px; }
.scroll-container::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 99px; }

.theme-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 900px) {
  .theme-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  .theme-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.theme-skeleton {
  min-height: 170px;
  position: relative;
  overflow: hidden;
}

.theme-skeleton::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  opacity: 0.7;
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-line,
.skeleton-button {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.skeleton-line {
  height: 14px;
}

.skeleton-button {
  height: 42px;
}

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.page-view { position: absolute; inset: 0; opacity: 0; pointer-events: none; transform: scale(0.98) translateY(10px); transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.page-view.active { opacity: 1; pointer-events: auto; transform: scale(1) translateY(0); }

.input-premium { 
  width: 100%; 
  border-radius: 16px; 
  border: 1px solid rgba(143, 155, 255, 0.16); 
  background: var(--input-bg); 
  color: var(--text); 
  padding: 14px 18px; 
  font-size: 0.9rem; 
  outline: none; 
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); 
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.input-premium:focus { 
  border-color: rgba(127, 125, 255, 0.95); 
  background: rgba(18, 24, 58, 0.72); 
  box-shadow: 0 0 0 3px rgba(127, 125, 255, 0.16); 
}
.input-premium::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

select.input-premium option {
  background-color: #0c0a09 !important;
  color: #f8fafc !important;
}

.section-carousel {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-padding-left: 1rem;
  width: 100%;
}
.section-carousel::-webkit-scrollbar {
  height: 5px;
}
.section-carousel::-webkit-scrollbar-thumb {
  background: rgba(167, 152, 255, 0.28);
  border-radius: 999px;
}
.section-pill {
  min-width: 104px;
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(167, 152, 255, 0.18);
  background: rgba(139, 135, 255, 0.08);
  color: #e8e8ff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
  scroll-snap-align: start;
}
.section-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(167, 152, 255, 0.35);
  background: rgba(139, 135, 255, 0.14);
}
.section-pill:active {
  transform: translateY(0);
}

.product-step-pill {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border-radius: 18px;
  padding: 12px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-step-pill:hover {
  background: rgba(255, 255, 255, 0.1);
}

.product-step-pill.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 16px 32px rgba(79, 70, 229, 0.18);
}

.btn-gradient { background: var(--accent-gradient); color: #fff; border-radius: 18px; padding: 14px 26px; font-weight: 700; font-size: 0.92rem; transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: none; cursor: pointer; box-shadow: 0 18px 45px rgba(90, 100, 255, 0.2); }
.btn-gradient:hover { opacity: 0.98; transform: translateY(-2px); box-shadow: 0 22px 55px rgba(90, 100, 255, 0.24); }
.btn-gradient:disabled { opacity: 0.4; transform: none; cursor: not-allowed; }

.btn-flat { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); color: var(--text); border-radius: 18px; padding: 14px 24px; font-weight: 600; font-size: 0.9rem; transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.btn-flat:hover { background: rgba(255,255,255,0.12); }

.badge-highlight { position: relative; background: linear-gradient(180deg, rgba(79, 70, 229, 0.14), rgba(255,255,255,0.04)); }
.badge-highlight::before { content: 'Meilleur choix'; position: absolute; top: 1rem; right: 1rem; font-size: 0.65rem; letter-spacing: 0.18em; text-transform: uppercase; color: #c7d2fe; background: rgba(99,102,241,0.18); padding: 0.35rem 0.75rem; border-radius: 999px; backdrop-filter: blur(8px); }

.badge-selectable { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 0.85rem; transition: all 0.2s; display: flex; align-items: center; gap: 8px; }
.badge-selectable.selected { border-color: var(--accent); background: rgba(168,85,247,0.15); color: #fff; font-weight: 600; }

.nav-pill { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all 0.3s; position: relative; }
.nav-pill:hover { color: var(--text); background: var(--surface); }
.nav-pill.active { color: #fff; background: var(--accent-gradient); }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#bottomSheet {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
}
#bottomSheet.open { pointer-events: auto; }
#bottomSheetOverlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
#bottomSheet.open #bottomSheetOverlay {
  opacity: 1;
  pointer-events: auto;
}
#bottomSheetCard {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 99995;
  transform: translate(-50%, 100%);
  width: min(100%, 720px);
  padding: 0 1rem 1.2rem;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}
#bottomSheet.open #bottomSheetCard {
  transform: translate(-50%, 0);
}
#bottomSheetCard .sheet-handle {
  width: 56px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  margin: 0 auto 14px;
}
#bottomSheetCard .sheet-title {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.68rem;
  color: rgba(167, 152, 255, 0.92);
}
#bottomSheetCard .sheet-body {
  color: #dce0ff;
  line-height: 1.75;
  max-height: 52vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 140, 255, 0.45) transparent;
}
#bottomSheetCard .sheet-body::-webkit-scrollbar {
  width: 6px;
}
#bottomSheetCard .sheet-body::-webkit-scrollbar-thumb {
  background: rgba(167, 152, 255, 0.45);
  border-radius: 999px;
}
