/**
 * JOS Paysage — Simulateur d'estimation
 * Toutes les règles sont préfixées .jos- pour ne jamais entrer en conflit
 * avec le thème ou Elementor.
 */

.jos-simulateur {
	--jos-primaire: #4a7c23;
	--jos-foncee: #2d5016;
	--jos-accent: #0284c7;
	--jos-largeur: 600px;

	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	max-width: var(--jos-largeur);
	margin: 0 auto;
	padding: 30px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
	box-sizing: border-box;
	color: #333;
}

.jos-simulateur *,
.jos-simulateur *::before,
.jos-simulateur *::after {
	box-sizing: border-box;
}

.jos-titre {
	color: var(--jos-foncee);
	margin: 0 0 25px;
	font-size: 24px;
	line-height: 1.3;
	text-align: center;
}

/* ---------- Écrans ---------- */

.jos-ecran {
	display: none;
}

.jos-ecran.is-actif {
	display: block;
}

/* ---------- Écran code postal ---------- */

.jos-ecran-cp {
	text-align: center;
	padding: 30px 10px;
}

.jos-ecran-cp h3 {
	color: var(--jos-foncee);
	margin: 0 0 15px;
	font-size: 19px;
}

.jos-ecran-cp p {
	margin: 0 0 20px;
	color: #555;
	font-size: 15px;
	line-height: 1.5;
}

.jos-input-cp {
	width: 200px;
	max-width: 100%;
	padding: 12px;
	font-size: 18px;
	text-align: center;
	border: 2px solid var(--jos-primaire);
	border-radius: 8px;
	margin-bottom: 15px;
	display: block;
	margin-left: auto;
	margin-right: auto;
	letter-spacing: 2px;
}

.jos-input-cp:focus {
	outline: none;
	border-color: var(--jos-foncee);
	box-shadow: 0 0 0 3px rgba(74, 124, 35, .15);
}

.jos-btn-verifier {
	width: 200px;
	max-width: 100%;
	margin: 0 auto;
	display: block;
}

.jos-hors-zone {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
	padding: 20px;
	border-radius: 8px;
	text-align: center;
	margin-top: 20px;
	font-size: 14px;
	line-height: 1.5;
}

.jos-hors-zone h4 {
	margin: 0 0 10px;
	font-size: 16px;
}

.jos-hors-zone a {
	color: #721c24;
	font-weight: 600;
	text-decoration: none;
}

.jos-hors-zone a:hover {
	text-decoration: underline;
}

/* ---------- Bouton retour ---------- */

.jos-btn-retour {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: none;
	color: #666;
	font-size: 14px;
	font-family: inherit;
	cursor: pointer;
	padding: 10px 0;
	margin-bottom: 15px;
	transition: color .3s;
}

.jos-btn-retour:hover {
	color: var(--jos-primaire);
}

.jos-btn-retour svg {
	width: 20px;
	height: 20px;
}

/* ---------- Prestations ---------- */

.jos-prestation {
	background: #f8faf5;
	padding: 20px;
	border-radius: 8px;
	margin-bottom: 15px;
	border-left: 4px solid var(--jos-primaire);
	position: relative;
}

.jos-prestation.is-mise-en-avant {
	background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
	border: 2px solid var(--jos-accent);
	border-left: 4px solid var(--jos-accent);
	padding: 25px;
	box-shadow: 0 6px 25px rgba(2, 132, 199, .15);
	margin-top: 20px;
}

.jos-badge {
	position: absolute;
	top: -12px;
	right: 20px;
	background: linear-gradient(135deg, #f97316, #ea580c);
	color: #fff;
	padding: 6px 16px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .5px;
	box-shadow: 0 4px 12px rgba(249, 115, 22, .3);
}

.jos-prestation-entete {
	display: flex;
	align-items: center;
}

.jos-prestation-entete input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin: 0 12px 0 0;
	flex-shrink: 0;
	accent-color: var(--jos-primaire);
	cursor: pointer;
}

.jos-prestation.is-mise-en-avant .jos-prestation-entete input[type="checkbox"] {
	width: 24px;
	height: 24px;
	accent-color: var(--jos-accent);
}

.jos-prestation-entete label {
	font-weight: 600;
	color: #333;
	font-size: 16px;
	cursor: pointer;
	line-height: 1.3;
}

.jos-prestation.is-mise-en-avant .jos-prestation-entete label {
	font-size: 18px;
	color: #0369a1;
	font-weight: 700;
}

.jos-prestation-details {
	display: none;
	margin: 15px 0 0 32px;
}

.jos-prestation.is-ouverte .jos-prestation-details {
	display: block;
}

.jos-champ {
	margin-bottom: 10px;
}

.jos-champ label {
	display: block;
	margin-bottom: 5px;
	color: #555;
	font-size: 14px;
}

.jos-champ input {
	width: 100%;
	padding: 10px;
	border: 2px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
	transition: border-color .3s;
	background: #fff;
	color: #333;
}

.jos-champ input:focus {
	outline: none;
	border-color: var(--jos-primaire);
}

.jos-prestation.is-mise-en-avant .jos-champ input:focus {
	border-color: var(--jos-accent);
}

.jos-conditions {
	background: rgba(255, 255, 255, .7);
	padding: 15px;
	border-radius: 6px;
	margin-top: 15px;
	font-size: 13px;
	line-height: 1.6;
	color: #0369a1;
}

.jos-conditions ul {
	margin: 8px 0 0;
	padding-left: 20px;
}

.jos-conditions li {
	margin-bottom: 6px;
}

.jos-confirmation-ligne {
	text-align: right;
	font-weight: 500;
	color: var(--jos-primaire);
	margin-top: 10px;
	font-size: 14px;
	min-height: 1px;
}

