/* ============================================================
   Annuaire Entreprises — Styles frontend
   ============================================================ */

/* Variables */
:root {
	--ae-primary:      #2c6fad;
	--ae-primary-dark: #1a4f80;
	--ae-accent:       #e8f0fb;
	--ae-text:         #333;
	--ae-muted:        #666;
	--ae-border:       #dde3ea;
	--ae-card-bg:      #ffffff;
	--ae-card-logo-bg: #f7f8fa;
	--ae-badge-bg:     #e8f0fb;
	--ae-badge-color:  #2c6fad;
	--ae-btn-bg:       #2c6fad;
	--ae-btn-text:     #ffffff;
	--ae-member-btn-bg:      #2c6fad;
	--ae-member-btn-text:    #ffffff;
	--ae-single-header-bg:   #ffffff;
	--ae-single-header-text: #333333;
	--ae-single-infos-bg:    #f9fafc;
	--ae-single-infos-text:  #333333;
	--ae-radius:       8px;
	--ae-shadow:       0 2px 10px rgba(0,0,0,.08);
	--ae-shadow-hover: 0 6px 20px rgba(0,0,0,.14);
	--font-family-title : "Kallisto", sans-serif;
}

/* -------------------------------------------------------
   Barre de recherche
   ------------------------------------------------------- */
.ae-annuaire-wrapper {
	font-family: inherit;
	color: var(--ae-text);
}

.ae-search-form {
	background: var(--ae-accent);
	border: 1px solid var(--ae-border);
	border-radius: var(--ae-radius);
	padding: 20px 24px;
	margin-bottom: 28px;
}

.ae-search-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: flex-end;
}

.ae-search-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.ae-search-field label {
	font-size: .82em;
	font-weight: 600;
	color: var(--ae-primary);
	text-transform: uppercase;
	letter-spacing: 0;
	font-family : var(--font-family-title);
}

.ae-search-text  { flex: 2 1 220px; }
.ae-search-cat   { flex: 1 1 180px; }
.ae-search-cp    { flex: 0 1 120px; }
.ae-search-submit,
.ae-search-reset { flex: 0 0 auto; }

.ae-search-form input[type="text"],
.ae-search-form input[type="search"],
.ae-search-form select {
	width: 100%;
	padding: 9px 13px;
	border: 1px solid var(--ae-border);
	border-radius: 5px;
	font-size: 1em;
	background: #fff;
	color: var(--ae-text);
	box-shadow: none;
	transition: border-color .2s;
}

.ae-search-form input:focus,
.ae-search-form select:focus {
	outline: none;
	border-color: var(--ae-primary);
}

/* -------------------------------------------------------
   Boutons
   ------------------------------------------------------- */
.ae-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	border-radius: 5px;
	font-size: .93em;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background .2s, color .2s;
	border: none;
	font-family: var(--font-family-title);
	text-transform:uppercase;
}

.ae-btn-search {
	background: var(--ae-btn-bg);
	color: var(--ae-btn-text);
}
.ae-btn-search:hover {
	background: var(--ae-primary-dark);
	color: var(--ae-btn-text);
}

.ae-btn-reset {
	background: #fff;
	color: var(--ae-muted);
	border: 1px solid var(--ae-border);
	padding: 8px 14px;
}
.ae-btn-reset:hover {
	background: #f5f5f5;
	color: var(--ae-text);
}

.ae-btn-order {
	background: #fff;
	color: var(--ae-primary);
	border: 1px solid var(--ae-primary);
	padding: 8px 14px;
	font-size: .88em;
	white-space: nowrap;
}
.ae-btn-order:hover {
	background: var(--ae-accent);
}

.ae-btn-voir {
	background: var(--ae-btn-bg);
	color: var(--ae-btn-text);
	border: 1px solid var(--ae-btn-bg);
	padding: 10px 14px;
	font-size: .87em;
	display: flex;
	justify-content: center;
	width: 100%;
	box-sizing: border-box;
}
.ae-btn-voir:hover {
	background: var(--ae-primary-dark);
	border-color: var(--ae-primary-dark);
	color: var(--ae-btn-text);
}

/* -------------------------------------------------------
   Grille de fiches
   ------------------------------------------------------- */
.ae-grid {
	display: grid;
	gap: 22px;
}

