/* UtopIA Guides : reprend la charte du positionnement (dégradé noir → bleu,
   fond gris clair), sans dépendance externe : polices système, pas de CDN. */

:root {
	--primaire: #48338A;
	--degrade: linear-gradient(93.12deg, #000000 0.52%, var(--primaire) 100%);
	--fond: #f1f1f1;
	--carte: #ffffff;
	--texte: #1a1a1a;
	--texteDoux: #5a5a66;
	--bordure: #d8d8e0;
	--surligne: #fff2a8;
	--erreur: #cc3300;
	--ombre: 0 2px 8px rgba(0, 0, 0, 0.08);
	--rayon: 10px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 100%;
	line-height: 1.5;
	color: var(--texte);
	background: var(--fond);
}

/* Masqué à l'écran mais lu par les lecteurs d'écran. */
.visuellement-cache {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Cadre, en-tête et pied (même design que le positionnement) ---------- */
.cadre {
	position: fixed;
	inset: 10px;
	display: flex;
	flex-direction: column;
	background: rgba(255, 255, 255, 0.90);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
	/* Haut très arrondi, bas à peine : comme le positionnement. overflow caché
	   pour que l'en-tête et le pied épousent ces coins. */
	border-radius: 20px 20px 10px 10px;
	overflow: hidden;
}

.entete {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	padding: 15px 20px;
	color: #fff;
	background: var(--degrade);
	box-shadow: 0 10px 10px rgba(0, 0, 0, 0.15);
	/* L'ombre doit passer au-dessus de la zone qui défile. */
	position: relative;
	z-index: 2;
}
.entete__logo { flex-shrink: 0; }
.entete__titre { min-width: 0; flex: 1 1 auto; }
.entete h1 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.entete p { margin: 0; font-size: 0.9rem; }
/* Bouton rond blanc, comme ceux du positionnement. */
.entete__bouton {
	margin-left: auto;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border: 1.5px solid #fff;
	border-radius: 50%;
	background: transparent;
	text-decoration: none;
}
.entete__bouton:hover, .entete__bouton:focus-visible { background: rgba(255, 255, 255, 0.15); }

/* Pied de page très fin, dégradé inversé, vide pour le moment. */
.pied {
	flex-shrink: 0;
	height: 14px;
	background: linear-gradient(268.91deg, #000000 -2.14%, var(--primaire) 99.69%);
	box-shadow: 0 -10px 10px rgba(0, 0, 0, 0.15);
	position: relative;
	z-index: 2;
}

/* La zone centrale est la seule à défiler. */
.zone {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
}

/* ---------- Zone de recherche ---------- */
.contenu {
	max-width: 900px;
	margin: 0 auto;
	padding: 24px 16px 48px;
}

.recherche__ligne { display: flex; gap: 8px; }

.recherche input[type="search"] {
	flex: 1;
	min-width: 0;
	padding: 12px 14px;
	font: inherit;
	font-size: 1.05rem;
	border: 1px solid var(--bordure);
	border-radius: var(--rayon);
	background: var(--carte);
	box-shadow: var(--ombre);
}
.recherche input[type="search"]:focus {
	outline: 2px solid var(--primaire);
	outline-offset: 1px;
}

button {
	font: inherit;
	cursor: pointer;
}
.recherche button, .login-box button {
	padding: 12px 22px;
	color: #fff;
	font-weight: 600;
	border: none;
	border-radius: var(--rayon);
	background: var(--degrade);
}
.recherche button:disabled { opacity: 0.6; cursor: progress; }

.recherche__options {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 10px;
	font-size: 0.9rem;
	color: var(--texteDoux);
}
.recherche__options label { display: flex; align-items: center; gap: 6px; }
.recherche__options select {
	font: inherit;
	max-width: 60vw;
	padding: 4px 6px;
	border: 1px solid var(--bordure);
	border-radius: 6px;
	background: var(--carte);
	color: var(--texte);
}

.etat {
	margin: 14px 0 0;
	font-size: 0.85rem;
	color: var(--texteDoux);
}

.message {
	margin: 20px 0 0;
	padding: 14px 16px;
	border-radius: var(--rayon);
	background: var(--carte);
	box-shadow: var(--ombre);
}
.message--erreur { border-left: 4px solid var(--erreur); }

/* Petit indicateur de chargement, coupé si l'utilisateur préfère moins
   d'animations. */
.message--attente::before {
	content: "";
	display: inline-block;
	width: 0.9em; height: 0.9em;
	margin-right: 8px;
	vertical-align: -0.1em;
	border: 2px solid var(--bordure);
	border-top-color: var(--primaire);
	border-radius: 50%;
	animation: tourne 0.8s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.message--attente::before { animation: none; }
}

/* ---------- Résultats ---------- */
.resultats {
	list-style: none;
	margin: 20px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.resultat {
	padding: 16px 18px;
	border-radius: var(--rayon);
	background: var(--carte);
	box-shadow: var(--ombre);
}

.resultat__haut {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	font-size: 0.8rem;
}
.resultat__guide {
	padding: 2px 10px;
	border-radius: 999px;
	color: #fff;
	background: var(--degrade);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.resultat__score { color: var(--texteDoux); white-space: nowrap; }

.resultat__titre { margin: 8px 0 2px; font-size: 1.1rem; }
.resultat__titre a { color: var(--primaire); text-decoration: none; }
.resultat__titre a:hover, .resultat__titre a:focus-visible { text-decoration: underline; }

.resultat__chemin {
	margin: 0;
	font-size: 0.8rem;
	color: var(--texteDoux);
}

.resultat__extrait, .resultat__autresListe p {
	margin: 10px 0 0;
	white-space: pre-line;
	overflow-wrap: anywhere;
}

mark {
	background: var(--surligne);
	color: inherit;
	padding: 0 1px;
	border-radius: 2px;
}

.resultat__autres { margin-top: 10px; font-size: 0.92rem; }
.resultat__autres summary { cursor: pointer; color: var(--primaire); }
.resultat__autresListe p {
	padding-left: 12px;
	border-left: 3px solid var(--bordure);
}

/* ---------- Connexion ---------- */
.page-login {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.login-box {
	width: 100%;
	max-width: 480px;
	padding: 2rem;
	text-align: center;
	color: #fff;
	border-radius: 12px;
	background: var(--degrade);
	box-shadow: 12px 12px 24px rgba(0, 0, 0, 0.5);
}
.login-box h1 { margin: 0 0 4px; font-size: 1.5rem; }
.login-box input {
	width: 100%;
	margin: 0.4rem 0;
	padding: 0.6rem;
	font: inherit;
	border: 1px solid #ccc;
	border-radius: 6px;
}
.login-box button {
	width: 100%;
	margin-top: 1rem;
	background: linear-gradient(93.12deg, var(--primaire) -10%, #000000 110%);
}
.login-erreur { color: #ffb3a0; margin: 0.8rem 0 0; min-height: 1.5em; }
.login-note { margin: 0.6rem 0 0; font-size: 0.8rem; opacity: 0.8; }

/* ---------- Petits écrans ---------- */
@media (max-width: 560px) {
	.entete { padding: 12px 16px; }
	.entete p { display: none; }
	.cadre { inset: 6px; }
	.recherche__ligne { flex-direction: column; }
}
