/**
 * public/assets/css/auth.css
 * ----------------------------------------------------------------------
 * Styles de l'écran de connexion (et pages auth associées : mot de
 * passe oublié, 2FA...). Réutilise les tokens de design définis dans
 * styles.css (fourni par le graphiste) pour rester cohérent avec le
 * reste de l'application : couleur primaire, police, rayons de bordure.
 * ----------------------------------------------------------------------
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #FF8C3B;
  --primary-dark: #FF6348;
  --gradient: linear-gradient(270deg, #FF8C3B 0%, #FF6348 93.6%);
  --bg: #F8F8F8;
  --white: #FFFFFF;
  --text-dark: #101828;
  --text-medium: #29303A;
  --text-muted: #727272;
  --border: rgba(41, 48, 58, 0.3);
  --shadow-md: 0 1px 2px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.1);
  --radius-lg: 16px;
  --radius: 10px;
  --font: 'Plus Jakarta Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.auth-body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-medium);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  position: relative;
}

/* Picto d'aide "?" et sa fenêtre modale (voir pages/layout/aide.php) */
.aide-bouton {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}
.aide-bouton:hover { border-color: var(--primary); color: var(--primary); }

.aide-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.aide-modal[hidden] { display: none; }

.aide-modal-fond {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.5);
}

.aide-modal-contenu {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}
.aide-modal-contenu h2 { font-size: 18px; font-weight: 700; margin-bottom: 12px; padding-right: 24px; }
.aide-modal-texte { font-size: 14px; line-height: 1.6; color: var(--text-medium); }
.aide-modal-texte p { margin-bottom: 10px; }

.aide-modal-fermer {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}
.aide-modal-fermer:hover { color: var(--primary); }

.auth-logo { text-align: center; margin-bottom: 24px; }
.logo-text { font-size: 20px; font-weight: 700; color: var(--text-medium); }
.logo-text span { color: var(--primary); }

.auth-titre { font-size: 22px; font-weight: 700; margin-bottom: 8px; text-align: center; }
.auth-sous-titre { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; text-align: center; }

.auth-erreur {
  background: #FFF0EC;
  color: var(--primary-dark);
  border: 1px solid var(--primary-dark);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-succes {
  background: #EDF9F0;
  color: #1E8A47;
  border: 1px solid #1E8A47;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

.auth-form label { font-size: 13px; font-weight: 600; margin-top: 10px; }

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
}

.auth-form input:focus { border-color: var(--primary); }

.auth-champ-mot-de-passe { position: relative; display: flex; }
.auth-champ-mot-de-passe input { flex: 1; }
.auth-basculer-mdp {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px; opacity: 0.6;
}

.auth-case-a-cocher {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; margin-top: 14px;
  cursor: pointer;
}
.auth-case-a-cocher input { width: 16px; height: 16px; flex-shrink: 0; }
.auth-case-a-cocher span { font-weight: 400; line-height: 1.4; }
.auth-case-a-cocher a { color: var(--primary); text-decoration: underline; }

.auth-bouton-principal:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-bouton-principal {
  margin-top: 20px;
  background: var(--gradient);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.auth-bouton-principal:hover { opacity: 0.9; }

.auth-lien-secondaire {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.auth-lien-secondaire:hover { color: var(--primary); }

/* ─── Sélecteur de langue des pages publiques (pages/layout/selecteur_langue.php) ─── */
.selecteur-langue {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.selecteur-langue select {
  font-family: var(--font);
  font-size: 12px;
  padding: 4px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text-medium);
  cursor: pointer;
}
.selecteur-langue select:focus { border-color: var(--primary); outline: none; }
.selecteur-langue-bouton {
  font-family: var(--font);
  font-size: 12px;
  padding: 4px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
}

/* Texte réservé aux lecteurs d'écran (libellé du sélecteur de langue). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Bouton secondaire (ex: « Renvoyer le code » à l'étape 2FA) */
.auth-bouton-secondaire {
  margin-top: 12px;
  background: var(--white);
  color: var(--text-medium);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  width: 100%;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.auth-bouton-secondaire:hover { border-color: var(--primary); color: var(--primary); }
.auth-form-secondaire { margin-top: 0; }
.auth-aide-code { font-size: 12px; color: var(--text-muted); margin-top: 10px; text-align: center; }
