/* Espace client AJELI (13 octobre 2026). Inter, noir #0A0A0A, blanc dominant,
   accent #C5F230 une fois par composition, pas de gradient, mobile d'abord. */

:root {
	--ajes-fg: #0a0a0a;
	--ajes-bg: #ffffff;
	--ajes-accent: #c5f230;
	--ajes-gray-50: #fafafa;
	--ajes-gray-100: #f5f5f5;
	--ajes-gray-200: #e5e5e5;
	--ajes-gray-500: #737373;
	--ajes-gray-700: #404040;
	--ajes-error: #b3261e;
	--ajes-radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body.ajes {
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	color: var(--ajes-fg);
	background: var(--ajes-bg);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.ajes-wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 20px; }
.ajes-main { padding-bottom: 64px; }

.ajes-skip {
	position: absolute; left: -999px; top: 8px;
	background: var(--ajes-fg); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 50;
}
.ajes-skip:focus { left: 8px; }
.ajes-visually-hidden {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 22px; margin-bottom: 8px; }
h3 { font-size: 17px; margin: 28px 0 8px; }
h4 { font-size: 15px; margin: 14px 0 6px; }
p { margin-bottom: 12px; }
a { color: var(--ajes-fg); }

.ajes-brand { display: block; width: 84px; height: 28px; margin-bottom: 18px; }
.ajes-muted { color: var(--ajes-gray-500); }
.ajes-small { font-size: 14px; }
.ajes-strong { font-weight: 600; font-size: 17px; }
.ajes-error { color: var(--ajes-error); font-size: 14px; margin: 10px 0; }

/* Header */
.ajes-head { padding: 36px 0 20px; }
.ajes-accent-bar { width: 56px; height: 4px; background: var(--ajes-accent); margin: 16px 0 18px; }
.ajes-reserved { font-size: 15px; color: var(--ajes-gray-700); max-width: 640px; }

/* Onglets ancrés */
.ajes-tabs {
	position: sticky; top: 0; z-index: 20;
	background: var(--ajes-bg);
	border-bottom: 1px solid var(--ajes-gray-200);
}
.ajes-tabs ul { list-style: none; display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ajes-tabs ul::-webkit-scrollbar { display: none; }
.ajes-tabs a {
	display: block; white-space: nowrap;
	padding: 14px 12px; font-size: 14px; font-weight: 500;
	color: var(--ajes-gray-500); text-decoration: none;
	border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ajes-tabs a:hover { color: var(--ajes-fg); }
.ajes-tabs a[aria-current="true"] { color: var(--ajes-fg); border-bottom-color: var(--ajes-fg); }
.ajes-tabs a:focus-visible, .ajes-btn:focus-visible, .ajes-input:focus-visible, .ajes-textarea:focus-visible, .ajes-choice:focus-visible {
	outline: 2px solid var(--ajes-fg); outline-offset: 2px;
}

/* Sections */
.ajes-section { padding: 40px 0 8px; border-bottom: 1px solid var(--ajes-gray-200); }
.ajes-section:last-of-type { border-bottom: none; }

/* Cartes et listes */
.ajes-card {
	border: 1px solid var(--ajes-gray-200); border-radius: var(--ajes-radius);
	padding: 18px 20px; margin: 16px 0;
}
.ajes-card h3 { margin-top: 0; }
.ajes-list { list-style: none; }
.ajes-list li { padding: 6px 0 6px 18px; position: relative; }
.ajes-list li::before { content: ''; position: absolute; left: 0; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--ajes-fg); }
.ajes-dl div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--ajes-gray-100); }
.ajes-dl div:last-child { border-bottom: none; }
.ajes-dl dt { color: var(--ajes-gray-700); }
.ajes-dl dd { font-weight: 600; text-align: right; white-space: nowrap; }
/* Valeur longue (mention d'autoliquidation) : libellé puis valeur, sur deux lignes, sans débordement. */
.ajes-dl div.is-long { flex-direction: column; gap: 2px; }
.ajes-dl div.is-long dd { text-align: left; white-space: normal; overflow-wrap: anywhere; font-weight: 500; }