.jos-prestation.is-mise-en-avant .jos-confirmation-ligne {
	color: var(--jos-accent);
}

.jos-alerte-max {
	background: #fff3cd;
	border: 1px solid #ffc107;
	color: #856404;
	padding: 12px;
	border-radius: 6px;
	margin-top: 10px;
	font-size: 14px;
	line-height: 1.5;
}

.jos-alerte-max strong {
	display: block;
	margin-bottom: 5px;
}

/* ---------- Forfaits ---------- */

.jos-forfait {
	background: #f0f7ff;
	padding: 20px;
	border-radius: 8px;
	margin-bottom: 15px;
	border-left: 4px solid #06c;
	display: flex;
	align-items: center;
}

.jos-forfait input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin: 0 12px 0 0;
	flex-shrink: 0;
	accent-color: #06c;
	cursor: pointer;
}

.jos-forfait label {
	font-weight: 600;
	color: #333;
	font-size: 16px;
	cursor: pointer;
}

/* ---------- Piège à robots ---------- */

.jos-piege {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

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

.jos-btn {
	padding: 15px;
	background: var(--jos-primaire);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background .3s, transform .2s, opacity .2s;
}

.jos-btn:hover:not(:disabled) {
	background: var(--jos-foncee);
	transform: translateY(-2px);
}

.jos-btn:active:not(:disabled) {
	transform: translateY(0);
}

.jos-btn:disabled {
	opacity: .6;
	cursor: not-allowed;
	transform: none;
}

.jos-btn-calculer {
	width: 100%;
	margin-top: 20px;
	font-size: 17px;
	padding: 17px;
}

.jos-btn.is-chargement {
	position: relative;
	color: transparent;
}

.jos-btn.is-chargement::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid rgba(255, 255, 255, .4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: jos-tourne .7s linear infinite;
}

@keyframes jos-tourne {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- Erreurs ---------- */

.jos-erreur-globale {
	display: none;
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
	padding: 14px;
	border-radius: 8px;
	margin-top: 15px;
	font-size: 14px;
	line-height: 1.5;
}

.jos-erreur-globale.is-visible {
	display: block;
}

/* ---------- Créneau ---------- */

.jos-creneau {
	text-align: center;
	font-size: 14px;
	color: #06c;
	margin-top: 20px;
	font-weight: 500;
	line-height: 1.6;
}

.jos-creneau strong {
	display: block;
	font-size: 16px;
	margin-top: 5px;
}

/* ---------- Confirmation ---------- */

.jos-confirmation-bloc {
	background: linear-gradient(135deg, var(--jos-primaire), var(--jos-foncee));
	color: #fff;
	padding: 35px 25px;
	border-radius: 10px;
	text-align: center;
}

.jos-confirmation-titre {
	margin: 0 0 12px;
	font-size: 22px;
	color: #fff;
}

.jos-confirmation-texte {
	margin: 0 0 18px;
	font-size: 16px;
	line-height: 1.6;
	white-space: pre-line;
}

.jos-confirmation-contact {
	margin: 0;
	font-size: 14px;
	opacity: .95;
}

.jos-confirmation-contact a {
	color: #fff;
	text-decoration: underline;
}

/* ---------- Résultat (optionnel) ---------- */

.jos-resultat {
	background: linear-gradient(135deg, var(--jos-primaire), var(--jos-foncee));
	color: #fff;
	padding: 25px;
	border-radius: 8px;
	text-align: center;
	margin-top: 20px;
}

.jos-resultat h3 {
	margin: 0 0 10px;
	font-size: 18px;
	font-weight: 500;
	color: #fff;
}

.jos-prix-total {
	font-size: 28px;
	font-weight: 700;
	margin: 10px 0;
}

.jos-prix-barre {
	text-decoration: line-through;
	color: rgba(255, 255, 255, .7);
	font-size: .8em;
}

.jos-prix-reduit {
	color: #90ee90;
	font-weight: 700;
}

.jos-prix-total .jos-prix-reduit {
	font-size: 36px;
}

.jos-credit-impot {
	background: rgba(255, 255, 255, .15);
	padding: 8px 15px;
	border-radius: 5px;
	font-size: 13px;
	margin-top: 10px;
	display: inline-block;
}

.jos-detail-liste {
	font-size: 14px;
	margin-top: 15px;
	text-align: left;
	background: rgba(255, 255, 255, .1);
	padding: 15px;
	border-radius: 5px;
}

.jos-detail-ligne {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.jos-detail-ligne:last-child {
	border-bottom: none;
}

.jos-detail-prix {
	text-align: right;
	white-space: nowrap;
}

.jos-note {
	font-size: 12px;
	opacity: .9;
	margin-top: 15px;
	line-height: 1.4;
}

/* ---------- Message injecté dans la popup Brevo ---------- */

.jos-accroche-popup {
	background: #f8faf5;
	border-left: 4px solid var(--jos-primaire);
	padding: 14px 16px;
	border-radius: 6px;
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.55;
	color: #2d5016;
}

.jos-erreur-tel {
	display: none;
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 6px;
	padding: 10px 12px;
	margin-top: 10px;
	font-size: 13.5px;
	line-height: 1.5;
}

.jos-erreur-tel.is-visible {
	display: block;
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {

	.jos-simulateur {
		padding: 20px 16px;
	}

	.jos-titre {
		font-size: 20px;
	}

	.jos-prestation,
	.jos-prestation.is-mise-en-avant {
		padding: 18px 15px;
	}

	.jos-prestation-details {
		margin-left: 0;
	}

	.jos-badge {
		right: 12px;
		font-size: 11px;
		padding: 5px 12px;
	}

	.jos-detail-ligne {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}

	.jos-detail-prix {
		text-align: left;
	}
}
