/* ============================================================
   MOTIX EXPRESS — Création de compte
   Panneau de marque + formulaire à fort contraste (fond plein,
   pas d'effet de flou/transparence sur les éléments interactifs —
   voir la leçon tirée de la page d'accueil).
   ============================================================ */

.signup-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 460px) 1fr;
}
@media (max-width: 900px) {
  .signup-shell {
    grid-template-columns: 1fr;
  }
}

/* ---------------- Panneau de marque (gauche) ---------------- */
.signup-brand {
  position: relative;
  background: var(--ink);
  overflow: hidden;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.signup-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -20deg,
    rgba(88, 190, 59, 0.14) 0px,
    rgba(88, 190, 59, 0.14) 2px,
    transparent 2px,
    transparent 60px
  );
  background-size: 200% 200%;
  animation: signupDrift 18s linear infinite;
  mask-image: radial-gradient(
    ellipse 75% 65% at 30% 25%,
    black 35%,
    transparent 82%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 75% 65% at 30% 25%,
    black 35%,
    transparent 82%
  );
}
@keyframes signupDrift {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: -260px 150px;
  }
}
.signup-brand > *:not(.signup-brand-glow):not(.back-to-site) {
  position: relative;
  z-index: 1;
}
.signup-brand img {
  height: 34px;
  width: auto;
  margin-bottom: auto;
}

.signup-brand-glow {
  position: absolute;
  top: -15%;
  left: -15%;
  width: 65%;
  height: 60%;
  background: radial-gradient(
    circle,
    rgba(88, 190, 59, 0.25) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.back-to-site {
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px 8px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
.back-to-site:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}
.back-to-site i {
  font-size: 12px;
}

.signup-brand-copy {
  margin-top: 0;
}
.signup-brand-copy h1 {
  color: #fff;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
}
.signup-brand-copy p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 360px;
}

.signup-benefits {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.signup-benefit {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.signup-benefit .ic {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex-shrink: 0;
  background: rgba(88, 190, 59, 0.15);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.signup-benefit h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
}
.signup-benefit p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12.5px;
  margin: 0;
}

@media (max-width: 900px) {
  .signup-brand {
    padding: 32px 24px;
  }
  .signup-brand img {
    margin-bottom: 24px;
  }
  .signup-brand-copy {
    margin-top: 0;
  }
  .signup-benefits {
    display: none;
  }
}

/* ---------------- Panneau formulaire (droite) ---------------- */
.signup-form-side {
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 32px;
}
.signup-form-wrap {
  width: 100%;
  max-width: 440px;
}
.signup-form-wrap h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
}
.signup-form-wrap > p.intro {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 30px;
}

/* ---------------- Avatar ---------------- */
.avatar-field {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}
.avatar-upload {
  position: relative;
  width: 96px;
  height: 96px;
}
.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--paper-alt);
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 30px;
  transition: border-color 0.15s ease;
}
.avatar-preview.has-image {
  border-style: solid;
  border-color: var(--green);
}
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-edit-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: #0b1a06;
  border: 3px solid var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.avatar-edit-btn:hover {
  background: var(--green-dark);
  color: #fff;
}
.avatar-hint {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ---------------- Formulaire ---------------- */
.signup-form-wrap .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.field {
  margin-bottom: 18px;
}
.field.full {
  grid-column: 1/-1;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 7px;
}
.field label .opt {
  color: var(--text-muted);
  font-weight: 600;
}
.field label .req {
  color: #c0272d;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field select {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-pale);
}
/* ---------------- Quartier (recherche/autocomplétion) ---------------- */
.autocomplete-wrap {
  position: relative;
}
.autocomplete-wrap input[type="text"] {
  padding-right: 40px;
}
.autocomplete-wrap > i {
  position: absolute;
  right: 14px;
  top: 22px;
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}
.autocomplete-list {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 14px 32px rgba(20, 22, 26, 0.14);
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 6px;
  z-index: 20;
}
.autocomplete-list.open {
  display: block;
}
.autocomplete-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13.5px;
}
.autocomplete-list li:hover,
.autocomplete-list li.active {
  background: var(--green-pale);
}
.autocomplete-list .q-name {
  font-weight: 700;
  color: var(--text);
}
.autocomplete-list .q-ville {
  font-size: 11.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.field-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 7px;
}
.field-hint.field-hint-error {
  color: #c0272d;
}

.field-error {
  display: none;
  color: #c0272d;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}
.field.invalid input,
.field.invalid select {
  border-color: #c0272d;
}
.field.invalid .field-error {
  display: block;
}

/* ---------------- Mot de passe ---------------- */
.pw-field {
  position: relative;
}
.pw-field input {
  padding-right: 44px;
}
.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
}
.pw-toggle:hover {
  color: var(--text);
}

.pw-strength {
  height: 5px;
  border-radius: 4px;
  background: var(--paper-alt);
  margin-top: 9px;
  overflow: hidden;
}
.pw-strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: #c0272d;
  transition:
    width 0.25s ease,
    background 0.25s ease;
}
.pw-strength-label {
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--text-muted);
}

/* ---------------- Conditions ---------------- */
.terms-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.terms-field input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  flex-shrink: 0;
}
.terms-field a {
  color: var(--green-dark);
  font-weight: 700;
}

/* ---------------- Bouton, pied ---------------- */
.signup-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  position: relative;
}
.signup-submit .btn-spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(11, 26, 6, 0.3);
  border-top-color: #0b1a06;
  border-radius: 50%;
  animation: signupSpin 0.7s linear infinite;
}
.signup-submit.loading .btn-label {
  visibility: hidden;
}
.signup-submit.loading .btn-spinner {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
@keyframes signupSpin {
  to {
    transform: rotate(360deg);
  }
}

.form-error-banner {
  display: none;
  background: #fdebec;
  color: #9c1c22;
  border: 1px solid #f5c1c4;
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}
.form-error-banner.visible {
  display: block;
}
.signup-footer-link {
  text-align: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.signup-footer-link a {
  color: var(--green-dark);
  font-weight: 700;
}

/* ---------------- Écran de succès ---------------- */
.signup-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0;
}
.signup-success.visible {
  display: flex;
}
.signup-success .check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green-pale);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 20px;
}
.signup-success h2 {
  font-size: 22px;
  margin-bottom: 8px;
}
.signup-success p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 340px;
}

@media (max-width: 520px) {
  .signup-form-wrap .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
}
