/* ═══════════════════════════════════════════════════════════════
   REGISTER PAGE — même design language que login
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --brand:       #3a3f47;
  --brand-dark:  #1f2328;
  --brand-light: #7a8390;
  --accent:      #5a6470;
  --ok:          #10b981;
  --err:         #ef4444;
}

body.register-body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  background: #eceef0;
  overflow-x: hidden;
}

/* ── Layout ──────────────────────────────────────────────── */
.login-page {
  display: flex;
  min-height: 100vh;
}

/* ── Panneau gauche (identique login) ────────────────────── */
.login-brand {
  width: 38%;
  flex-shrink: 0;
  background: linear-gradient(160deg, #0d0f11 0%, #1a1d21 45%, #252a30 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 3rem;
  min-height: 100vh;
}

.brand-deco { position: absolute; border-radius: 50%; pointer-events: none; }
.brand-deco--1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, var(--brand-light), transparent 70%);
  top: -120px; right: -120px; opacity: .12;
}
.brand-deco--2 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  bottom: -60px; left: -60px; opacity: .1;
}
.brand-deco--3 {
  width: 160px; height: 160px;
  border: 2px solid var(--brand-light);
  bottom: 120px; right: 60px; opacity: .08;
}

.brand-inner {
  position: relative; z-index: 1;
  text-align: center; width: 100%; max-width: 320px;
}

.brand-logo-wrap {
  width: 90px; height: 90px;
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.12);
  border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.6rem;
  backdrop-filter: blur(4px);
}
.brand-logo-img { width: 56px; height: 56px; object-fit: contain; }

.brand-name {
  font-size: 2.2rem; font-weight: 800;
  color: #fff; letter-spacing: -.04em; margin-bottom: .3rem;
}
.brand-tagline {
  font-size: .82rem; font-weight: 500;
  color: var(--brand-light); letter-spacing: .2em;
  text-transform: uppercase; margin-bottom: 2.2rem; opacity: .8;
}

.brand-features { list-style: none; text-align: left; display: flex; flex-direction: column; gap: .85rem; }
.brand-features li {
  display: flex; align-items: center; gap: .7rem;
  color: rgba(255,255,255,.72); font-size: .86rem;
}
.brand-features li .material-symbols-outlined {
  font-size: 1.05rem; color: var(--brand-light);
  background: rgba(122,131,144,.15); padding: 5px; border-radius: 8px; flex-shrink: 0;
}

.brand-footer {
  position: absolute; bottom: 1.5rem; left: 0; right: 0;
  text-align: center; font-size: .72rem;
  color: rgba(255,255,255,.25); letter-spacing: .04em;
}

/* ── Panneau droit ───────────────────────────────────────── */
.login-form-panel {
  flex: 1;
  background: #f4f5f6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  overflow-y: auto;
}

.form-card {
  width: 100%;
  max-width: 480px;
  margin: auto;
  animation: fadeUp .45s ease both;
}

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

/* Lien retour */
.back-link {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8rem; font-weight: 500; color: var(--brand);
  text-decoration: none; margin-bottom: 1.25rem;
  transition: opacity .15s;
}
.back-link:hover { opacity: .7; }
.back-link .material-symbols-outlined { font-size: 1rem; }

