/* ============================================================
   auth.css — INCA Support
   Styles dédiés aux pages du dossier /auth/
   Utilise les variables de theme.css (light + dark)
   ============================================================ */

/* ── Wrapper : centre la carte verticalement et horizontalement ── */
.auth-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: calc(100vh - 56px - 40px);
  padding: 1.25rem 1rem;
}

/* ── Carte principale ── */
/* max-width plus large : carte moins haute, mieux proportionnée sur 15.6" */
.auth-card {
  width: 100%;
  max-width: 560px;
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 2rem 2.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

html.dark-mode .auth-card {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ── Icône en haut de carte ── */
.auth-icon {
  font-size: 2.4rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  text-align: left;
}

/* ── Titre ── */
.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--card-text);
  margin: 0 0 0.25rem 0;
  line-height: 1.2;
}

/* ── Sous-titre ── */
.auth-subtitle {
  font-size: 0.88rem;
  color: var(--card-text-muted);
  margin: 0 0 1.5rem 0;
}

/* ── Champ de formulaire ── */
.auth-field {
  margin-bottom: 1.1rem;
}

.auth-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--card-text);
  margin-bottom: 0.35rem;
}

/* Header label + lien "Mot de passe oublié ?" sur la même ligne */
.auth-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.auth-field-header label {
  margin-bottom: 0;
}

.auth-forgot-link {
  font-size: 0.8rem;
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity 0.15s;
}

.auth-forgot-link:hover {
  opacity: 0.75;
  text-decoration: underline;
}

/* ── Wrapper input + icône ── */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  font-size: 0.95rem;
  color: var(--input-placeholder);
  pointer-events: none;
  z-index: 1;
  transition: color 0.2s;
}

/* ── Input stylisé ── */
.auth-input {
  width: 100%;
  padding: 0.6rem 0.75rem 0.6rem 2.3rem;
  font-size: 0.92rem;
  background: var(--input-bg) !important;
  color: var(--input-text) !important;
  border: 1px solid var(--input-border) !important;
  border-radius: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  /* Espace pour le bouton toggle mot de passe à droite */
  padding-right: 2.8rem;
}

.auth-input:focus {
  border-color: var(--input-focus-border) !important;
  background: var(--input-focus-bg) !important;
  color: var(--input-focus-text) !important;
  box-shadow: 0 0 0 0.2rem var(--input-focus-shadow) !important;
}

.auth-input::placeholder {
  color: var(--input-placeholder) !important;
  opacity: 1;
}

.auth-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Bouton afficher/masquer mot de passe ── */
.input-toggle-pw {
  position: absolute;
  right: 0.55rem;
  background: transparent;
  border: none;
  color: var(--input-placeholder);
  font-size: 1rem;
  padding: 0.25rem 0.4rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
  z-index: 2;
}

.input-toggle-pw:hover {
  color: var(--color-primary);
}

/* ── Bouton principal ── */
.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: 1px solid var(--btn-primary-border);
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  margin-top: 0.5rem;
}

.btn-auth:hover:not(:disabled) {
  background: var(--btn-primary-bg-hover);
  color: var(--btn-primary-text-hover);
  border-color: var(--btn-primary-border-hover);
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.btn-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Lien retour / liens secondaires ── */
.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
}

.btn-auth-link {
  font-size: 0.85rem;
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn-auth-link:hover {
  opacity: 0.75;
  text-decoration: underline;
}

/* ── Message de verrouillage brute-force ── */
.auth-lock-notice {
  font-size: 0.82rem;
  color: var(--btn-danger-text);
  background: var(--btn-danger-bg);
  border: 1px solid var(--btn-danger-border);
  border-radius: 0.4rem;
  padding: 0.5rem 0.75rem;
  margin-top: 0.75rem;
  text-align: center;
}

/* ── Alertes (réutilise Bootstrap mais harmonisées) ── */
.auth-card .alert {
  border-radius: 0.5rem;
  font-size: 0.88rem;
  padding: 0.65rem 0.9rem;
  margin-bottom: 1rem;
}

/* ── Barre de force du mot de passe ── */
.pw-strength-wrap {
  height: 4px;
  background: var(--input-border);
  border-radius: 2px;
  margin-top: 0.4rem;
  overflow: hidden;
}

.pw-strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s, background-color 0.3s;
}

.pw-strength-bar.weak   { width: 33%; background-color: var(--btn-danger-text); }
.pw-strength-bar.medium { width: 66%; background-color: var(--btn-warning-text); }
.pw-strength-bar.strong { width: 100%; background-color: var(--btn-success-text); }

.pw-strength-label,
.pw-match-label {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
  min-height: 1rem;
  transition: color 0.2s;
}

/* ── Animation d'entrée ── */
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-card.fade-in {
  animation: authFadeIn 0.3s ease-out both;
}

/* ── Responsive mobile ── */
@media (max-width: 480px) {
  .auth-card {
    padding: 1.75rem 1.25rem;
    border-radius: 0.75rem;
  }
  .auth-title {
    font-size: 1.35rem;
  }
}
