/* ═══════════════════════════════════════════════════════════
   KLAMPAC — Espace client : connexion / inscription / code de confirmation
   Design épuré, spacieux, ultra-professionnel (style Nike / KLAMPAC)
   ═══════════════════════════════════════════════════════════ */
.kla {
  font-family: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  color: var(--kl-ink, #111A33);
  padding: 28px 16px 60px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 160px);
}
.kla[hidden], .kla.hidden { display: none !important; }
.kla *, .kla *::before, .kla *::after { box-sizing: border-box }

.kla-card {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 420px 1fr;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 25px 50px -12px rgba(30, 47, 101, 0.12), 0 0 1px 1px rgba(0, 0, 0, 0.03);
}

/* Panneau gauche : visuel (logo + mannequin en tenue KLAMPAC qui change doucement) */
.kla-visual {
  position: relative;
  min-height: 580px;
  overflow: hidden;
  background: linear-gradient(150deg, #FFFFFF 0%, #EDF2FA 50%, #DDE5F5 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
}
.kla-logo {
  position: absolute;
  top: 32px;
  left: 32px;
  z-index: 3;
  height: 48px;
  width: auto;
  object-fit: contain;
}
.kla-tag {
  position: absolute;
  left: 32px;
  top: 92px;
  z-index: 3;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kl-blue, #1E2F65);
  box-shadow: 0 2px 8px rgba(30, 47, 101, 0.06);
}
.kla-figs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 70px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.kla-figs::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 8px;
  height: 24px;
  background: radial-gradient(closest-side, rgba(17, 26, 51, 0.22), transparent);
  pointer-events: none;
}
.kla-figs img {
  position: absolute;
  bottom: 12px;
  left: 50%;
  height: 85%;
  max-height: 470px;
  width: auto;
  max-width: 90%;
  object-fit: contain;
  object-position: 50% 100%;
  transform: translateX(-50%) translateY(14px) scale(0.98);
  opacity: 0;
  transition: opacity 1.1s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 15px 30px rgba(17, 26, 51, 0.12));
}
.kla-figs img.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Panneau droit : formulaire */
.kla-main {
  padding: 48px clamp(32px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #ffffff;
}

/* Étape du parcours */
.kla-step {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 480px;
  width: 100%;
  margin: 0;
  animation: kla-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.kla-step[hidden] { display: none !important }
@keyframes kla-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.kla-h {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: #111A33;
}
.kla-p {
  margin: -8px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: #5A657D;
}

/* Barre de progression */
.kla-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748B;
  margin-bottom: -4px;
}
.kla-progress i {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #E2E8F0;
  position: relative;
  overflow: hidden;
}
.kla-progress i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--p, 33%);
  background: var(--kl-blue, #1E2F65);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Badge de rappel de l'email */
.kla-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #F1F5F9;
  font-size: 14px;
}
.kla-chip b {
  font-weight: 600;
  color: #111A33;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kla-chip button {
  flex: 0 0 auto;
  background: none;
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--kl-blue, #1E2F65);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Grille champs multi-colonnes */
.kla-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Boutons principaux et Google */
.kld-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
  height: 52px !important;
  padding: 0 24px !important;
  border-radius: 12px !important;
  border: none !important;
  background: #1E2F65 !important;
  color: #FFFFFF !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  cursor: pointer !important;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(30, 47, 101, 0.22) !important;
  transition: all 0.2s ease !important;
}
.kld-btn:hover {
  background: #16244F !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(30, 47, 101, 0.3) !important;
}
.kld-btn:active {
  transform: translateY(0) !important;
}
.kld-btn:disabled {
  opacity: 0.6 !important;
  cursor: wait !important;
  transform: none !important;
}
.kld-btn.kld-line {
  background: transparent !important;
  border: 1.5px solid #1E2F65 !important;
  color: #1E2F65 !important;
  box-shadow: none !important;
}
.kld-btn.kld-line:hover {
  background: #1E2F65 !important;
  color: #FFFFFF !important;
}

