/* =========================================================================
 * admin/css/login.css — Habillage de la page de connexion
 * -------------------------------------------------------------------------
 * Format de version : JJ-MM-AAAA/n
 * -------------------------------------------------------------------------
 * 22-08-2026/1  Extraction du bloc <style> de login.php.
 *
 *   Le CSS vivait en ligne dans la page. Le sortir sert deux choses :
 *   il devient cacheable par le navigateur, et surtout il permet à la
 *   politique de sécurité de contenu (CSP) de la page d'interdire tout style
 *   en ligne — voir l'en-tête de login.php. L'URL porte un numéro de
 *   révision (?v=) pour qu'un cache périmé n'affiche jamais une page sans
 *   mise en forme : même précaution que CIF_CSS_VERSION sur index.php.
 *
 *   Les règles sont reprises telles quelles, à une exception près : les
 *   sélecteurs qui visaient les <i> de Boxicons visent désormais les <svg>
 *   dessinés directement dans la page.
 * ========================================================================= */

/* --- Styles Généraux --- */
body {
	font-family: sans-serif;
	background-color: #EFF8E7; /* Vert très pâle */
	margin: 0;
	padding: 3rem 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 100vh;
}

/* --- Styles Communs aux Boîtes --- */
.box {
	border-radius: 6px;
	margin-bottom: 2rem;
	box-sizing: border-box;
}

.box_header {
	padding: 0.75rem 1rem;
	border-top-left-radius: 6px;
	border-top-right-radius: 6px;
	font-weight: bold;
	display: flex;
	align-items: center;
	gap: 0.5em;
}

.box_body {
	padding: 1.25rem 1.5rem;
	border-bottom-left-radius: 6px;
	border-bottom-right-radius: 6px;
	line-height: 1.5;
}

.box_body p { margin-top: 0; }

.info-box { width: 72%; }

.info-box .box_header {
	background-color: #363636;
	color: white;
	border-bottom: 1px solid #363636;
}

.info-box .box_header .icon-placeholder {
	display: inline-flex;
	vertical-align: middle;
}

.info-box .box_body {
	background-color: #fafafa;
	color: #363636;
	border: 1px solid #dbdbdb;
	border-top: none;
}
.info-box .box_body a {
	color: #3cc46e;
	text-decoration: underline;
}
.info-box .box_body a:hover { color: #31a35f; }

.login-box {
	width: 45%;
	box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.02);
	color: #363636;
	border-radius: 6px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background-color: grey;
}

.login-box_title {
	font-size: 1.5em;
	font-weight: 600;
	color: #363636;
	text-align: center;
	padding: 1rem;
	margin-bottom: 0;
	background-color: white;
	box-shadow: 0px 4px 4px rgba(32,32,32,0.3);
	position: relative;
	z-index: 1;
}

.login-form {
	display: flex;
	flex-direction: column;
}

.login-form label {
	color: #363636;
	display: block;
	font-size: 0.9rem;
	font-weight: 700;
	margin-bottom: 0.4em;
}

/* Aide sous un champ : le libellé seul ne suffisait pas à dire qu'un club
   saisit son code et non une licence. */
.aide-champ {
	margin: -1.2rem 0 1.5rem;
	font-size: 0.78rem;
	color: #6b6b6b;
}

.login-form button[type="submit"] {
	background-color: #3cc46e;
	border: none;
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1.5;
	padding: 0.6em 1.5em;
	text-align: center;
	display: block;
	width: fit-content;
	margin: 1rem auto 0 auto;
}

.login-form button[type="submit"]:hover { background-color: #31a35f; }
.login-form button[type="submit"]:active {
	background-color: #27824c;
	box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2);
}

.login-box_content {
	padding: 1.5rem;
	background-color: white;
}

.login-box_links {
	margin-top: 1.5rem;
	display: flex;
	justify-content: space-between;
	font-size: 0.875rem;
	/* La boîte fait 45 % de la largeur : sous ~800px les deux liens se
	   touchaient au point de se lire comme une seule phrase. */
	gap: 1rem;
	flex-wrap: wrap;
}

