/* =========================================================
   GLYMP · auth.css
   Pages login / signup — style TikTok
   v3 — labels flottants + inputs underline + tabs
   Dépend de glymp.css
   ========================================================= */

/* =========================================================
   SHELL
   ========================================================= */
.shell{
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   HEADER STICKY
   ========================================================= */
.auth-header{
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  padding-top: max(14px, var(--safe-top));
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.auth-header-title{
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.back-btn,
.help-btn{
  width: 34px;
  height: 34px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 0;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.back-btn:hover,
.help-btn:hover{
  background: rgba(255,255,255,0.06);
}
.back-btn svg,
.help-btn svg{ width: 22px; height: 22px; }
.back-btn.hidden{ visibility: hidden; }

/* Spacer pour aligner le titre quand pas de back btn */
.header-spacer{ width: 34px; height: 34px; }

/* =========================================================
   PROGRESS BAR (signup)
   ========================================================= */
.progress{
  height: 2px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.progress-fill{
  height: 100%;
  width: 0%;
  background: var(--gradient-cta);
  box-shadow: 0 0 8px rgba(236,72,153,0.5);
  transition: width 0.4s cubic-bezier(.22,.61,.36,1);
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.hero-auth{
  flex: 1;
  padding: 36px 24px 28px;
  display: flex;
  flex-direction: column;
}

/* Logo center */
.logo-wrap{
  text-align: center;
  margin-bottom: 32px;
}

/* Titres */
.step-title{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 8px;
}
.step-title .accent{
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.step-sub{
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 28px;
  line-height: 1.5;
}

/* =========================================================
   TABS (login)
   ========================================================= */
.tabs{
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn{
  flex: 1;
  padding: 14px 0;
  background: none;
  border: none;
  color: var(--text-mute);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.tab-btn:hover{ color: var(--text-dim); }
.tab-btn.active{ color: var(--text); }
.tab-btn.active::after{
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-cta);
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(236,72,153,0.4);
}

/* =========================================================
   STEP SWITCHER (signup)
   ========================================================= */
.step{
  display: none;
  animation: stepIn 0.4s cubic-bezier(.22,.61,.36,1);
}
.step.active{ display: block; }
@keyframes stepIn{
  from{ opacity: 0; transform: translateY(10px); }
  to  { opacity: 1; transform: translateY(0); }
}

.step-scroll{
  max-height: 52vh;
  overflow-y: auto;
  margin: 0 -24px;
  padding: 0 24px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}
.step-scroll::-webkit-scrollbar{ width: 4px; }
.step-scroll::-webkit-scrollbar-thumb{
  background: var(--border-hi);
  border-radius: 2px;
}

/* =========================================================
   INPUTS — style TikTok (underline + label flottant)
   ========================================================= */
.field{
  position: relative;
  margin-bottom: 14px;
}

.field-inner{
  position: relative;
  padding: 22px 0 10px;
  border-bottom: 1px solid var(--border-hi);
  transition: border-color 0.2s;
}
.field-inner:hover{
  border-bottom-color: rgba(255,255,255,0.25);
}
.field-inner.focused{
  border-bottom: 2px solid transparent;
  border-image: var(--gradient-cta) 1;
  padding-bottom: 9px; /* compense le 2px de bordure */
}
.field-inner.error{
  border-bottom: 2px solid var(--danger);
  padding-bottom: 9px;
}

.field-label{
  position: absolute;
  top: 4px;
  left: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.2s, opacity 0.2s;
  pointer-events: none;
}
.field-inner.focused .field-label{
  background: var(--gradient-cta);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--pink); /* fallback */
}
.field-inner.error .field-label{
  color: var(--danger);
  background: none;
  -webkit-text-fill-color: var(--danger);
}

.input{
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  padding: 0;
  font-family: inherit;
  letter-spacing: -0.005em;
}
.input::placeholder{
  color: var(--text-mute);
  font-weight: 400;
}
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus{
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px transparent inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* Pseudo prefix @ */
.field-prefix{
  color: var(--text-mute);
  font-weight: 500;
  margin-right: 4px;
  user-select: none;
}

/* Phone prefix +33 */
.field-prefix-phone{
  color: var(--text-dim);
  font-weight: 500;
  margin-right: 8px;
  user-select: none;
}

/* Icon dans le champ (eye, x) */
.field-icon{
  position: absolute;
  right: 0;
  top: 21px;
  color: var(--text-mute);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.field-icon:hover{ color: var(--text); }
.field-icon svg{ width: 18px; height: 18px; }

/* Field error msg */
.field-error{
  font-size: 12.5px;
  color: var(--danger);
  margin-top: 6px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s, opacity 0.2s, margin-top 0.2s;
}
.field-error.show{
  max-height: 50px;
  opacity: 1;
}

.field-hint{
  font-size: 12.5px;
  color: var(--text-mute);
  margin-top: 6px;
}

/* Form row (step 1 prénom/nom) */
.form-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}
.form-row .field{ margin-bottom: 0; }

/* Lien "Mot de passe oublié" */
.forgot-link{
  display: block;
  text-align: right;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  margin: 4px 0 22px;
  text-decoration: none;
  transition: color 0.2s;
}
.forgot-link:hover{ color: var(--text); }

/* =========================================================
   CTA — gradient violet → rose
   ========================================================= */
.cta{
  width: 100%;
  height: 50px;
  border-radius: var(--r-md);
  border: none;
  background: var(--gradient-cta);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.15s, box-shadow 0.25s, background 0.25s, opacity 0.2s;
  box-shadow: var(--glow-cta);
  position: relative;
  overflow: hidden;
}
.cta::before{
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.22) 50%, transparent 100%);
  animation: gShineSweep 3.5s ease-in-out infinite;
}
.cta:hover{
  background: var(--gradient-cta-hover);
  box-shadow: var(--glow-cta-hi);
}
.cta:active{ transform: scale(0.985); }
.cta:disabled{
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.cta:disabled::before{ display: none; }

.cta-ghost{
  width: 100%;
  height: 46px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-hi);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-top: 10px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.cta-ghost:hover{
  border-color: var(--border-max);
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

/* =========================================================
   SUBLINE (lien en bas)
   ========================================================= */
.subline{
  text-align: center;
  font-size: 13.5px;
  color: var(--text-dim);
  margin-top: 28px;
  font-weight: 500;
}
.subline a{
  background: var(--gradient-cta);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  text-decoration: none;
}
.subline a:hover{ opacity: 0.85; }

/* =========================================================
   INTERESTS GRID (signup step 5)
   ========================================================= */
.interest-counter{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(236,72,153,0.08);
  border: 1px solid rgba(236,72,153,0.20);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}
.interest-counter #interestCount{
  background: var(--gradient-cta);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 10px;
  text-align: center;
}

.interests-grid{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 8px;
}

.interest-pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.interest-pill:hover{
  background: rgba(236,72,153,0.06);
  border-color: rgba(236,72,153,0.25);
  color: var(--text);
}
.interest-pill .emoji{
  font-size: 15px;
  line-height: 1;
}
.interest-pill.selected{
  background: var(--gradient-cta);
  border-color: transparent;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(236,72,153,0.35);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 380px){
  .step-title{ font-size: 22px; }
  .hero-auth{ padding: 28px 20px 24px; }
  .auth-header{ padding: 12px 20px; }
}

@media (prefers-reduced-motion: reduce){
  .step{ animation: none; }
  .progress-fill{ transition: none; }
  .cta::before{ display: none; }
}