/* ============================================================================
   NEXOO APP — BRIQUE 11B : ONBOARDING 4 ÉCRANS & ACTIVATION ACCÈS / CODES
   Dark Mode exclusif · Mobile-first (100dvh, inputs 16px anti-zoom iOS)
   ============================================================================ */

.nexoo-onb-overlay {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 85% 42% at 50% -6%, rgba(34, 197, 94, 0.22), transparent 65%),
    radial-gradient(circle at 85% 92%, rgba(57, 255, 20, 0.08), transparent 45%),
    #080e1c;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.nexoo-onb-overlay[hidden] {
  display: none !important;
}

.nexoo-onb-shell {
  width: 100%;
  max-width: 460px;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Barre supérieure : logo discret + étape + langue */
.nexoo-onb-topbar {
  width: 100%;
  max-width: 460px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.nexoo-onb-brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nexoo-onb-brand-mini img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.nexoo-onb-step-pill {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #39ff14;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Barre de progression 4 étapes */
.nexoo-onb-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.nexoo-onb-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e 0%, #39ff14 100%);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.45);
  transition: width 0.28s ease;
}

/* Carte principale */
.nexoo-onb-card {
  background: rgba(17, 26, 46, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  padding: 22px 20px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: nexooOnbFade 0.24s ease-out;
}

@keyframes nexooOnbFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nexoo-onb-eyebrow {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #22c55e;
  margin-bottom: 6px;
}

.nexoo-onb-title {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.nexoo-onb-sub {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #94a3b8;
}

/* Champs de saisie */
.nexoo-onb-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.nexoo-onb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nexoo-onb-label {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nexoo-onb-optional {
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
}

.nexoo-onb-input,
.nexoo-onb-select {
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0c1426;
  color: #f8fafc;
  font-size: 16px; /* Anti-zoom iOS */
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.nexoo-onb-input::placeholder {
  color: #64748b;
}

.nexoo-onb-input:focus,
.nexoo-onb-select:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.nexoo-onb-select option {
  background: #0c1426;
  color: #f8fafc;
}

/* Statut vérification pseudo en direct */
.nexoo-onb-pseudo-status {
  min-height: 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: #94a3b8;
}

.nexoo-onb-pseudo-status.ok {
  color: #4ade80;
}

.nexoo-onb-pseudo-status.err {
  color: #fca5a5;
}

.nexoo-onb-pseudo-status.checking {
  color: #7dd3fc;
}

/* Grilles de choix tactiles (niveaux / créneaux horaires) */
.nexoo-onb-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.nexoo-onb-pill {
  appearance: none;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0c1426;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.nexoo-onb-pill:hover {
  border-color: rgba(34, 197, 94, 0.45);
  background: #13203b;
}

.nexoo-onb-pill.active {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.16);
  color: #39ff14;
  box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.25) inset;
}

.nexoo-onb-pill:active {
  transform: scale(0.98);
}

/* Carte interrupteur WhatsApp (Écran 3) */
.nexoo-onb-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #0c1426;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.nexoo-onb-toggle-card.active {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
}

.nexoo-onb-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nexoo-onb-toggle-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #f8fafc;
}

.nexoo-onb-toggle-desc {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.4;
}

.nexoo-onb-switch {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
}

.nexoo-onb-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.nexoo-onb-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #243352;
  transition: background 0.2s ease;
}

.nexoo-onb-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f8fafc;
  transition: transform 0.2s ease;
}

.nexoo-onb-switch input:checked + .nexoo-onb-switch-track {
  background: #22c55e;
}

.nexoo-onb-switch input:checked + .nexoo-onb-switch-track::after {
  transform: translateX(20px);
}

.nexoo-onb-wa-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}

.nexoo-onb-wa-details[hidden] {
  display: none !important;
}

/* Écran 4 : Code Club / Découverte & Offre B2C */
.nexoo-onb-access-block {
  padding: 16px;
  border-radius: 16px;
  background: #0c1426;
  border: 1px solid rgba(34, 197, 94, 0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nexoo-onb-access-block-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nexoo-onb-access-block-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #94a3b8;
}

.nexoo-onb-code-row {
  display: flex;
  gap: 8px;
}

.nexoo-onb-code-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #111a2e;
  color: #39ff14;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  outline: none;
}

.nexoo-onb-code-input::placeholder {
  color: #64748b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: normal;
  font-weight: 500;
  text-transform: none;
}

.nexoo-onb-code-input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.nexoo-onb-code-btn {
  flex-shrink: 0;
  padding: 0 16px;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #04130a;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.16s ease, opacity 0.16s ease;
}

.nexoo-onb-code-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.nexoo-onb-code-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nexoo-onb-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 4px 0;
}

.nexoo-onb-divider::before,
.nexoo-onb-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.nexoo-onb-b2c-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(24, 36, 63, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nexoo-onb-b2c-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
  font-size: 11.5px;
  font-weight: 700;
}

/* Alertes et messages */
.nexoo-onb-alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  display: none;
}

.nexoo-onb-alert.visible {
  display: block;
}

.nexoo-onb-alert.error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.nexoo-onb-alert.success {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.38);
  color: #bbf7d0;
}

.nexoo-onb-alert.warn {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.36);
  color: #fde68a;
}

/* Boutons d'action bas de carte */
.nexoo-onb-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.nexoo-onb-btn-primary {
  flex: 1;
  min-height: 48px;
  padding: 12px 18px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #04130a;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.25);
  transition: transform 0.14s ease, filter 0.16s ease, opacity 0.16s ease;
}

.nexoo-onb-btn-primary:hover:not(:disabled) {
  filter: brightness(1.07);
}

.nexoo-onb-btn-primary:active:not(:disabled) {
  transform: scale(0.985);
}

.nexoo-onb-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nexoo-onb-btn-secondary {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(24, 36, 63, 0.72);
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.nexoo-onb-btn-secondary:hover:not(:disabled) {
  background: #18243f;
  border-color: rgba(255, 255, 255, 0.25);
}

.nexoo-onb-btn-ghost {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.nexoo-onb-btn-ghost:hover {
  color: #f8fafc;
}

/* Pied de page compte connecté */
.nexoo-onb-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 12.5px;
  color: #64748b;
}

.nexoo-onb-footer-logout {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.nexoo-onb-footer-logout:hover {
  color: #fecaca;
}

@media (max-width: 380px) {
  .nexoo-onb-code-row {
    flex-direction: column;
  }
  .nexoo-onb-code-btn {
    width: 100%;
  }
}