.ae-col-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ae-col-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ae-col-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* -------------------------------------------------------
   Carte entreprise
   ------------------------------------------------------- */
.ae-card {
	background: var(--ae-card-bg);
	border: 1px solid var(--ae-border);
	border-radius: var(--ae-radius);
	box-shadow: var(--ae-shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .2s, transform .2s;
}
.ae-card:hover {
	box-shadow: var(--ae-shadow-hover);
	transform: translateY(-2px);
}

.ae-card-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 130px;
	background: var(--ae-card-logo-bg);
	padding: 16px;
	border-bottom: 1px solid var(--ae-border);
	box-sizing: border-box;
}
.ae-card-logo img {
	max-height: 90px;
	max-width: 100%;
	width: auto;
	object-fit: contain;
}

.ae-card-body {
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.ae-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-bottom: 8px;
}

.ae-badges + .ae-card-title,
.ae-badges + h1 {
	margin-top: 0;
}

.ae-badge {
	display: inline-block;
	background: var(--ae-badge-bg);
	color: var(--ae-badge-color);
	font-size: .75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	padding: 3px 15px;
	border-radius: 20px;
}

.ae-card-title {
	font-size: 1.1em;
	font-weight: 700;
	margin: 0 0 8px;
	line-height: 1.3;
}
.ae-card-title a {
	color: var(--ae-text);
	text-decoration: none;
}
.ae-card-title a:hover {
	color: var(--ae-primary);
}

.ae-card-excerpt {
	font-size: .9em;
	color: var(--ae-muted);
	margin: 0 0 14px;
	line-height: 1.5;
}

/* -------------------------------------------------------
   Liste d'infos
   ------------------------------------------------------- */
.ae-card-infos {
	list-style: none;
	margin: 0;
	padding: 15px 0 0;
	display: flex;
	flex-direction: column;
	gap: 7px;
	font-size: .88em;
	border-top: 1px solid var(--ae-badge-bg);
}

.ae-card-top {
	height: 170px;
	overflow: hidden;
	flex-shrink: 0;
	padding-top:15px;
	border-top: 1px solid var(--ae-badge-bg);
}

.ae-card-footer {
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px solid var(--ae-border);
}

.ae-card-infos li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	color: var(--ae-muted);
}

.ae-card-infos i {
	font-size: 16px;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: var(--ae-primary);
	margin-top: 1px;
}

.ae-card-infos em {
	display: block;
	font-size: .9em;
	color: var(--ae-muted);
	font-style: italic;
}

.ae-card-infos a {
	color: var(--ae-primary);
	text-decoration: none;
}
.ae-card-infos a:hover {
	text-decoration: underline;
}

/* -------------------------------------------------------
   Aucun résultat
   ------------------------------------------------------- */
.ae-no-result {
	text-align: center;
	color: var(--ae-muted);
	padding: 48px 20px;
	font-size: 1.05em;
	background: #f9f9f9;
	border-radius: var(--ae-radius);
	border: 1px dashed var(--ae-border);
}

/* -------------------------------------------------------
   Pagination
   ------------------------------------------------------- */
.ae-pagination {
	margin-top: 32px;
	text-align: center;
}
.ae-pagination .page-numbers {
	display: inline-block;
	padding: 7px 13px;
	margin: 2px;
	border: 1px solid var(--ae-border);
	border-radius: 5px;
	text-decoration: none;
	color: var(--ae-primary);
	font-size: .92em;
}
.ae-pagination .page-numbers.current {
	background: var(--ae-primary);
	color: #fff;
	border-color: var(--ae-primary);
}
.ae-pagination .page-numbers:hover:not(.current) {
	background: var(--ae-accent);
}

/* -------------------------------------------------------
   Loading overlay
   ------------------------------------------------------- */
.ae-loading {
	text-align: center;
	padding: 40px;
	color: var(--ae-muted);
	font-style: italic;
}

/* -------------------------------------------------------
   Archive entreprises
   ------------------------------------------------------- */
.ae-archive-wrapper {
	max-width: 1100px;
	margin: 40px auto;
	padding: 0 20px;
}

.ae-archive-header-link {
	display: flex;
	align-items: center;
	gap: 20px;
	text-decoration: none;
	color: inherit;
}
.ae-archive-header-link:hover {
	text-decoration: none;
	opacity: .85;
}

