/* =============================================
   TECHMEET — Page: Splash + Authentification
   ============================================= */

/* ─── SPLASH ─────────────────────────────── */
#page-splash {
  align-items: center;
  justify-content: center;
  background: var(--bg-root);
  overflow: hidden;
  position: relative;
}
.splash-bg-glow {
  position: absolute;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(37,99,235,0.2) 0%, transparent 70%);
  top: 40%; left: 50%;
  transform: translate(-50%, -60%);
  pointer-events: none;
  animation: pulse 3.5s ease-in-out infinite;
}
.splash-bg-glow2 {
  position: absolute;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(6,182,212,0.14) 0%, transparent 70%);
  bottom: 22%; left: 8%;
  pointer-events: none;
  animation: pulse 4s ease-in-out infinite reverse;
}
.splash-center {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 20px;
  animation: slideUp 0.9s cubic-bezier(0.4,0,0.2,1) 0.3s both;
}
.splash-icon-wrap {
  width: 100px; height: 100px;
  background: var(--grad-brand);
  border-radius: 30px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 0 50px rgba(37,99,235,0.45), 0 0 100px rgba(6,182,212,0.2);
  animation: glow 3.5s ease-in-out infinite;
}
.splash-wordmark {
  font-family: var(--font-display);
  font-size: 46px; font-weight: 800;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -2.5px;
  line-height: 1;
}
.splash-tagline {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 10px;
  letter-spacing: 0.3px;
  line-height: 1.5;
}
.splash-dots {
  position: absolute;
  bottom: 90px;
  display: flex; gap: 7px;
  animation: fadeIn 0.5s ease 1.6s both;
}
.splash-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  animation: pulse 1.3s ease infinite;
}
.splash-dot:nth-child(1) { background: var(--blue-light); }
.splash-dot:nth-child(2) { background: var(--cyan); animation-delay: 0.22s; }
.splash-dot:nth-child(3) { background: var(--blue-light); animation-delay: 0.44s; }
.splash-made {
  position: absolute; bottom: 28px;
  font-size: 12px; color: var(--text-3);
  letter-spacing: 0.5px;
  animation: fadeIn 0.5s ease 2.2s both;
}

/* ─── AUTH COMMON ─────────────────────────── */
.auth-page {
  background: var(--bg-root);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Clé pour scroll avec clavier Android */
  position: relative;
}
.auth-page-bg {
  position: absolute;
  top: 0; left: 0; right: 0; height: 280px;
  background: linear-gradient(180deg, rgba(37,99,235,0.1) 0%, transparent 100%);
  pointer-events: none;
}
.auth-scroll {
  min-height: 100%;
  display: flex; flex-direction: column;
  /* flex-start au lieu de center : permet le scroll quand le clavier s'ouvre */
  justify-content: flex-start;
  padding: 44px 24px 100px;  /* 100px en bas = clavier ne cache pas le bouton */
  position: relative; z-index: 1;
  box-sizing: border-box;
}
.auth-logo-row {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 28px;
}
.auth-logo-icon {
  width: 44px; height: 44px;
  background: var(--grad-brand);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-blue);
  flex-shrink: 0;
}
.auth-wordmark {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 800;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}
.auth-headline {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.2;
}
.auth-sub { font-size: 14px; color: var(--text-2); margin-bottom: 28px; line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }

/* Rangée 2 colonnes — passe en 1 colonne sur petits écrans */
.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-forgot {
  text-align: right; font-size: 13px;
  color: var(--blue-glow); font-weight: 500;
  cursor: pointer; margin-top: -6px;
}
.auth-divider { margin: 20px 0; }

/* Boutons sociaux — toujours en ligne, mais réduisent proprement */
.auth-social {
  display: flex;
  gap: 10px;
}
.social-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 8px;
  border-radius: var(--r-md);
  background: var(--bg-card); border: 1.5px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--text-1);
  cursor: pointer; transition: var(--ease-fast);
  min-width: 0;
  overflow: hidden;
}
.social-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-btn:active { background: var(--bg-card2); transform: scale(0.97); }

