/* ============================================================
   COCOLOVE — Connexion / Inscription
   Fichier : Inscription/inscription.css
   Style inspiré de l'espace Vendeur Aura Market,
   adapté à la charte couleur CocoLove (rose/rouge sur noir)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-dark:        #0d0d14;
  --bg-card:        #161622;
  --primary-pink:   #ff3366;
  --primary-orange: #ff6666;
  --text-light:     #ffffff;
  --text-secondary: #b8b8c8;
  --text-muted:     #8e8e9f;
  --border-color:   #2a2a35;
  --success:        #10B981;
  --danger:         #ff5577;
  --radius:         10px;
  --radius-md:      14px;
  --radius-lg:      18px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  min-height: 100vh;
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
}

/* ─── Topbar ──────────────────────────────────────────────── */
.cl-topbar {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,.4);
}
.cl-back-btn {
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-light);
  text-decoration: none;
  transition: background .2s;
}
.cl-back-btn:hover { background: rgba(255,255,255,.08); }
.cl-back-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cl-topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-light);
}
.cl-topbar-title .heart {
  font-size: 20px;
  filter: drop-shadow(0 0 6px rgba(255,51,102,.5));
}

/* ─── Page wrapper ────────────────────────────────────────── */
.cl-page {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 60px;
}
.cl-page > * { width: 100%; max-width: 420px; }

/* ─── Hero ────────────────────────────────────────────────── */
.cl-hero { text-align: left; padding: 4px 2px 8px; }
.cl-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cl-title-accent {
  background: linear-gradient(90deg, var(--primary-pink), var(--primary-orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cl-sub { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; font-weight: 400; }

/* ─── Tabs ────────────────────────────────────────────────── */
.cl-tabs {
  display: flex;
  gap: 12px;
  margin: 24px auto 0;
  background: var(--bg-card);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}
.cl-tab {
  flex: 1;
  padding: 11px 0;
  border: none;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: color .2s, background .2s;
  font-family: 'Inter', sans-serif;
}
.cl-tab.active {
  color: #fff;
  background: linear-gradient(90deg, var(--primary-pink), var(--primary-orange));
  font-weight: 700;
}
.cl-tab:not(.active):hover { color: var(--text-secondary); }

/* ─── Card / form ─────────────────────────────────────────── */
.cl-card {
  background: transparent;
  border: none;
  padding: 24px 2px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cl-field { display: flex; flex-direction: column; gap: 7px; }
.cl-field:focus-within .cl-label { color: var(--text-light); }
.cl-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); transition: color .2s; }

.cl-input-wrap { position: relative; display: flex; align-items: center; }
.cl-input-wrap > svg {
  position: absolute; right: 2px;
  width: 16px; height: 16px;
  stroke: var(--text-muted); stroke-width: 1.8; fill: none;
  pointer-events: none;
  transition: stroke .2s;
}
.cl-input-wrap:focus-within > svg { stroke: var(--primary-pink); }
.cl-input {
  width: 100%; height: 46px;
  padding: 0 26px 0 4px;
  border: none;
  border-bottom: 1.5px solid var(--border-color);
  border-radius: 0;
  font-size: 14.5px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  color: var(--text-light);
  background: transparent;
  outline: none;
  transition: border-color .2s, border-bottom-width .2s;
}
.cl-input:focus { border-bottom-color: var(--primary-pink); border-bottom-width: 2px; }
.cl-input.error { border-bottom-color: var(--danger); }
.cl-input::placeholder { color: var(--text-muted); opacity: .7; }

.cl-toggle-pw {
  position: absolute; right: 4px;
  background: none; border: none;
  cursor: pointer; padding: 0;
  display: flex; align-items: center;
  z-index: 1;
}
.cl-toggle-pw svg { width: 17px; height: 17px; stroke: var(--text-muted); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; }
.cl-toggle-pw:hover svg { stroke: var(--text-light); }
.cl-input-wrap:has(.cl-toggle-pw) > svg:not(.cl-toggle-pw svg) { display: none; }

.cl-err  { font-size: 12px; color: var(--danger); font-weight: 600; display: none; }
.cl-err:not(:empty) { display: block; }

/* ─── Indicateur de force du mot de passe ───────────────────── */
.cl-strength { display: flex; align-items: center; gap: 10px; }
.cl-strength-bars { display: flex; gap: 4px; flex: 0 0 auto; }
.cl-strength-bar {
  width: 28px; height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  transition: background .2s;
}
.cl-strength-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color .2s;
}

/* ─── Lien mot de passe oublié ──────────────────────────────── */
.cl-forgot-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  cursor: pointer;
  padding: 0;
  margin-top: -8px;
  font-family: 'Inter', sans-serif;
  align-self: flex-end;
}
.cl-forgot-link:hover { color: var(--primary-pink); text-decoration: underline; }

/* ─── Case consentement politique de confidentialité ────────── */
.cl-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.cl-consent-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  margin-top: 0;
  flex-shrink: 0;
  border: 1.5px solid var(--text-muted);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
}
.cl-consent-checkbox:checked {
  background: linear-gradient(90deg, var(--primary-pink), var(--primary-orange));
  border-color: var(--primary-pink);
}
.cl-consent-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.cl-consent-checkbox.error { border-color: var(--danger); }
.cl-consent-label {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  font-weight: 400;
  cursor: pointer;
}
.cl-consent-label a {
  color: var(--text-light);
  font-weight: 600;
  text-decoration: underline;
}
.cl-consent-label a:hover { color: var(--primary-pink); }

/* ─── Bouton principal ────────────────────────────────────── */
.cl-btn {
  height: 50px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(90deg, var(--primary-pink), var(--primary-orange));
  color: #fff;
  font-size: 14.5px; font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(255,51,102,.25);
  transition: opacity .2s, transform .15s, box-shadow .2s;
  margin-top: 4px;
  position: relative;
}
.cl-btn:hover  { opacity: .92; box-shadow: 0 6px 22px rgba(255,51,102,.4); }
.cl-btn:active { transform: scale(.98); }
.cl-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.cl-btn svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.cl-loader {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cl-spin .7s linear infinite;
}
@keyframes cl-spin { to { transform: rotate(360deg); } }

#btn-login[disabled] #btn-login-ico,
#btn-register[disabled] #btn-register-ico { display: none; }

/* ─── Lien bascule sous formulaire ───────────────────────────── */
.cl-switch { text-align: center; margin-top: 6px; font-size: 13px; color: var(--text-muted); }
.cl-switch button {
  background: none; border: none; cursor: pointer;
  color: var(--primary-pink); font-weight: 700; font-size: 13px;
  font-family: 'Inter', sans-serif; padding: 0; margin-left: 4px;
}
.cl-switch button:hover { text-decoration: underline; }

/* ─── Toast ──────────────────────────────────────────────────── */
.cl-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 999;
  max-width: 90vw;
  text-align: center;
}
.cl-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.cl-toast.success { border-color: var(--success); }
.cl-toast.error   { border-color: var(--danger); }

/* ─── Responsive tablette / desktop ─────────────────────────── */
@media (min-width: 640px) {
  .cl-page  { padding: 20px 14px 50px; }
  .cl-card  { padding: 22px 2px 0; }
}

@media (min-width: 900px) {
  .cl-topbar { padding: 0 40px; }
  .cl-title { font-size: 30px; }
  .cl-input { padding-left: 2px; }
  .cl-btn { height: 50px; }
  .cl-page { align-items: center; justify-content: center; min-height: calc(100vh - 64px); padding: 40px 24px; }
}
