/**
 * @Auteur : Venance Kaou
 * @Projet : Formulaire d'inscription avec validation complète
 * @Date : Avril 2026
 */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: #f4f2ee;
  font-family: "Plus Jakarta Sans", sans-serif;
  display: flex;
  align-items: stretch;
}

/* Layout deux colonnes */
.page {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ── PANNEAU GAUCHE ── */
.panel-left {
  width: 340px;
  flex-shrink: 0;
  background: #1c1917;
  display: flex;
  align-items: stretch;
}

.panel-inner {
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  width: 100%;
}

.brand {
  font-size: 13px;
  font-weight: 600;
  color: #78716c;
  letter-spacing: 0.04em;
}

.visual-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.visual-title {
  font-size: 26px;
  font-weight: 600;
  color: #fafaf9;
  line-height: 1.2;
}

.visual-desc {
  font-size: 14px;
  color: #78716c;
  line-height: 1.65;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* margin-top: auto; */
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #a8a29e;
}

.feat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #57534e;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .panel-left {
    display: none;
  }
}

/* ── PANNEAU DROIT ── */
.panel-right {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 2rem;
  overflow-y: auto;
}

.form-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0.25rem;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  color: #1c1917;
}

.form-sub {
  font-size: 13px;
  color: #a8a29e;
}

/* Progression globale */
.form-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fp-track {
  flex: 1;
  height: 4px;
  background: #e7e5e4;
  border-radius: 99px;
  overflow: hidden;
}

#fp-bar {
  height: 100%;
  width: 0%;
  background: #16a34a;
  border-radius: 99px;
  transition: width 0.35s ease;
}

#fp-label {
  font-size: 11px;
  color: #a8a29e;
  white-space: nowrap;
}

/* Champs */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

label {
  font-size: 13px;
  font-weight: 500;
  color: #44403c;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  background: #fff;
  border: 1.5px solid #e7e5e4;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 15px;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: #1c1917;
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

input:focus {
  border-color: #1c1917;
}

/* États de validation — à appliquer sur .field depuis JS */
.field.valid input {
  border-color: #16a34a;
}
.field.invalid input {
  border-color: #dc2626;
}

/* Icône de statut — apparaît en JS via innerHTML ou via class */
.field.valid::after {
  content: "✓";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #16a34a;
  font-size: 14px;
  pointer-events: none;
}

/* Wrap pour input + bouton œil */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  padding-right: 2.75rem;
}

.toggle-pw {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  opacity: 0.4;
  transition: opacity 0.2s;
  padding: 4px;
  line-height: 1;
}

.toggle-pw:hover {
  opacity: 0.9;
}

/* Barre de force mot de passe */
.pw-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.pw-track {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.pw-seg {
  height: 3px;
  border-radius: 99px;
  background: #e7e5e4;
  transition: background 0.3s;
}

.pw-seg.weak {
  background: #dc2626;
}
.pw-seg.fair {
  background: #f97316;
}
.pw-seg.good {
  background: #16a34a;
}
.pw-seg.strong {
  background: #15803d;
}

#pw-strength-label {
  font-size: 11px;
  color: #a8a29e;
  min-width: 44px;
  text-align: right;
}

/* Messages d'erreur */
.field-error {
  font-size: 12px;
  color: #dc2626;
  min-height: 16px;
  transition: opacity 0.2s;
}

/* CGU */
.cgu-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cgu-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1c1917;
  cursor: pointer;
  flex-shrink: 0;
}

.cgu-label {
  font-size: 13px;
  color: #78716c;
  cursor: pointer;
}

.cgu-label a {
  color: #1c1917;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Bouton soumettre */
#btn-submit {
  width: 100%;
  background: #1c1917;
  border: none;
  border-radius: 10px;
  color: #fafaf9;
  font-size: 15px;
  font-weight: 600;
  font-family: "Plus Jakarta Sans", sans-serif;
  padding: 0.9rem;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
  margin-top: 0.25rem;
}

#btn-submit:hover {
  background: #292524;
}
#btn-submit:active {
  transform: scale(0.98);
}

/* Message de succès */
.success-msg {
  position: fixed;
  top: 50%;
  left: 50%;

  display: flex;
  align-items: center;
  gap: 14px;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  animation: fade-in 0.3s ease;

  transform: translate(-50%, -60%);
  z-index: 200;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease;

  opacity: 0;
  visibility: hidden;
  overflow: hidden;
}

.success-msg.actif {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%); 
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.success-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.success-title {
  font-size: 14px;
  font-weight: 600;
  color: #15803d;
}

.success-sub {
  font-size: 13px;
  color: #16a34a;
  margin-top: 2px;
}

/* Utilitaire */
.hidden {
  display: none !important;
}

.overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.overlay.actif {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}