.ae-archive-header {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 24px;
}

/* Sur la fiche single, logo + titre sont dans un lien, le gap est déjà sur le lien */
.ae-archive-header-link .ae-archive-logo,
.ae-archive-header-link .ae-archive-title {
	margin: 0;
}

.ae-archive-logo {
	flex-shrink: 0;
}

.ae-archive-logo img {
	max-height: 80px;
	width: auto;
	display: block;
}

.ae-archive-title {
	margin: 0;
	font-size: 1.8em;
	font-weight:600;
	text-transform: uppercase;
	font-family: 'Kallisto', kallisto, sans-serif;
}

/* -------------------------------------------------------
   Page single entreprise
   ------------------------------------------------------- */
.ae-single-wrapper {
	max-width: 1100px;
	margin: 40px auto;
	padding: 0 20px;
}

.ae-single-image {
	margin-bottom: 28px;
}

.ae-single-image img {
	width: 100%;
	max-height: 380px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--ae-border);
}

.ae-single-desc-title {
	color: var(--ae-primary);
	text-transform: uppercase;
	font-size: 1em;
	letter-spacing: .06em;
	margin-bottom: 12px;
}

.ae-single-back {
	margin-top: 36px;
}

/* -------------------------------------------------------
   Info membre dans le header
   ------------------------------------------------------- */
.ae-member-info {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
	flex-shrink: 0;
}

.ae-member-info .ae-btn {
	background: var(--ae-member-btn-bg);
	color: var(--ae-member-btn-text);
}
.ae-member-info .ae-btn:hover {
	background: var(--ae-primary-dark);
	color: var(--ae-member-btn-text);
}




.ae-single-search {
	margin-bottom: 32px;
}

.ae-single-header {
	display: flex;
	align-items: flex-start;
	gap: 24px;
	margin-bottom: 28px;
	padding-bottom: 24px;
	border-bottom: 2px solid var(--ae-border);
	background: var(--ae-single-header-bg);
	color: var(--ae-single-header-text);
	padding:20px;
}

.ae-single-logo img {
	max-width: 140px;
	height: auto;
	border-radius: 6px;
	border: 1px solid var(--ae-border);
}

.ae-single-title {
	font-size: 2em;
	font-weight: 800;
	margin: 0 0 6px;
}

.ae-single-infos {
	background: var(--ae-single-infos-bg);
	color: var(--ae-single-infos-text);
	border: 1px solid var(--ae-border);
	border-radius: var(--ae-radius);
	padding: 22px 26px;
	margin-bottom: 28px;
}

.ae-single-infos h3 {
	margin: 0 0 16px;
	font-size: 1em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--ae-primary);
}

.ae-single-infos ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ae-single-infos li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: .95em;
}

.ae-single-infos i {
	color: var(--ae-primary);
	flex-shrink: 0;
	margin-top: 2px;
}

.ae-single-infos a {
	color: var(--ae-primary);
	text-decoration: none;
}
.ae-single-infos a:hover { text-decoration: underline; }

/* -------------------------------------------------------
   Carte Leaflet (fiche single)
   ------------------------------------------------------- */
.ae-single-map-wrapper {
	margin-bottom: 28px;
}

.ae-single-map-wrapper h3 {
	margin: 0 0 12px;
	font-size: 1em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--ae-primary);
}

#ae-map {
	height: 320px;
	border-radius: var(--ae-radius);
	border: 1px solid var(--ae-border);
	z-index: 0;
}

/* -------------------------------------------------------
   Pages d'authentification (connexion / reset mot de passe)
   ------------------------------------------------------- */
.ae-auth-annuaire-header {
	margin-bottom: 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--ae-border);
}

.ae-auth-annuaire-link {
	display: flex;
	align-items: center;
	gap: 14px;
	text-decoration: none;
	color: inherit;
}
.ae-auth-annuaire-link:hover {
	opacity: .85;
	text-decoration: none;
}

.ae-auth-annuaire-logo {
	max-height: 56px;
	width: auto;
	display: block;
}

.ae-auth-annuaire-name {
	font-size: 1.1em;
	line-height: 1.1em;
	font-weight: 600;
	color: var(--ae-primary);
	text-transform: uppercase;
	font-family: 'Kallisto', kallisto, sans-serif;
}

