:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #050509;
  color: #f7f7fb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background: #050509;
}

body {
  min-height: 100vh;
  overflow: hidden;
  color: #f7f7fb;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

#screen {
  display: none;
  width: 100vw;
  height: 100vh;
  border: 0;
  outline: none;
  background: #fff;
}

#screen.ready {
  display: block;
}

#splash {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 18% 8%,
      rgba(0, 229, 240, 0.16),
      transparent 31%
    ),
    radial-gradient(
      circle at 85% 20%,
      rgba(110, 38, 207, 0.2),
      transparent 34%
    ),
    linear-gradient(
      160deg,
      #071017 0%,
      #080713 42%,
      #050509 72%
    );
}

#splash::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px
    );
  background-size: 42px 42px;
  mask-image:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.9),
      transparent 85%
    );
}

#splash.done {
  display: none;
}

.ambient {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.2;
  pointer-events: none;
}

.ambient-cyan {
  top: -190px;
  left: -100px;
  background: #00e7f0;
}

.ambient-purple {
  right: -160px;
  bottom: -190px;
  background: #7c2cff;
}

.top-nav {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 72px;
  padding: 14px clamp(20px, 4vw, 54px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(5, 5, 9, 0.56);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-symbol {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(0, 231, 240, 0.58);
  background:
    linear-gradient(
      145deg,
      rgba(0, 231, 240, 0.18),
      rgba(106, 38, 205, 0.2)
    );
  box-shadow:
    0 0 28px rgba(0, 231, 240, 0.16),
    inset 0 0 18px rgba(0, 231, 240, 0.08);
}

.brand-lock {
  color: #00edf3;
  font-size: 24px;
  transform: rotate(-12deg);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 18px;
  letter-spacing: 0.02em;
}

.brand-copy small {
  margin-top: 5px;
  color: #8d919c;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.prototype-badge {
  padding: 8px 13px;
  border: 1px solid rgba(255, 190, 46, 0.38);
  border-radius: 999px;
  color: #ffc342;
  background: rgba(255, 190, 46, 0.09);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 96px 22px 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-inner {
  width: 100%;
  max-width: 680px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.shield-orbit {
  position: relative;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  margin-bottom: 25px;
  border-radius: 50%;
  border: 1px solid rgba(0, 231, 240, 0.34);
  background:
    radial-gradient(
      circle,
      rgba(0, 231, 240, 0.18),
      rgba(111, 40, 205, 0.08) 58%,
      transparent 60%
    );
  box-shadow:
    0 0 48px rgba(0, 231, 240, 0.12),
    0 0 80px rgba(108, 42, 204, 0.1);
}

.shield-orbit::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border:
    1px solid rgba(120, 58, 220, 0.3);
  border-left-color: transparent;
  animation: orbit 5s linear infinite;
}

.shield-core {
  color: #00edf3;
  font-size: 39px;
  text-shadow: 0 0 20px rgba(0, 231, 240, 0.7);
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

.eyebrow {
  margin: 0 0 13px;
  color: #00dfe8;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.2em;
}

.splash-title {
  margin: 0;
  font-size: clamp(40px, 7vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.splash-title span {
  color: transparent;
  background:
    linear-gradient(
      90deg,
      #00edf3,
      #66d6ff 48%,
      #9d56ff
    );
  background-clip: text;
  -webkit-background-clip: text;
}

.project-copy {
  max-width: 580px;
  margin: 22px auto 0;
  color: #a6a7b0;
  font-size: clamp(14px, 2vw, 17px);
  line-height: 1.65;
}

.project-copy strong {
  color: #f5f5f8;
  font-weight: 650;
}

.launch-panel {
  width: min(100%, 520px);
  min-height: 118px;
  margin-top: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-loading,
.panel-ready {
  display: none;
  width: 100%;
}

#stage-card[data-phase="loading"] .panel-loading,
#stage-card[data-phase="ready"] .panel-ready,
#stage-card[data-phase="console"] .panel-ready {
  display: block;
}

.loading-card {
  width: 100%;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 17px;
  text-align: left;
  border: 1px solid rgba(0, 231, 240, 0.22);
  border-radius: 22px;
  background:
    linear-gradient(
      135deg,
      rgba(21, 25, 34, 0.86),
      rgba(14, 13, 23, 0.9)
    );
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.34),
    inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.loading-icon {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(0, 231, 240, 0.13);
  border-top-color: #00edf3;
  border-right-color: #8b47f5;
  animation: spin 1.15s linear infinite;
}

.loading-icon span {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      #00edf3,
      rgba(0, 231, 240, 0.05) 70%
    );
  box-shadow: 0 0 18px rgba(0, 231, 240, 0.5);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.loading-copy strong {
  color: #f6f6f9;
  font-size: 15px;
}

.loading-copy span {
  color: #8e929d;
  font-size: 13px;
  line-height: 1.4;
}

.hidden-progress {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.ready-state {
  margin-bottom: 13px;
  color: #63eba9;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.ready-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #4bf19a;
  box-shadow: 0 0 14px #4bf19a;
}

.start-btn {
  width: 100%;
  padding: 17px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  border-radius: 19px;
  color: #001316;
  background:
    linear-gradient(
      105deg,
      #00edf3,
      #2ee0ef 48%,
      #87bfff
    );
  box-shadow:
    0 16px 45px rgba(0, 231, 240, 0.18),
    inset 0 1px rgba(255, 255, 255, 0.35);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.start-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.07);
}

.start-btn:disabled {
  opacity: 0.58;
  cursor: wait;
}

.jspi-note {
  color: #ffca55;
  font-size: 13px;
  line-height: 1.5;
}

.privacy-line {
  margin-top: 26px;
  color: #777b86;
  font-size: 12px;
}

.privacy-line span {
  margin-right: 7px;
  color: #00edf3;
  text-shadow: 0 0 10px #00edf3;
}

.advanced,
.startup-console {
  display: none !important;
}

@media (max-width: 600px) {
  .top-nav {
    min-height: 64px;
    padding: 11px 16px;
  }

  .brand-copy small,
  .prototype-badge {
    display: none;
  }

  .stage {
    padding: 80px 18px 22px;
  }

  .shield-orbit {
    width: 72px;
    height: 72px;
    margin-bottom: 19px;
  }

  .splash-title {
    font-size: 43px;
  }

  .project-copy {
    margin-top: 17px;
  }

  .launch-panel {
    margin-top: 24px;
  }

  .loading-card {
    padding: 16px;
  }

  .privacy-line {
    max-width: 280px;
    line-height: 1.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shield-orbit::before,
  .loading-icon {
    animation: none;
  }
}

/* =========================================================
   DELIRIIUM — ÉCRAN DE PRÉPARATION
   ========================================================= */

:root {
  color-scheme: dark;
  --delirium-cyan: #00f0ff;
  --delirium-purple: #7c3cff;
  --delirium-black: #050509;
  --delirium-panel: rgba(15, 15, 24, 0.76);
}

html,
body {
  background: var(--delirium-black) !important;
}

/* Suppression complète de l’habillage technique d’origine */
.top-nav,
.logo-lockup,
.project-copy,
.powered-badge,
.progress-meta,
.splash-status,
.startup-console,
.advanced {
  display: none !important;
}

#splash {
  background:
    radial-gradient(circle at 18% 18%, rgba(0, 240, 255, 0.20), transparent 34%),
    radial-gradient(circle at 82% 15%, rgba(124, 60, 255, 0.24), transparent 38%),
    linear-gradient(155deg, #071119 0%, #090613 48%, #050509 100%) !important;
}

.stage {
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
}

.stage-inner {
  width: min(680px, 92vw) !important;
  text-align: center !important;
}

.stage-inner::before {
  content: "DELIRIIUM";
  display: block;
  margin-bottom: 22px;
  color: var(--delirium-cyan);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.34em;
  text-shadow: 0 0 22px rgba(0, 240, 255, 0.55);
}

.splash-title {
  margin: 0 !important;
  color: #ffffff !important;
  font-size: clamp(40px, 7vw, 76px) !important;
  font-weight: 750 !important;
  line-height: 0.98 !important;
  letter-spacing: -0.055em !important;
}

.splash-title::after {
  content: "Un espace de navigation privé, directement dans cet onglet.";
  display: block;
  max-width: 520px;
  margin: 24px auto 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: normal;
}

.launch-panel {
  position: relative !important;
  max-width: 520px !important;
  margin: 42px auto 0 !important;
  padding: 28px !important;
  overflow: hidden !important;
  border: 1px solid rgba(0, 240, 255, 0.20) !important;
  border-radius: 26px !important;
  background: var(--delirium-panel) !important;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
  backdrop-filter: blur(22px);
}

.panel-loading::before {
  content: "Ouverture de votre espace privé";
  display: block;
  margin-bottom: 18px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 650;
}

.panel-loading::after {
  content: "Préparation locale du navigateur sécurisé…";
  display: block;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 14px;
}

/* Animation volontairement indéterminée : aucun pourcentage visible */
.progress-track {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 7px !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.progress-fill {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 38% !important;
  border-radius: 999px !important;
  background: linear-gradient(
    90deg,
    var(--delirium-cyan),
    var(--delirium-purple),
    var(--delirium-cyan)
  ) !important;
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.52) !important;
  animation: delirium-loading 1.45s ease-in-out infinite !important;
}

@keyframes delirium-loading {
  from {
    left: -42%;
  }
  to {
    left: 104%;
  }
}

.start-btn {
  width: 100% !important;
  min-height: 58px !important;
  border: 0 !important;
  border-radius: 18px !important;
  color: #001014 !important;
  background: linear-gradient(100deg, #00f0ff, #33ffd1) !important;
  box-shadow: 0 14px 40px rgba(0, 240, 255, 0.22) !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
}

.jspi-note {
  margin-top: 16px !important;
  color: rgba(255, 255, 255, 0.66) !important;
}

@media (max-width: 600px) {
  .stage {
    padding: 18px !important;
  }

  .launch-panel {
    margin-top: 32px !important;
    padding: 22px !important;
    border-radius: 22px !important;
  }
}

[hidden] {
  display: none !important;
}

.auth-panel {
  position: fixed;
  z-index: 20;
  width: min(420px, calc(100vw - 36px));
  padding: 34px;
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 26px;
  background: rgba(10, 10, 17, 0.94);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(24px);
}

.auth-brand {
  margin-bottom: 20px;
  color: #00f0ff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.32em;
}

.auth-panel h1 {
  margin: 0 0 10px;
  color: white;
  font-size: 32px;
}

.auth-panel > p {
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.5;
}

.auth-panel label {
  display: block;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  text-align: left;
}

.auth-panel input {
  box-sizing: border-box;
  width: 100%;
  height: 52px;
  margin-top: 8px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  outline: none;
  color: white;
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
}

.auth-panel input:focus {
  border-color: #00f0ff;
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.10);
}

#auth-submit {
  width: 100%;
  height: 54px;
  margin-top: 22px;
  border: 0;
  border-radius: 15px;
  color: #001014;
  background: linear-gradient(100deg, #00f0ff, #38ffd0);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.auth-error {
  min-height: 20px;
  margin: 14px 0 0 !important;
  color: #ff718a !important;
  font-size: 13px;
}

body:not(.authenticated) #splash-shell {
  opacity: 0.10;
  pointer-events: none;
}