.login-box_links a {
	color: #3cc46e;
	text-decoration: none;
}

.login-box_links a:hover {
	color: #363636;
	text-decoration: underline;
}

.input-container {
	display: flex;
	align-items: center;
	border: 1px solid #ccc;
	border-radius: 4px;
	height: 2.5em;
	overflow: hidden;
	transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
	position: relative;
	margin-bottom: 1.5rem;
}

.input-container.icon-left  { padding-left: 0.5em; }
.input-container.icon-right { padding-right: 0.5em; }

/* Les icônes étaient des <i> de Boxicons chargés depuis unpkg.com. Ce sont
   maintenant des <svg> écrits dans la page : aucune requête réseau, aucune
   police à télécharger, et la couleur suit currentColor comme avant. */
.icone {
	width: 1.25rem;
	height: 1.25rem;
	flex-shrink: 0;
	display: block;
}

/* INDISPENSABLE : une règle de classe portant display l'emporte sur le
   display:none que le navigateur applique à l'attribut hidden. Sans cette
   ligne, les deux icônes du bouton « afficher le mot de passe » restent
   visibles en même temps — constaté au rendu, pas deviné. */
.icone[hidden] { display: none; }

.input-container .icone {
	color: #DBDBDB;
	transition: color 0.2s ease-in-out;
	margin: 0 0.2em;
}

.input-container input {
	flex-grow: 1;
	height: 100%;
	border: none;
	outline: none;
	padding: 0 0.5em;
	font-size: 1em;
	min-width: 0;
}

/* Styles au focus du conteneur (quand l'input est focus) */
.input-container:focus-within {
	border-color: #3cc46e;
	box-shadow: 0 0 0 0.125em rgba(60, 196, 110, 0.25);
}

.input-container:focus-within .icone { color: #000; }

/* Bouton « afficher le mot de passe ».
   C'était un <i> muni d'un écouteur de clic : impossible à atteindre au
   clavier, et invisible pour un lecteur d'écran. C'est désormais un vrai
   <button>, masqué tant que le JavaScript n'a pas pris la main — sans lui
   il ne servirait à rien. */
.bouton-oeil {
	background: none;
	border: none;
	padding: 0 0.2em;
	margin: 0;
	cursor: pointer;
	color: #DBDBDB;
	display: flex;
	align-items: center;
	transition: color 0.2s ease-in-out;
}
.bouton-oeil:hover { color: #363636; }
.bouton-oeil:focus-visible {
	outline: 2px solid #3cc46e;
	outline-offset: 2px;
	border-radius: 3px;
}
.input-container:focus-within .bouton-oeil { color: #6b6b6b; }
.bouton-oeil[hidden] { display: none; }

/* --- Messages --- */
.error-message {
	color: red;
	background-color: #fdd;
	border: 1px solid red;
	padding: 1rem;
	border-radius: 4px;
	margin-bottom: 1.5rem;
	text-align: center;
	width: max(40%, 70%);
	max-width: 800px;
	box-sizing: border-box;
}

/* Confirmation (mot de passe réinitialisé, déconnexion). Même gabarit que
   l'erreur, aux couleurs de la page. */
.success-message {
	color: #1e6b3a;
	background-color: #e6f4ea;
	border: 1px solid #3cc46e;
	padding: 1rem;
	border-radius: 4px;
	margin-bottom: 1.5rem;
	text-align: center;
	width: max(40%, 70%);
	max-width: 800px;
	box-sizing: border-box;
}

/* Sur téléphone, les deux boîtes en pourcentage devenaient illisibles :
   elles passent pleine largeur. */
@media (max-width: 700px) {
	body { padding: 1.5rem 0.75rem; }
	.info-box, .login-box, .error-message, .success-message { width: 100%; }
}