.kla-google {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  width: 100% !important;
  height: 52px !important;
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 12px !important;
  background: #FFFFFF !important;
  color: #1E293B !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}
.kla-google:hover {
  border-color: #CBD5E1 !important;
  background: #F8FAFC !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}
.kla-google svg { width: 20px; height: 20px; flex-shrink: 0 }

.kla-or {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: #94A3B8;
  margin: 2px 0;
}
.kla-or::before, .kla-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #E2E8F0;
}

.kla-pass { position: relative }
.kla-eye {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  color: #94A3B8;
  display: grid;
  place-items: center;
  transition: color 0.2s ease;
}
.kla-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8 }
.kla-eye:hover { color: #111A33 }

.kla-forgot {
  align-self: flex-end;
  margin-top: -6px;
  font-size: 13px;
  color: var(--kl-blue, #1E2F65);
  font-weight: 600;
  text-decoration: none;
}
.kla-forgot:hover { text-decoration: underline }

.kla-legal {
  margin: 0;
  font-size: 12.5px;
  color: #64748B;
  line-height: 1.5;
}

/* Actions Retour / Valider */
.kla-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.kla-actions .kld-btn { width: auto !important; min-width: 160px; }
.kla-link {
  background: none;
  border: 0;
  padding: 8px 0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  transition: color 0.2s ease;
}
.kla-link:hover { color: #111A33; }

/* Mot de passe : indicateur de force */
.kla-strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: -8px;
}
.kla-strength i {
  height: 4px;
  border-radius: 2px;
  background: #E2E8F0;
  transition: background-color 0.3s ease;
}
.kla-strength[data-level="1"] i:nth-child(-n+1) { background: #E3463D }
.kla-strength[data-level="2"] i:nth-child(-n+2) { background: #E8A13A }
.kla-strength[data-level="3"] i:nth-child(-n+3) { background: #3D8BD9 }
.kla-strength[data-level="4"] i:nth-child(-n+4) { background: #2E9E6B }
.kla-hint {
  margin: -10px 0 0;
  font-size: 12.5px;
  color: #64748B;
}

/* Grille interactive des règles du mot de passe */
.kla-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: -4px 0 2px;
  padding: 12px 14px;
  background: #F8FAFC;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
}
.kla-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #64748B;
  transition: all 0.2s ease;
}
.kla-rule .kla-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #CBD5E1;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.kla-rule.is-valid {
  color: #1E2F65;
  font-weight: 700;
}
.kla-rule.is-valid .kla-dot {
  background: #1E2F65;
  transform: scale(1.3);
  box-shadow: 0 0 0 3px rgba(30, 47, 101, 0.18);
}
@media (max-width: 480px) {
  .kla-rules {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Code OTP à 6 cases */
.kla-code {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.kla-code input {
  width: 100% !important;
  height: 58px !important;
  text-align: center !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  color: #111A33 !important;
  border: 1.5px solid #CBD5E1 !important;
  border-radius: 12px !important;
  background: #F8FAFC !important;
  outline: none !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
}
.kla-code input:focus {
  border-color: #1E2F65 !important;
  background: #FFFFFF !important;
  box-shadow: 0 0 0 4px rgba(30, 47, 101, 0.1) !important;
}
.kla-back {
  align-self: center;
  background: none;
  border: 0;
  font: inherit;
  font-size: 13.5px;
  color: #64748B;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.kla-back:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  text-decoration: none;
}

/* Écran Succès */
.kla-done {
  text-align: center;
  align-items: center;
}
.kla-done .kld-check {
  width: 76px;
  height: 76px;
  display: inline-block;
  margin: 0 auto 8px;
}
.kla-done .kld-check circle {
  fill: none;
  stroke: #1E2F65;
  stroke-width: 1.4;
}
.kla-done .kld-check path {
  fill: none;
  stroke: #1E2F65;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kla-done .kla-actions {
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

/* Indicateur de chargement spinner */
.kld-btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.kld-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: kla-spin 0.7s linear infinite;
}
@keyframes kla-spin { to { transform: rotate(360deg) } }

/* ── CHAMPS FORMULAIRES (.kld-fld) HAUTE DÉFINITION ── */
.kld-fld {
  position: relative;
  display: block;
  width: 100%;
}
.kld-fld input, .kld-fld select {
  width: 100% !important;
  box-sizing: border-box !important;
  height: 56px !important;
  margin: 0 !important;
  border: 1.5px solid #CBD5E1 !important;
  border-radius: 12px !important;
  background: #F8FAFC !important;
  color: #111A33 !important;
  padding: 24px 16px 8px !important;
  font-size: 15px !important;
  font-family: inherit !important;
  outline: none !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}
.kld-fld input:focus, .kld-fld select:focus {
  border-color: #1E2F65 !important;
  background: #FFFFFF !important;
  box-shadow: 0 0 0 4px rgba(30, 47, 101, 0.08) !important;
}
.kld-fld span {
  position: absolute !important;
  left: 16px !important;
  top: 18px !important;
  font-size: 14.5px !important;
  color: #64748B !important;
  pointer-events: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.kld-fld input:focus + span,
.kld-fld input:not(:placeholder-shown) + span,
.kld-fld select:focus + span,
.kld-fld select:valid + span {
  transform: translateY(-9px) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #1E2F65 !important;
}
.kld-fld.is-error input {
  border-color: #E3463D !important;
}
.kld-msg {
  display: block;
  font-size: 12px;
  color: #E3463D;
  margin-top: 4px;
}
.kld-msg:empty { display: none }

/* Téléphone indicatif */
.kld-phone {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
}
.kld-cc {
  position: relative;
}
.kld-cc select {
  color: transparent !important;
  cursor: pointer;
}
.kld-cc .kld-dial {
  position: absolute !important;
  left: 16px !important;
  bottom: 12px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  pointer-events: none !important;
  color: #111A33 !important;
  z-index: 2 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}
.kld-cc .kld-dial small {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  color: #64748B !important;
  margin-right: 4px !important;
}

/* ── VERSION MOBILE ── */
@media (max-width: 860px) {
  .kla {
    padding: 16px 12px 100px;
    min-height: auto;
  }
  .kla-card {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }
  .kla-visual {
    min-height: 180px;
    height: 180px;
    padding: 20px;
  }
  .kla-logo {
    top: 20px;
    left: 20px;
    height: 36px;
  }
  .kla-figs {
    top: 10px;
    left: 40%;
    right: 0;
  }
  .kla-figs img {
    height: 95%;
    max-height: 160px;
    bottom: 4px;
  }
  .kla-main {
    padding: 32px 20px 36px;
  }
  .kla-h {
    font-size: 22px;
  }
  .kla-code {
    gap: 6px;
  }
  .kla-code input {
    height: 52px !important;
    font-size: 20px !important;
  }
  .kla-row {
    grid-template-columns: 1fr;
  }
  .kla-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .kla-actions .kld-btn {
    width: 100% !important;
  }
}