.auth-footer {
  text-align: center; margin-top: 24px;
  font-size: 14px; color: var(--text-2);
  line-height: 1.6;
}
.auth-footer a { color: var(--blue-glow); font-weight: 600; }

/* ─── Role selector ──────────────────────── */
.role-grid {
  display: grid;
  /* 5 cartes : 3 sur la 1ère ligne, 2 sur la 2ème centrées */
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.role-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 10px 4px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--ease-fast);
  text-align: center;
  min-width: 0;
}
.role-card.active {
  border-color: var(--blue-light);
  background: rgba(37,99,235,0.12);
}
.role-card:active { transform: scale(0.95); }
.role-emoji { font-size: 22px; line-height: 1; flex-shrink: 0; }
.role-label {
  font-size: 11px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  width: 100%;
}
.role-card.active .role-label { color: var(--blue-glow); }

/* ─── Terms ──────────────────────────────── */
.auth-terms {
  font-size: 11px; color: var(--text-3);
  text-align: center; margin-top: 10px; line-height: 1.6;
}
.auth-terms a { color: var(--blue-glow); }

/* ─── Loading state on button ────────────── */
.btn-loading {
  position: relative; pointer-events: none; opacity: 0.75;
}
.btn-loading::after {
  content: '';
  position: absolute; right: 16px;
  top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

/* ─── Responsive Auth ────────────────────── */

@media (max-width: 480px) {
  .auth-scroll {
    padding: 36px 16px 100px;
  }
  .auth-headline { font-size: 22px; }
  .auth-wordmark { font-size: 24px; }
  .splash-wordmark { font-size: 38px; }
  .splash-icon-wrap { width: 84px; height: 84px; border-radius: 24px; }

  /* 5 rôles sur 480px : 3+2 */
  .role-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  /* Les 2 dernières cartes centrées */
  .role-card:nth-child(4) { grid-column: 1; }
  .role-card:nth-child(5) { grid-column: 2; }
}

@media (max-width: 360px) {
  .auth-scroll {
    padding: 24px 12px 90px;
  }
  .auth-wordmark  { font-size: 22px; }
  .auth-headline  { font-size: 20px; }
  .auth-sub       { font-size: 13px; margin-bottom: 20px; }
  .auth-logo-row  { margin-bottom: 20px; }
  .auth-logo-icon { width: 38px; height: 38px; border-radius: 12px; }

  /* Champs prénom/nom passent en colonne sur très petit écran */
  .auth-form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  /* 5 rôles sur petits écrans */
  .role-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .role-card  { padding: 8px 3px; gap: 3px; }
  .role-emoji { font-size: 16px; }
  .role-label { font-size: 9px; letter-spacing: 0.1px; }

  /* Boutons sociaux : empilés sur 360px */
  .auth-social { flex-direction: column; gap: 8px; }
  .social-btn  { padding: 12px 14px; justify-content: center; }

  .splash-wordmark  { font-size: 32px; letter-spacing: -2px; }
  .splash-icon-wrap { width: 72px; height: 72px; border-radius: 20px; }
  .splash-tagline   { font-size: 13px; }
  .splash-bg-glow   { width: 280px; height: 280px; }
  .tm-input { font-size: 14px; }
}

@media (max-width: 320px) {
  .auth-scroll    { padding: 16px 10px 80px; }
  .auth-wordmark  { font-size: 20px; }
  .auth-headline  { font-size: 18px; }
  .auth-sub       { font-size: 12px; margin-bottom: 16px; }
  .auth-logo-icon { width: 34px; height: 34px; border-radius: 10px; }
  .auth-footer    { font-size: 12px; margin-top: 16px; }
  .auth-forgot    { font-size: 12px; }

  .splash-wordmark  { font-size: 28px; letter-spacing: -1.5px; }
  .splash-icon-wrap { width: 60px; height: 60px; border-radius: 16px; }
  .splash-tagline   { font-size: 12px; }

  .social-btn  { font-size: 13px; }
  .role-emoji  { font-size: 14px; }
  .role-label  { font-size: 8px; }
  .role-card   { padding: 6px 2px; }
}