.form-card__header { margin-bottom: 1.4rem; }
.form-title {
  font-size: 1.75rem; font-weight: 800;
  color: #0f172a; letter-spacing: -.04em; margin-bottom: .3rem;
}
.form-subtitle { font-size: .86rem; color: #64748b; }

/* ── Indicateur d'étape ──────────────────────────────────── */
.step-indicator { margin-bottom: 1.75rem; }

.step-bar {
  height: 4px; background: #dde0e4; border-radius: 4px;
  margin-bottom: .5rem; overflow: hidden;
}
.step-fill {
  height: 100%; width: 50%;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
  border-radius: 4px;
  transition: width .4s ease;
}

.step-label { font-size: .75rem; font-weight: 500; color: #8a9099; letter-spacing: .02em; }

/* ── Messages ────────────────────────────────────────────── */
.form-messages { margin-bottom: 1.25rem; }
.form-alert {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1rem; border-radius: 10px;
  font-size: .84rem; margin-bottom: .5rem;
}
.form-alert .material-symbols-outlined { font-size: 1.1rem; }
.form-alert--success { background: #d1fae5; color: #065f46; }
.form-alert--error,
.form-alert--danger  { background: #fee2e2; color: #991b1b; }
.form-alert--warning { background: #fef3c7; color: #92400e; }

/* ── Formulaire multi-étapes ─────────────────────────────── */
.reg-form .form.second { display: none; }
.reg-form.secActive .form.first  { display: none; }
.reg-form.secActive .form.second { display: block; }

/* Grille 2 colonnes étape 1 */
.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

/* ── Champs ──────────────────────────────────────────────── */
.input-field { margin-bottom: 1.1rem; }

.form-label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .78rem; font-weight: 600;
  color: #2c3138; margin-bottom: .45rem;
  letter-spacing: .04em; text-transform: uppercase;
}

.label-badge {
  font-size: .65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 6px;
  background: rgba(58,63,71,.12); color: var(--brand);
  text-transform: uppercase; letter-spacing: .06em;
}

.input-wrap {
  position: relative; display: flex; align-items: center;
  background: #fff;
  border: 1.5px solid #d4d8dc;
  border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.input-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(58,63,71,.12);
}

/* Erreur inline */
input.input-error + .input-wrap,
.input-wrap:has(input.input-error) {
  border-color: var(--err) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1) !important;
}
input.input-error {
  outline: none;
}
/* fallback : le JS ajoute input-error sur l'input */
.input-field:has(input.input-error) .input-wrap {
  border-color: var(--err) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1) !important;
}

.input-error-message {
  font-size: .72rem !important;
  color: var(--err) !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.input-icon {
  font-size: 1.05rem; color: #9aa0a8;
  padding: 0 0 0 .9rem; flex-shrink: 0; pointer-events: none;
}

.form-input {
  flex: 1; height: 48px; padding: 0 .85rem;
  background: transparent; border: none; outline: none;
  font-size: .92rem; font-family: inherit; color: #0f172a;
}
.form-input::placeholder { color: #a8adb5; }

/* Toggle oeil */
.toggle-pass {
  background: none; border: none; cursor: pointer;
  padding: 0 .85rem; color: #9aa0a8;
  display: flex; align-items: center; transition: color .2s;
}
.toggle-pass:hover { color: var(--brand); }
.toggle-pass .material-symbols-outlined { font-size: 1.05rem; }

/* ── Checklist mot de passe ──────────────────────────────── */
.password-checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem .6rem;
  background: #eceef0;
  border-radius: 10px;
  padding: .85rem 1rem;
  margin-bottom: 1.1rem;
}

.requirement {
  display: flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 500; color: #8a9099;
  transition: color .2s;
}

.req-icon { font-size: .9rem !important; color: var(--err); transition: color .2s; }

.requirement.valid { color: var(--ok); }
.requirement.valid .req-icon { color: var(--ok); }

/* ── Boutons ─────────────────────────────────────────────── */
.btn-login {
  width: 100%; height: 50px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; border: none; border-radius: 12px;
  font-size: .95rem; font-weight: 700; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  transition: transform .18s, box-shadow .18s, filter .18s;
  box-shadow: 0 4px 18px rgba(31,35,40,.30);
  margin-top: .5rem;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(31,35,40,.40); filter: brightness(1.06); }
.btn-login:active { transform: none; box-shadow: 0 2px 10px rgba(31,35,40,.25); }
.btn-login .material-symbols-outlined { font-size: 1.05rem; }

.step2-buttons { display: flex; gap: .75rem; margin-top: .5rem; }

.btn-back {
  height: 50px; padding: 0 1.2rem;
  background: #fff; color: var(--brand);
  border: 1.5px solid #d4d8dc; border-radius: 12px;
  font-size: .9rem; font-weight: 600; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; gap: .4rem;
  transition: border-color .2s, background .2s;
  white-space: nowrap;
}
.btn-back:hover { border-color: var(--brand); background: rgba(58,63,71,.05); }
.btn-back .material-symbols-outlined { font-size: 1rem; }

.step2-buttons .btn-login { flex: 1; margin-top: 0; }

/* ── Lien connexion ──────────────────────────────────────── */
.form-signup {
  text-align: center; font-size: .84rem;
  color: #64748b; margin-top: 1.5rem;
}
.form-link { font-size: .82rem; color: var(--brand); text-decoration: none; font-weight: 500; }
.form-link:hover { text-decoration: underline; opacity: .8; }
.form-link--accent { color: var(--brand); font-weight: 600; margin-left: .2rem; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .login-page { flex-direction: column; }
  .login-brand { width: 100%; min-height: unset; padding: 2.5rem 2rem; }
  .brand-features { display: none; }
  .login-form-panel { padding: 2rem 1.25rem 3rem; }
}

@media (max-width: 480px) {
  .fields-grid { grid-template-columns: 1fr; }
  .password-checklist { grid-template-columns: 1fr; }
}