/* Réservation de la session (ouverte dès l'acompte) et paiements */
.ajes-session { border: 1px solid var(--ajes-gray-200); border-radius: var(--ajes-radius); padding: 14px 16px; margin: 4px 0 20px; }
.ajes-session.is-ouverte { border-color: var(--ajes-fg); }
.ajes-session p:last-child { margin-bottom: 0; }
/* Mise en place en trois sessions (21/10/2026) */
.ajes-mep { margin: 0 0 24px; }
.ajes-mep-sessions { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
.ajes-mep-sessions li { border-top: 1px solid var(--ajes-gray-200); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; color: var(--ajes-gray-500); }
.ajes-mep-sessions li strong { font-weight: 500; color: var(--ajes-fg); }
.ajes-mep-sessions li.is-faite strong::after { content: ' : faite'; font-weight: 400; color: var(--ajes-gray-500); }
.ajes-mep-sessions li.is-suivante { border-top: 2px solid var(--ajes-fg); }
.ajes-actions { list-style: none; margin: 8px 0 0; padding: 0; }
.ajes-action { padding: 10px 0; border-bottom: 1px solid var(--ajes-gray-200); }
.ajes-action label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.ajes-action input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: #0A0A0A; }
.ajes-actions-etat { font-size: 14px; color: var(--ajes-gray-500); margin: 10px 0 0; }
@media (min-width: 720px) { .ajes-mep-sessions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ajes-paiements { margin: 4px 0 18px; max-width: 520px; }
.ajes-paiements dd { font-weight: 500; }

/* Correction de la formule */
.ajes-fieldset { border: 0; margin: 0 0 14px; }
.ajes-fieldset legend { font-weight: 500; margin-bottom: 6px; }
.ajes-opt { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.ajes-opt input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--ajes-fg); flex: 0 0 auto; }
.ajes-formule .ajes-confirm-actions { margin-top: 12px; }

.ajes-docs { list-style: none; }
.ajes-docs li {
	display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
	padding: 14px 0; border-bottom: 1px solid var(--ajes-gray-100);
}
.ajes-docs li:last-child { border-bottom: none; }
.ajes-doc-title { font-weight: 500; }

/* Boutons */
.ajes-btn {
	font: inherit; font-size: 15px; font-weight: 600;
	border-radius: 8px; padding: 12px 20px; cursor: pointer;
	border: 1.5px solid var(--ajes-fg); background: var(--ajes-bg); color: var(--ajes-fg);
	text-decoration: none; display: inline-block; line-height: 1.2;
}
.ajes-btn:hover { background: var(--ajes-gray-100); }
.ajes-btn:disabled { opacity: .45; cursor: not-allowed; }
.ajes-btn-primary { background: var(--ajes-accent); border-color: var(--ajes-accent); }
.ajes-btn-primary:hover { background: var(--ajes-accent); filter: brightness(0.96); }
.ajes-btn-dark { background: var(--ajes-fg); color: #fff; }
.ajes-btn-dark:hover { background: var(--ajes-gray-700); }
.ajes-btn-outline { padding: 8px 14px; font-size: 14px; }
.ajes-btn-link { border: none; background: none; font-weight: 500; color: var(--ajes-gray-500); text-decoration: underline; padding: 8px 4px; }
.ajes-btn-link:hover { color: var(--ajes-fg); background: none; }
.ajes-btn-sm { padding: 8px 14px; font-size: 14px; }

/* Progression */
.ajes-progress { margin: 18px 0 8px; }
.ajes-progress-track { height: 4px; background: var(--ajes-gray-200); border-radius: 2px; overflow: hidden; }
.ajes-progress-bar { display: block; height: 100%; width: 0; background: var(--ajes-accent); transition: width .35s ease; }
.ajes-progress-text { font-size: 14px; color: var(--ajes-gray-500); margin: 8px 0 0; }

/* Questionnaire */
.ajes-bloc { padding: 22px 0 6px; border-top: 1px solid var(--ajes-gray-100); }
.ajes-bloc:first-child { border-top: none; }
.ajes-bloc-intro { color: var(--ajes-gray-500); font-size: 15px; margin: -2px 0 14px; }
.ajes-q { margin: 0 0 22px; }
.ajes-q[hidden] { display: none; }
.ajes-q-label { display: block; font-weight: 500; margin-bottom: 4px; }
.ajes-q-label .ajes-req { color: var(--ajes-gray-500); font-weight: 400; font-size: 13px; margin-left: 6px; }
.ajes-q-help { color: var(--ajes-gray-500); font-size: 14px; margin-bottom: 8px; }

.ajes-input, .ajes-textarea {
	width: 100%; font: inherit; color: var(--ajes-fg); background: var(--ajes-bg);
	border: 1.5px solid var(--ajes-gray-200); border-radius: 8px; padding: 10px 12px;
	transition: border-color .15s ease;
}
.ajes-input:focus, .ajes-textarea:focus { outline: none; border-color: var(--ajes-fg); }
.ajes-textarea { resize: vertical; min-height: 88px; }

.ajes-choices { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.ajes-choice {
	font: inherit; font-size: 15px; cursor: pointer;
	border: 1.5px solid var(--ajes-gray-200); border-radius: 8px; padding: 9px 14px;
	background: var(--ajes-bg); color: var(--ajes-fg);
}
.ajes-choice:hover { border-color: var(--ajes-gray-700); }
.ajes-choice[aria-pressed="true"], .ajes-choice[aria-checked="true"] { border-color: var(--ajes-fg); background: var(--ajes-gray-100); font-weight: 600; }

.ajes-confirm {
	border: 1.5px solid var(--ajes-gray-200); border-radius: 8px; padding: 12px 14px;
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--ajes-gray-50);
}
.ajes-confirm-value { flex: 1 1 220px; white-space: pre-wrap; word-break: break-word; }
.ajes-confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ajes-confirm-ok { color: var(--ajes-gray-700); font-size: 14px; }
.ajes-confirm-ok::before { content: '✓ '; font-weight: 600; }

.ajes-file { position: relative; display: block; border: 1.5px dashed var(--ajes-gray-200); border-radius: 8px; padding: 14px; cursor: pointer; color: var(--ajes-gray-500); font-size: 15px; }
.ajes-file:hover { border-color: var(--ajes-gray-700); }
.ajes-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ajes-file-name { margin-top: 6px; color: var(--ajes-fg); font-size: 14px; }

.ajes-submit { margin: 24px 0 8px; }
.ajes-submit .ajes-small { margin-top: 10px; }

/* Après soumission */
.ajes-apres { margin-top: 28px; padding-top: 8px; }
.ajes-merci { font-size: 17px; font-weight: 500; padding: 14px 16px; border-left: 3px solid var(--ajes-fg); background: var(--ajes-gray-50); }
.ajes-cols { display: grid; grid-template-columns: 1fr; gap: 14px; }
.ajes-col { border: 1px solid var(--ajes-gray-200); border-radius: var(--ajes-radius); padding: 14px 16px; }
.ajes-col h4 { margin-top: 0; }
.ajes-col ul { list-style: none; }
.ajes-col li { padding: 5px 0 5px 16px; position: relative; font-size: 15px; }
.ajes-col li::before { content: ''; position: absolute; left: 0; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--ajes-fg); }

/* Alfred : bulle fixe et panneau (14 octobre 2026) */
.ajes-bubble {
	position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
	display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 500; font-size: 15px;
	color: #fff; background: var(--ajes-fg); border: 0; border-radius: 999px; padding: 12px 18px; cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
}
.ajes-bubble:focus-visible, .ajes-chat-close:focus-visible { outline: 2px solid var(--ajes-fg); outline-offset: 3px; }
.ajes-chat-open .ajes-bubble { display: none; }
.ajes-chat-panel {
	position: fixed; z-index: 41; right: 0; bottom: 0; left: 0; height: min(86vh, 640px);
	display: flex; flex-direction: column; background: var(--ajes-bg);
	border: 1px solid var(--ajes-gray-200); border-radius: 14px 14px 0 0; padding: 14px 14px calc(10px + env(safe-area-inset-bottom, 0px));
	box-shadow: 0 -6px 24px rgba(0, 0, 0, .08);
}
.ajes-chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--ajes-gray-100); }
.ajes-chat-head h2 { font-size: 18px; margin: 0 0 2px; }
.ajes-chat-close { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--ajes-gray-100); color: var(--ajes-fg); cursor: pointer; }
.ajes-chat-panel .ajes-chat-log { flex: 1 1 auto; max-height: none; min-height: 0; padding-top: 10px; }
.ajes-chat-note { margin-top: 2px; }
.ajes-chat-count { min-height: 1em; margin: -4px 0 4px; text-align: right; }
.ajes-chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px 2px 8px; }
.ajes-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.ajes-msg-client { align-self: flex-end; background: var(--ajes-fg); color: #fff; border-bottom-right-radius: 4px; }
.ajes-msg-alfred { align-self: flex-start; background: var(--ajes-gray-100); border-bottom-left-radius: 4px; }
.ajes-msg-note { align-self: center; color: var(--ajes-gray-500); font-size: 14px; }
.ajes-chat-form { display: flex; gap: 8px; align-items: flex-end; margin: 10px 0; }
.ajes-chat-form textarea { flex: 1 1 auto; font: inherit; border: 1.5px solid var(--ajes-gray-200); border-radius: 8px; padding: 10px 12px; resize: vertical; min-height: 44px; }
.ajes-chat-form textarea:focus { outline: none; border-color: var(--ajes-fg); }

/* Pied de page et état */
.ajes-foot { border-top: 1px solid var(--ajes-gray-200); padding: 20px 0 96px; }
.ajes-saving {
	position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%);
	font-size: 13px; color: var(--ajes-fg); background: var(--ajes-bg);
	border: 1px solid var(--ajes-gray-200); border-radius: 999px; padding: 6px 14px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
	opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.ajes-saving.is-on { opacity: 1; }

/* Vérification d'appareil */
.ajes-gate-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.ajes-gate-box { width: 100%; max-width: 440px; }
.ajes-gate-box h1 { margin-bottom: 12px; }
.ajes-gate-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ajes-gate-form label { font-weight: 500; }
.ajes-gate-form input {
	font: inherit; font-size: 24px; letter-spacing: .3em; text-align: center;
	border: 1.5px solid var(--ajes-gray-200); border-radius: 8px; padding: 12px;
}
.ajes-gate-form input:focus { outline: none; border-color: var(--ajes-fg); }

@media (min-width: 720px) {
	h1 { font-size: 34px; }
	h2 { font-size: 26px; }
	.ajes-head { padding: 56px 0 24px; }
	.ajes-section { padding: 52px 0 16px; }
	.ajes-cols { grid-template-columns: repeat(3, 1fr); }
	.ajes-tabs a { padding: 16px 14px; font-size: 15px; }
	.ajes-bubble { right: 24px; bottom: 24px; }
	.ajes-chat-panel { left: auto; right: 24px; bottom: 24px; width: 400px; height: min(78vh, 620px); border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
}

/* Devis en blocs (14 octobre 2026) */
.ajes-bloc-card h4 { margin: 16px 0 6px; font-size: 1rem; }
.ajes-bloc-card p { margin: 0 0 10px; }
.ajes-table { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: .95rem; }
.ajes-table th, .ajes-table td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--ajes-gray-100); }
.ajes-table th { font-weight: 600; border-bottom: 1px solid var(--ajes-fg); }
.ajes-table tr.is-forte td { font-weight: 600; }
@media (max-width: 640px) {
	.ajes-table thead { display: none; }
	.ajes-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--ajes-gray-100); }
	.ajes-table td { display: block; border: 0; padding: 2px 0; }
	.ajes-table td:empty { display: none; }
	.ajes-table td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; color: var(--ajes-gray-700); font-size: .85rem; }
}

