:root {
  --bg: #050509;
  --panel: rgba(17, 17, 25, 0.82);
  --cyan: #00eef2;
  --purple: #b56cff;
  --yellow: #ffbe25;
  --muted: #9b9ba8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: #ffffff;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

#splash {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 18% 12%,
      rgba(0, 210, 255, 0.18),
      transparent 29%
    ),
    radial-gradient(
      circle at 80% 8%,
      rgba(113, 45, 220, 0.22),
      transparent 32%
    ),
    linear-gradient(
      160deg,
      #071018,
      #090511 53%,
      #030305
    );
}

/* Barre supérieure */

.portal-header {
  height: 84px;
  padding: 14px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(3, 3, 7, 0.72);
  backdrop-filter: blur(18px);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.portal-brand img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.support-pill {
  display: flex;
  gap: 28px;
  padding: 15px 20px;
  border-radius: 16px;
  background: linear-gradient(
    100deg,
    #ffd43d,
    #ff9f1a
  );
  color: #0b0903;
  text-decoration: none;
  font-size: 14px;
}

/* Structure principale */

.stage {
  width: min(1240px, calc(100% - 36px));
  min-height: calc(100vh - 132px);
  margin: auto;
  padding: 56px 0;
  display: grid;
  grid-template-columns:
    minmax(0, 1.15fr)
    minmax(340px, 0.72fr);
  gap: 64px;
  align-items: center;
}

.public-intro {
  min-width: 0;
}

.hero-logo img {
  width: 118px;
  height: 118px;
  border-radius: 28px;
  box-shadow:
    0 0 55px rgba(0, 224, 255, 0.18);
}

.eyebrow {
  margin: 18px 0 0;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.cyan {
  color: var(--cyan);
}

.purple {
  color: var(--purple);
}

.hero-copy h1 {
  margin: 22px 0 18px;
  font-size: clamp(46px, 6vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy h1 span {
  color: var(--yellow);
}

.hero-text {
  max-width: 670px;
  color: #c5c5ce;
  font-size: 18px;
  line-height: 1.65;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0;
}

.trust-row span {
  padding: 9px 12px;
  border: 1px solid rgba(0, 238, 242, 0.18);
  border-radius: 999px;
  background: rgba(0, 238, 242, 0.06);
  color: #bffcff;
  font-size: 12px;
}

/* Cartes de présentation */

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 30px;
}

.feature-grid article {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(18, 18, 25, 0.64);
}

.feature-grid article > span {
  font-size: 23px;
}

.feature-grid strong {
  font-size: 14px;
}

.feature-grid p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* Formulaire de connexion */

.auth-panel {
  position: relative !important;
  z-index: 2 !important;
  width: 100% !important;
  padding: 30px !important;
  border: 1px solid rgba(0, 238, 242, 0.22) !important;
  border-radius: 28px !important;
  background:
    linear-gradient(
      150deg,
      rgba(20, 24, 34, 0.96),
      rgba(15, 9, 25, 0.96)
    ) !important;
  box-shadow:
    0 35px 100px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.auth-mobile-logo {
  display: none;
}

.auth-kicker {
  margin: 0;
  color: var(--cyan);
  font:
    800 11px
    ui-monospace,
    monospace;
  letter-spacing: 0.2em;
}

.auth-panel h2 {
  margin: 10px 0 8px;
  font-size: 30px;
}

.auth-lead {
  margin: 0 0 22px !important;
  color: var(--muted) !important;
}

.auth-view {
  margin-top: 18px;
}

.auth-view label {
  display: block;
  margin: 13px 0;
  color: #c5c5ce;
  font-size: 12px;
}

.auth-view input {
  width: 100%;
  height: 50px;
  margin-top: 7px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  outline: none;
  background: rgba(2, 2, 6, 0.52);
  color: #ffffff;
  font: inherit;
}

.auth-view input:focus {
  border-color: var(--cyan);
  box-shadow:
    0 0 0 3px rgba(0, 238, 242, 0.09);
}

.primary-action {
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  border: 0;
  border-radius: 14px;
  background:
    linear-gradient(
      100deg,
      #00eef2,
      #61f5c8
    );
  color: #001011;
  font-weight: 850;
  cursor: pointer;
}

.primary-action:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.form-message {
  min-height: 18px;
  font-size: 12px;
}

.form-message.error {
  color: #ff6680;
}

.privacy-note {
  margin: 18px 0 0 !important;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: #777784 !important;
  font-size: 11px !important;
  line-height: 1.5;
}

/* Espace affiché après connexion */

.workspace {
  display: none;
  width: min(760px, 100%);
}

body.authenticated .public-intro {
  display: none;
}

body.authenticated .stage {
  display: flex;
  justify-content: center;
}

body.authenticated .workspace {
  display: block;
}

body.authenticated .auth-panel {
  display: none !important;
}

.workspace-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 21px;
  background: var(--panel);
}

.workspace-head img {
  width: 58px;
  height: 58px;
  border-radius: 15px;
}

.workspace-head p {
  margin: 0;
  color: var(--cyan);
  font:
    750 10px
    ui-monospace,
    monospace;
  letter-spacing: 0.15em;
}

.workspace-head h1 {
  margin: 5px 0 0;
  font-size: 24px;
}

.live-badge {
  margin-left: auto;
  padding: 8px 10px;
  border: 1px solid rgba(66, 255, 159, 0.25);
  border-radius: 999px;
  color: #42ff9f;
  font-size: 10px;
}

.launch-panel {
  margin: 16px 0 !important;
}

.shield-strip {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 19px;
  border: 1px solid rgba(181, 108, 255, 0.22);
  border-radius: 19px;
  background: rgba(19, 14, 28, 0.78);
}

.shield-strip span {
  font-size: 25px;
}

.shield-strip p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.shield-strip b {
  margin-left: auto;
  color: var(--yellow);
  font-size: 10px;
}

/* Chargement */

.progress-track {
  overflow: hidden;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      var(--cyan),
      var(--purple)
    );
  box-shadow:
    0 0 18px rgba(0, 238, 242, 0.4);
  transition: width 180ms ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: #9999a7;
  font-size: 12px;
}

.splash-status {
  color: #c9c9d1;
}

/* L’utilisateur ne voit pas de message parlant de téléchargement */

#progress-percent {
  display: none;
}

/* Pied de page */

footer {
  padding: 0 20px 24px;
  text-align: center;
  color: #61616b;
  font-size: 11px;
}

/* Tablettes */

@media (max-width: 850px) {
  .portal-header {
    height: 72px;
    padding: 10px 18px;
  }

  .portal-brand span {
    display: none;
  }

  .support-pill span {
    display: none;
  }

  .stage {
    grid-template-columns: 1fr;
    padding: 32px 0;
    gap: 30px;
  }

  .public-intro {
    text-align: center;
  }

  .hero-logo img {
    width: 96px;
    height: 96px;
  }

  .hero-text {
    margin-left: auto;
    margin-right: auto;
  }

  .trust-row {
    justify-content: center;
  }

  .feature-grid {
    text-align: left;
  }

  .auth-panel {
    max-width: 520px;
    margin: auto;
  }
}

/* Téléphones */

@media (max-width: 560px) {
  .support-pill {
    padding: 12px 15px;
  }

  .hero-copy h1 {
    font-size: 44px;
  }

  .hero-text {
    font-size: 15px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    padding: 22px !important;
    border-radius: 22px !important;
  }

  .workspace-head {
    align-items: flex-start;
  }

  .workspace-head h1 {
    font-size: 19px;
  }

  .live-badge {
    display: none;
  }
}

/* =========================================================
   CORRECTIONS DE MISE EN PAGE — ÉTAPE 1.1
   ========================================================= */

/* Rétablit le défilement de la page d’accueil */

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body {
  height: auto !important;
}

#splash {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 100vh !important;
  overflow: visible !important;
}

