/* Espace client Compta-Form — feuille de style autonome, préfixée .cf-ec */

.cf-ec {
	--cf-bleu: #1a4d8f;
	--cf-bleu-fonce: #143c6f;
	--cf-encre: #1d2327;
	--cf-gris: #6b7280;
	--cf-bord: #e2e5ea;
	--cf-fond: #f6f7f9;
	color: var(--cf-encre);
	font-size: 16px;
	line-height: 1.6;
	max-width: 900px;
	margin: 0 auto;
}

.cf-ec *,
.cf-ec *::before,
.cf-ec *::after { box-sizing: border-box; }

/* ------------------------------------------------------------- Conteneurs */

/* Un formulaire de connexion étalé sur 900 px est illisible : le regard perd
   la ligne entre l'étiquette et le champ. */
.cf-ec-login { max-width: 520px; }
.cf-ec-space { padding-bottom: 8px; }
.cf-ec-topup { margin: 0; }
.cf-ec-signers:empty { display: none; }

/* ------------------------------------------------------------------ Cartes */

.cf-ec-card {
	background: #fff;
	border: 1px solid var(--cf-bord);
	border-radius: 12px;
	padding: 24px;
	margin: 0 0 18px;
}

.cf-ec-h2 { font-size: 24px; line-height: 1.25; margin: 0 0 8px; }
.cf-ec-h3 { font-size: 18px; line-height: 1.3; margin: 0 0 10px; }
.cf-ec-lead { margin: 0 0 14px; color: #374151; }
.cf-ec-fine { margin: 8px 0 0; font-size: 13px; color: var(--cf-gris); }
.cf-ec-muted { color: var(--cf-gris); }
.cf-ec-link { color: var(--cf-bleu); text-decoration: underline; font-size: 14px; }

/* La déconnexion est un envoi, pas un lien — il faut donc défaire l'habillage
   que le navigateur et le thème donnent aux boutons pour qu'elle en ait
   malgré tout l'apparence. */
button.cf-ec-link {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	font-size: 14px;
	line-height: inherit;
	cursor: pointer;
}
button.cf-ec-link:hover { color: var(--cf-bleu-fonce); }
.cf-ec-logout { margin: 0; }

.cf-ec-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 18px;
}
.cf-ec-head p { margin: 0; }

/* ------------------------------------------------------------------ Boutons */