/* Rapports et mots-clés suivis (15 octobre 2026). */
.ajes-mc-list { list-style: none; margin: 8px 0 16px; padding: 0; }
.ajes-mc-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--ajes-gray-200); }
.ajes-mc-list .ajes-mc-mot { font-weight: 500; }
.ajes-mc-list .ajes-mc-info { color: var(--ajes-gray-500); font-size: 14px; }
.ajes-mc-list .ajes-mc-actions { display: flex; gap: 8px; }
.ajes-mc-list .is-retire .ajes-mc-mot { color: var(--ajes-gray-500); }
.ajes-mc-propose { background: var(--ajes-gray-50); padding: 16px; margin: 8px 0 16px; }
.ajes-mc-propose h4 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.ajes-mc-form { margin-top: 16px; }
.ajes-mc-form label { display: block; font-weight: 500; margin-bottom: 8px; }
.ajes-mc-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ajes-mc-row input { flex: 1 1 220px; min-height: 44px; padding: 0 12px; border: 1px solid var(--ajes-gray-200); border-radius: var(--ajes-radius); font: inherit; }
/* Aperçu administrateur : bandeau permanent, lecture seule. */
.ajes-apercu { position: sticky; top: 0; z-index: 50; background: var(--ajes-fg); color: var(--ajes-bg); padding: 10px 16px; font-size: 14px; text-align: center; }
.is-apercu [disabled] { opacity: .5; cursor: not-allowed; }
/* Les onglets restent visibles sous le bandeau (hauteur mesurée par espace.js). */
.is-apercu .ajes-tabs { top: var(--ajes-apercu-h, 40px); }
.is-apercu { scroll-padding-top: calc(64px + var(--ajes-apercu-h, 40px)); }

