/* ================================================
   AUTH.CSS — Bouton de compte, menu, modale d'auth
   S'appuie sur les variables et composants de common.css.
   ================================================ */

/* ── Bouton de compte dans l'en-tête ── */
.acct { position: relative; display: inline-flex; }
.acct-floating {
  position: fixed;
  top: 14px; right: 16px;
  z-index: 900;
}
.acct-btn { max-width: 220px; overflow: hidden; }
.acct-btn #acct-btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-ava {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-blue-light); color: var(--primary-blue);
  display: inline-grid; place-items: center; overflow: hidden;
  font-size: 0.68rem; font-weight: 700; flex-shrink: 0;
}
.acct-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Menu déroulant du compte ── */
.acct-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 230px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 950;
  animation: fadeInUp var(--transition-fast) ease-out;
}
.acct-menu-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.acct-menu-head strong { font-size: 0.92rem; color: var(--text-primary); }
.acct-menu-email { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.acct-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 0.86rem;
  color: var(--text-secondary);
  background: none;
  border: none;
}
.acct-menu-item:hover { background: var(--bg-subtle); color: var(--text-primary); }

/* ── Modale d'authentification ── */
.auth-card { max-width: 440px; }

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 12px 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
}

/* ── Champs de formulaire ── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.92rem;
  color: var(--text-primary);
  background: var(--bg-page);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.field input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px var(--primary-blue-light);
}

.auth-submit { width: 100%; margin-top: 4px; }

/* Captcha Turnstile (js/captcha.js) : vide, donc masqué, tant qu'il est désactivé. */
.auth-captcha { margin: 2px 0 12px; }
.auth-captcha:empty { display: none; }

.auth-link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--primary-blue);
  background: none;
  border: none;
}
.auth-link:hover { text-decoration: underline; }

/* ── Messages ── */
.auth-msg {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.84rem;
  margin-bottom: 14px;
  line-height: 1.4;
}
.auth-msg-error {
  background: var(--error-red-light);
  color: var(--error-red);
  border: 1px solid var(--error-red);
}
.auth-msg-success {
  background: var(--success-green-light);
  color: var(--success-green);
  border: 1px solid var(--success-green-soft);
}

/* Action dans un message (renvoyer l'email de confirmation…) */
.auth-msg-action {
  display: inline; padding: 0; margin: 0;
  font: inherit; font-weight: 600; color: inherit;
  background: none; border: none; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.auth-msg-action:disabled { opacity: 0.55; cursor: default; }