.ae-auth-wrapper {
	max-width: 420px;
	margin: 60px auto 80px;
	padding: 0 20px;
}

.ae-auth-box {
	background: var(--ae-card-bg);
	border: 1px solid var(--ae-border);
	border-radius: var(--ae-radius);
	padding: 36px 40px;
	box-shadow: var(--ae-shadow);
}

.ae-auth-title {
	margin: 0 0 6px;
	font-size: 1.1em;
	font-weight:600;
	text-align:center;
	color: var(--ae-card-bg);
	background:var(--ae-primary);
	padding: 8px 16px ;
	border-radius :999px;
}

.ae-auth-subtitle {
	margin: 0 0 24px;
	color: var(--ae-primary);
	font-size: .8em;
}

.ae-auth-error {
	background: #fdecea;
	border: 1px solid #f5c6cb;
	color: #d63638;
	padding: 10px 14px;
	border-radius: 5px;
	margin-bottom: 18px;
	font-size: .9em;
}

.ae-auth-success {
	background: #edf7ed;
	border: 1px solid #b7dfb8;
	color: #1d7a1f;
	padding: 12px 14px;
	border-radius: 5px;
	font-size: .92em;
	margin: 16px 0 24px;
}

.ae-form-group {
	margin-bottom: 15px;
}

.ae-form-label {
	display: block;
	font-size: .7em;
	font-weight: 600;
	color:var(--ae-primary);
	margin-bottom: 5px;
}

.ae-form-input {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--ae-border);
	border-radius: 5px;
	font-size: 1em;
	box-sizing: border-box;
}

.ae-form-forgot {
	text-align: right;
	margin: 0 0 20px;
}

.ae-auth-link {
	font-size: .83em;
	color: var(--ae-primary);
	text-decoration: none;
}
.ae-auth-link:hover { text-decoration: underline; }

.ae-auth-back {
	text-align: center;
	margin: 18px 0 0;
}

.ae-auth-btn-full {
	width: 100%;
	display: block;
	text-align: center;
	box-sizing: border-box;
}

/* -------------------------------------------------------
   Responsive
   ------------------------------------------------------- */
@media (max-width: 640px) {

	/* --- En-tête annuaire : titre + bouton déconnexion --- */
	.ae-archive-header {
		gap: 10px;
		margin-bottom: 16px;
	}
	.ae-archive-logo img {
		max-height: 48px;
	}
	.ae-archive-title {
		font-size: 1.1em;
	}
	.ae-member-info .ae-btn {
		font-size: .75em;
		padding: 6px 10px;
	}
	/* Masquer le login, ne garder que l'icône */
	.ae-member-info .ae-btn .ae-login-text {
		display: none;
	}

	/* --- Barre de recherche --- */
	.ae-search-field label {
		display: none;
	}
	.ae-search-form {
		padding: 12px 14px;
	}
	/* Flex wrap : chaque champ passe à 100%, boutons sur une ligne */
	.ae-search-fields {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 8px;
	}
	.ae-search-form input[type="text"],
	.ae-search-form input[type="search"],
	.ae-search-form select {
		font-size: .88em;
		padding: 8px 10px;
	}
	/* Champs à 100% de largeur */
	.ae-search-text,
	.ae-search-cat,
	.ae-search-cp {
		flex: 1 1 100%;
	}
	/* Bouton recherche + tri sur une seule ligne, partagent la largeur */
	.ae-search-submit {
		flex: 1 1 auto;
		order: 10;
	}
	.ae-search-order {
		flex: 0 0 auto;
		order: 11;
	}
	.ae-search-reset {
		flex: 1 1 100%;
		order: 12;
	}
	.ae-btn-search,
	.ae-btn-order,
	.ae-btn-reset {
		font-size: .8em;
		padding: 8px 10px;
		width: 100%;
		justify-content: center;
	}

	/* --- Grille de fiches --- */
	.ae-col-2,
	.ae-col-3,
	.ae-col-4 {
		grid-template-columns: 1fr;
	}

	/* --- Fiche single --- */
	.ae-single-header {
		flex-direction: column;
	}

	/* Masquer la barre de recherche sur la fiche single */
	.ae-single-search {
		display: none;
	}
}