/* En-tête et vraie bannière de soutien pleine largeur */

.portal-header {
  height: auto;
  min-height: 84px;
  padding: 14px 0 0;
  flex-wrap: wrap;
}

.portal-brand {
  margin-left: clamp(20px, 5vw, 72px);
}

.support-pill {
  order: 3;
  width: 100%;
  margin-top: 14px;
  padding: 16px clamp(20px, 5vw, 72px);
  justify-content: space-between;
  border-radius: 0;
}

/* Centre le logo et le bloc principal */

.hero-copy {
  text-align: center;
}

.hero-logo {
  display: flex;
  justify-content: center;
  width: 100%;
}

.hero-text {
  margin-right: auto;
  margin-left: auto;
}

.trust-row {
  justify-content: center;
}

/* Laisse suffisamment de place au bas de la page */

.stage {
  min-height: auto;
  padding-top: 56px;
  padding-bottom: 72px;
}

footer {
  position: relative !important;
  padding-top: 22px;
  padding-bottom: 30px;
}

/* Page de préparation parfaitement centrée */

body.authenticated .stage {
  min-height: calc(100vh - 155px);
  padding-top: 48px;
  padding-bottom: 56px;
  align-items: center;
}

.workspace {
  margin-right: auto;
  margin-left: auto;
}

.workspace-head {
  position: relative;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.workspace-head img {
  width: 72px;
  height: 72px;
  margin: 0 auto;
}

.workspace-head p {
  text-align: center;
}

.workspace-head h1 {
  max-width: 680px;
  margin: 10px auto 0;
  font-size: clamp(34px, 5vw, 58px) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.045em;
  text-align: center;
}

.live-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  margin: 0;
}

.launch-panel {
  text-align: center;
}

.panel-ready {
  text-align: center;
}

.start-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: min(550px, 100%) !important;
  min-height: 62px;
  margin-right: auto !important;
  margin-left: auto !important;
  text-align: center !important;
}