/* Entrée depuis le site, /espace-client/ (27 novembre 2026). */
.ajes-portail-espaces { list-style: none; margin: 16px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ajes-portail-espaces li { display: flex; flex-direction: column; gap: 4px; }
.ajes-portail-entite h2 { font-size: 1rem; font-weight: 600; margin: 12px 0 0; }
.ajes-head .ajes-autres-entites { margin-top: 8px; }
.ajes-gate-box > a img { display: block; }

/* Mes outils et Mes accès (27 novembre 2026). */
.ajes-outil-liens { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ajes-acces-resume { font-weight: 500; margin: 8px 0 0; }
.ajes-acces-rubrique { font-size: 17px; font-weight: 500; margin: 32px 0 4px; }
.ajes-acces-champ { padding: 16px 0; border-bottom: 1px solid var(--ajes-border, #E5E5E5); }
.ajes-acces-tete { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.ajes-acces-tete label { font-weight: 500; }
.ajes-acces-statut { font-size: 14px; white-space: nowrap; }
.ajes-acces-statut.est-depose { color: #0A0A0A; font-weight: 500; }
.ajes-acces-statut.est-a-faire { color: #737373; }
.ajes-acces-statut.est-refuse { color: #0A0A0A; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ajes-acces-form { display: flex; gap: 8px; margin-top: 8px; }
.ajes-acces-form input { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid #E5E5E5; border-radius: 8px; }
.ajes-acces-msg { margin: 6px 0 0; color: #404040; min-height: 1em; }
@media (max-width: 520px) { .ajes-acces-form { flex-direction: column; } }