.cf-ec-btn {
	display: inline-block;
	background: var(--cf-bleu);
	color: #fff;
	border: 1px solid var(--cf-bleu);
	border-radius: 8px;
	padding: 11px 18px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s ease;
}
.cf-ec-btn:hover { background: var(--cf-bleu-fonce); color: #fff; }
.cf-ec-btn:disabled { opacity: .5; cursor: not-allowed; }
.cf-ec-btn--wide { width: 100%; margin-top: 6px; }
/* Deux générateurs côte à côte : ils passent l'un sous l'autre sur téléphone. */
.cf-ec-liens { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
.cf-ec-btn--ghost { background: #fff; color: var(--cf-bleu); }
.cf-ec-btn--ghost:hover { background: var(--cf-fond); color: var(--cf-bleu); }
.cf-ec-btn--quiet {
	background: none;
	border-color: transparent;
	color: var(--cf-gris);
	font-weight: 500;
	padding: 11px 10px;
}
.cf-ec-btn--quiet:hover { background: var(--cf-fond); color: var(--cf-encre); }
.cf-ec-inline { display: inline; margin: 0; }

/* ------------------------------------------------------------ Formulaires */

.cf-ec-label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 5px; }
.cf-ec-input {
	width: 100%;
	padding: 11px 13px;
	font-size: 16px;
	border: 1px solid #c8ccd4;
	border-radius: 8px;
	background: #fff;
	color: var(--cf-encre);
}
.cf-ec-input:focus { outline: 2px solid var(--cf-bleu); outline-offset: 1px; border-color: var(--cf-bleu); }

/* Piège à robots : invisible mais accessible aux automates. */
.cf-ec-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* -------------------------------------------------------------- Messages */

.cf-ec-note {
	border-radius: 8px;
	padding: 12px 14px;
	margin: 0 0 16px;
	font-size: 15px;
	border: 1px solid;
}
.cf-ec-note--ok { background: #eef7f0; border-color: #bcdfc6; color: #1d4c2b; }
.cf-ec-note--ko { background: #fdf0ef; border-color: #f0c4c0; color: #7a2620; }

/* --------------------------------------------------------------- Compteurs */

.cf-ec-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 16px;
	margin: 0 0 18px;
}
.cf-ec-grid .cf-ec-card { margin: 0; }
.cf-ec-stat__k { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--cf-gris); }
.cf-ec-stat__v { margin: 4px 0 0; font-size: 30px; font-weight: 700; line-height: 1.1; }
.cf-ec-stat__v span { font-size: 17px; font-weight: 500; color: var(--cf-gris); }

/* -------------------------------------------------------------- Documents */

.cf-ec-docs { list-style: none; margin: 0; padding: 0; }
.cf-ec-doc {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 0;
	border-top: 1px solid var(--cf-bord);
}
.cf-ec-doc:first-child { border-top: 0; padding-top: 4px; }
.cf-ec-doc__main { flex: 1 1 260px; min-width: 0; }
.cf-ec-doc__t { margin: 0; font-weight: 600; }
.cf-ec-doc__m { margin: 4px 0 0; font-size: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cf-ec-doc__acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cf-ec-doc__acts .cf-ec-btn { padding: 8px 14px; font-size: 14px; }

.cf-ec-tag {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	border-radius: 999px;
	padding: 3px 10px;
}
.cf-ec-tag--neutre { background: #eef0f3; color: #414750; }
.cf-ec-tag--attente { background: #fff4e0; color: #8a5a08; }
.cf-ec-tag--ok { background: #e7f5ec; color: #1d6b3a; }
.cf-ec-tag--ko { background: #fdeceb; color: #8a2e26; }

/* ------------------------------------------------------------ Rechargement */

.cf-ec-amounts { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
.cf-ec-amount {
	flex: 1 1 130px;
	border: 1px solid var(--cf-bord);
	border-radius: 10px;
	padding: 14px;
	cursor: pointer;
	text-align: center;
	transition: border-color .15s ease, background .15s ease;
}
.cf-ec-amount:hover { border-color: var(--cf-bleu); }
.cf-ec-amount:has(input:checked) { border-color: var(--cf-bleu); background: #f2f6fb; }
.cf-ec-amount input { margin: 0 0 6px; }
.cf-ec-amount__v { display: block; font-size: 19px; font-weight: 700; }
.cf-ec-amount__u { display: block; font-size: 13px; color: var(--cf-gris); }

/* --------------------------------------------------------------- Historique */

.cf-ec-histo summary { cursor: pointer; }
.cf-ec-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.cf-ec-table td { padding: 8px 0; border-top: 1px solid var(--cf-bord); }
.cf-ec-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------------ Fenêtre */

.cf-ec-modal {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, .55);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 24px 16px;
	overflow-y: auto;
	z-index: 99999;
}
.cf-ec-modal[hidden] { display: none; }
.cf-ec-modal__box {
	position: relative;
	background: #fff;
	border-radius: 14px;
	padding: 26px;
	width: 100%;
	max-width: 560px;
	margin: auto;
}
.cf-ec-modal__x {
	position: absolute;
	top: 10px;
	right: 12px;
	background: none;
	border: 0;
	font-size: 26px;
	line-height: 1;
	color: var(--cf-gris);
	cursor: pointer;
	padding: 4px 8px;
}
.cf-ec-modal__acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.cf-ec-signer {
	border: 1px solid var(--cf-bord);
	border-radius: 10px;
	padding: 14px;
	margin: 0 0 12px;
	position: relative;
}
.cf-ec-signer__row { display: flex; gap: 10px; flex-wrap: wrap; }
.cf-ec-signer__row > * { flex: 1 1 150px; }
.cf-ec-signer__x {
	position: absolute;
	top: 8px;
	right: 10px;
	background: none;
	border: 0;
	color: var(--cf-gris);
	cursor: pointer;
	font-size: 13px;
	text-decoration: underline;
}

/* -------------------------------------------------------------- Passerelle */

.cf-ec-bridge { margin: 24px auto; }
.cf-ec-bridge__card { border-left: 4px solid var(--cf-bleu); }

@media (max-width: 600px) {
	.cf-ec-card { padding: 18px; }
	.cf-ec-doc__acts { width: 100%; }
	.cf-ec-head { flex-direction: column; gap: 8px; }
}