/* Cercle animé affiché pendant la préparation */

.panel-loading::before {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 24px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--cyan);
  border-right-color: var(--purple);
  border-radius: 50%;
  content: "";
  animation: delirium-spin 0.85s linear infinite;
  box-shadow:
    0 0 22px rgba(0, 238, 242, 0.18);
}

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

/* Ajustements téléphone et tablette */

@media (max-width: 850px) {
  .portal-header {
    height: auto;
    padding: 10px 0 0;
  }

  .portal-brand {
    margin-left: 18px;
  }

  .support-pill {
    margin-top: 10px;
    padding: 14px 18px;
  }

  .support-pill span {
    display: inline;
  }

  .stage {
    padding-top: 38px;
    padding-bottom: 64px;
  }

  body.authenticated .stage {
    padding: 30px 18px 50px;
  }
}

@media (max-width: 560px) {
  .support-pill {
    border-radius: 0;
  }

  .support-pill span {
    display: inline;
    font-size: 12px;
  }

  .support-pill strong {
    font-size: 12px;
  }

  .workspace-head h1 {
    font-size: 34px !important;
  }

  .live-badge {
    position: static;
    display: inline-flex;
    margin-top: 8px;
  }
}
/* Centre complètement le panneau de chargement */

.launch-panel {
  width: min(620px, 100%) !important;
  margin: 20px auto !important;
}

.panel-loading,
.panel-ready {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.panel-loading .progress-track {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
}

.panel-loading .progress-meta,
.panel-loading .splash-status {
  text-align: center;
}

.panel-loading .progress-meta {
  justify-content: center;
}

/* =========================================================
   BARRE PERMANENTE DELIRIIUM
   ========================================================= */

.delirium-browser-bar {
  position: fixed;
  z-index: 10000;
  top: 0;
  right: 0;
  left: 0;

  display: none;
  width: 100%;
  height: 56px;
  padding: 0 18px;

  align-items: center;
  gap: 22px;

  border-bottom: 1px solid rgba(0, 238, 242, 0.2);

  background:
    linear-gradient(
      100deg,
      rgba(5, 16, 23, 0.98),
      rgba(13, 7, 25, 0.98)
    );

  color: #ffffff;

  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.38);

  backdrop-filter: blur(18px);
}

/* La barre apparaît seulement une fois Gecko lancé */

body.browser-running .delirium-browser-bar {
  display: flex;
}

/* Logo et marque */

.browser-bar-brand {
  display: flex;
  align-items: center;
  gap: 10px;

  min-width: 170px;

  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.browser-bar-brand img {
  width: 38px;
  height: 38px;

  border-radius: 11px;

  box-shadow:
    0 0 18px rgba(0, 238, 242, 0.14);
}

/* État de protection */

.browser-protection-state {
  display: flex;
  align-items: center;
  gap: 10px;

  margin-right: auto;
}

.browser-protection-state > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.browser-protection-state strong {
  color: #ffffff;
  font-size: 12px;
}

.browser-protection-state small {
  color: #8f8f9d;
  font-size: 10px;
}

.protection-dot {
  width: 9px;
  height: 9px;

  flex: 0 0 9px;

  border-radius: 50%;

  background: #3dff9e;

  box-shadow:
    0 0 0 5px rgba(61, 255, 158, 0.08),
    0 0 14px rgba(61, 255, 158, 0.7);
}

/* Boutons de la barre */

.browser-bar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.browser-bar-button {
  min-height: 38px;
  padding: 0 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border: 1px solid rgba(0, 238, 242, 0.18);
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.045);
  color: #e9ffff;

  font-size: 11px;
  font-weight: 750;

  cursor: pointer;
}

.browser-bar-button:hover {
  border-color: rgba(0, 238, 242, 0.5);

  background:
    linear-gradient(
      100deg,
      rgba(0, 238, 242, 0.12),
      rgba(181, 108, 255, 0.12)
    );
}

.account-button {
  border-color: rgba(181, 108, 255, 0.24);
}

/* Réserve la place de la barre au-dessus de Gecko */

body.browser-running #screen.ready {
  width: 100vw !important;
  height: calc(100vh - 56px) !important;
  margin-top: 56px;
}

/* Version mobile */

@media (max-width: 650px) {
  .delirium-browser-bar {
    height: 50px;
    padding: 0 10px;
    gap: 10px;
  }

  .browser-bar-brand {
    min-width: auto;
  }

  .browser-bar-brand img {
    width: 34px;
    height: 34px;
  }

  .browser-bar-brand strong,
  .browser-protection-state small,
  .button-label {
    display: none;
  }

  .browser-protection-state {
    margin-right: auto;
  }

  .browser-bar-button {
    width: 38px;
    min-height: 36px;
    padding: 0;
  }

  body.browser-running #screen.ready {
    height: calc(100vh - 50px) !important;
    margin-top: 50px;
  }
}
