/**
 * Styles frontend : tunnel de réservation, espace client, fiches publiques.
 * Identité visuelle : bleu nuit (#1f3a5f) et beige bronze (#a98a55).
 */

:root {
	--es-navy:   #1f3a5f;
	--es-navy-dark: #16294a;
	--es-bronze: #a98a55;
	--es-bronze-dark: #8c6d3e;
	--es-bg:     #f7f6f1;
	--es-text:   #222b3a;
	--es-muted:  #6b7280;
	--es-border: #e2dfd5;
	--es-success: #2d7a45;
	--es-danger:  #b3251c;
	--es-radius:  8px;
}

.es-formulas-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 1.5rem;
	margin: 2rem 0;
}
.es-formula {
	background: #fff;
	border: 1px solid var(--es-border);
	border-radius: var(--es-radius);
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
}
.es-formula h3 {
	color: var(--es-navy);
	margin: 0 0 .25rem;
}
.es-formula-tagline { color: var(--es-muted); font-size: .9rem; margin: 0 0 1rem; }
.es-formula-price { font-size: 1.6rem; color: var(--es-bronze); margin-bottom: 1rem; }
.es-formula-price .es-period { font-size: 0.9rem; color: var(--es-muted); margin-left: .25rem; }
.es-formula-includes { list-style: none; padding: 0; margin: 0 0 1rem; }
.es-formula-includes li {
	padding-left: 1.4rem; position: relative; margin: .25rem 0;
}
.es-formula-includes li::before {
	content: "✓"; color: var(--es-success); position: absolute; left: 0; font-weight: bold;
}
.es-formula-desc { color: var(--es-muted); font-size: .9rem; flex-grow: 1; }

.es-btn {
	display: inline-block; padding: .7rem 1.4rem; border-radius: var(--es-radius);
	font-weight: 600; text-decoration: none; border: 0; cursor: pointer;
	transition: background .15s, transform .05s;
}
.es-btn-primary { background: var(--es-navy); color: #fff; }
.es-btn-primary:hover { background: var(--es-navy-dark); color: #fff; }
.es-btn-secondary { background: #eee; color: var(--es-text); }
.es-btn-secondary:hover { background: #ddd; }
.es-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Tunnel */
.es-booking { max-width: 760px; margin: 2rem auto; background: #fff; border: 1px solid var(--es-border); border-radius: var(--es-radius); padding: 2rem; position: relative; }
.es-stepper { display: flex; gap: 0; padding: 0; margin: 0 0 2rem; list-style: none; border-bottom: 1px solid var(--es-border); }
.es-step { flex: 1; padding: .75rem; text-align: center; color: var(--es-muted); border-bottom: 3px solid transparent; font-size: .9rem; }
.es-step.is-active { color: var(--es-navy); border-bottom-color: var(--es-bronze); font-weight: 600; }
.es-step-pane { display: none; }
.es-step-pane.is-visible { display: block; }

.es-field { margin-bottom: 1.2rem; }
.es-field label { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--es-navy); }
.es-field input[type="text"], .es-field input[type="email"], .es-field input[type="tel"],
.es-field input[type="date"], .es-field input[type="password"], .es-field textarea {
	width: 100%; padding: .6rem .8rem; border: 1px solid var(--es-border); border-radius: var(--es-radius); font: inherit;
}
.es-field input:focus, .es-field textarea:focus { border-color: var(--es-navy); outline: none; }
.es-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.es-field-check label { display: flex; gap: .5rem; align-items: flex-start; font-weight: normal; }

.es-formulas-radios { display: grid; gap: .75rem; margin-bottom: 1.5rem; }
.es-formula-option {
	display: block; padding: 1rem; border: 2px solid var(--es-border); border-radius: var(--es-radius); cursor: pointer;
	transition: border-color .15s, background .15s;
}
.es-formula-option:hover { border-color: var(--es-bronze); }
.es-formula-option.is-selected, .es-formula-option:has(input:checked) { border-color: var(--es-bronze); background: rgba(169, 138, 85, .05); }
.es-formula-option input { margin-right: .5rem; }
.es-formula-option-body { display: grid; grid-template-columns: 1fr auto; gap: .25rem .5rem; }
.es-formula-option-body small { grid-column: 1 / -1; color: var(--es-muted); }
.es-formula-option-body .es-price { color: var(--es-bronze); font-weight: 700; }

.es-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; }
.es-loader { position: absolute; inset: 0; background: rgba(255,255,255,.85); display: flex; align-items: center; justify-content: center; gap: 1rem; border-radius: var(--es-radius); }
.es-loader[hidden] { display: none; } /* évite que display:flex écrase l'attribut hidden */
.es-loader span { width: 28px; height: 28px; border: 3px solid var(--es-border); border-top-color: var(--es-navy); border-radius: 50%; animation: es-spin 1s linear infinite; }
@keyframes es-spin { to { transform: rotate(360deg); } }

.es-recap { background: var(--es-bg); padding: 1rem; border-radius: var(--es-radius); margin-bottom: 1rem; }
.es-recap p { margin: .25rem 0; }
.es-payment-info { font-size: .85rem; color: var(--es-muted); margin-top: 1rem; }
.es-error { background: #fef2f2; border-left: 3px solid var(--es-danger); padding: .75rem 1rem; color: var(--es-danger); margin-top: 1rem; }

/* Connexion espace client — formulaire intégré (charte) */
.es-login-card { max-width: 440px; margin: 1rem auto 2.5rem; background: #fff; border: 1px solid var(--es-border); border-top: 4px solid var(--es-bronze); border-radius: 12px; box-shadow: 0 8px 28px rgba(31,58,95,.08); padding: 1.75rem 1.75rem 1.5rem; }
.es-login-title { color: var(--es-navy); margin: 0 0 1.25rem; }
.es-login-remember { display: flex; gap: .5rem; align-items: center; margin: 0 0 1.2rem; font-size: .95rem; color: var(--es-text); }
.es-btn-block { display: block; width: 100%; text-align: center; }
.es-login-links { margin-top: 1rem; text-align: center; }
.es-login-links a { color: var(--es-bronze-dark); }
.es-login-links a:hover { color: var(--es-navy); }

/* Espace client */
.es-customer-portal { margin: 2rem 0; }
.es-table { width: 100%; border-collapse: collapse; }
.es-table th, .es-table td { padding: .65rem .75rem; border-bottom: 1px solid var(--es-border); text-align: left; }
.es-table th { background: var(--es-bg); color: var(--es-navy); }

.es-status { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; background: #eef0f4; color: var(--es-navy); }
.es-status--paid,
.es-status--validated,
.es-status--accepted { background: rgba(45, 122, 69, .15); color: var(--es-success); }
.es-status--disputed,
.es-status--cancelled { background: rgba(179, 37, 28, .15); color: var(--es-danger); }
.es-status--unassigned,
.es-status--proposed { background: rgba(169, 138, 85, .15); color: var(--es-bronze-dark); }

.es-mission-detail { margin: 2rem 0; }
.es-mission-detail .es-meta { display: grid; grid-template-columns: 180px 1fr; gap: .35rem 1rem; }
.es-mission-detail .es-meta dt { font-weight: 600; color: var(--es-navy); }
.es-mission-detail .es-meta dd { margin: 0; }
.es-section { margin-top: 2rem; }
.es-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem; margin-top: .5rem; }
.es-photos img { width: 100%; height: 160px; object-fit: cover; border-radius: var(--es-radius); }

.es-thank-you { background: var(--es-bg); padding: 2rem; border-radius: var(--es-radius); border-left: 4px solid var(--es-bronze); margin: 2rem 0; }

.es-cimetiere { max-width: 800px; margin: 2rem auto; }
.es-cimetieres { list-style: none; padding: 0; }
.es-cimetieres li { padding: .5rem 0; border-bottom: 1px solid var(--es-border); }

@media (max-width: 600px) {
	.es-grid-2 { grid-template-columns: 1fr; }
	.es-booking { padding: 1.25rem; }
	.es-mission-detail .es-meta { grid-template-columns: 1fr; }
	.es-mission-detail .es-meta dt { margin-top: .5rem; }
}

/* Jalon 4 — litiges et factures */
.es-btn-warning { background: #c98a2e; color: #fff; }
.es-btn-warning:hover { background: #a96f1e; }

.es-dispute-form, .es-dispute-box {
	background: #fdf6e6; border-left: 4px solid #c98a2e;
	padding: 1.25rem; border-radius: 8px;
}
.es-dispute-form textarea {
	width: 100%; min-height: 130px; padding: .6rem;
	border: 1px solid #e2dfd5; border-radius: 8px; font: inherit; margin-bottom: .75rem;
}
.es-dispute-box blockquote {
	border-left: 3px solid #e2dfd5; padding-left: 1rem; margin: .5rem 0;
}

/* Validation + notation client de la prestation. */
.es-validate-form {
	background: #f1f7f2; border-left: 4px solid var(--es-navy);
	padding: 1.25rem; border-radius: 8px; margin-bottom: 1rem;
}
.es-validate-form textarea {
	width: 100%; min-height: 90px; padding: .6rem;
	border: 1px solid #d9e2db; border-radius: 8px; font: inherit; margin-bottom: .75rem;
}
/* Étoiles cliquables : technique radio inversé (direction RTL) pour le survol. */
.es-rating-input {
	display: inline-flex; flex-direction: row-reverse;
	justify-content: flex-end; gap: .15rem; margin-bottom: .75rem;
}
.es-rating-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.es-rating-input label {
	font-size: 2rem; line-height: 1; color: #d2d2c8; cursor: pointer;
	transition: color .15s ease;
}
.es-rating-input label:hover,
.es-rating-input label:hover ~ label,
.es-rating-input input:checked ~ label { color: #e6b800; }
.es-rating-input input:focus-visible + label { outline: 2px solid var(--es-navy); outline-offset: 2px; }

.es-invoice-list { list-style: none; padding: 0; }
.es-invoice-list li { padding: .35rem 0; }

/* =========================================================
   Annuaire public des intervenants (par ville) + fiche
   ========================================================= */
.es-directory { margin: 2rem 0; }
.es-directory-empty { color: var(--es-muted); font-style: italic; padding: 1.5rem 0; }
.es-directory-city { margin-bottom: 2.5rem; }
.es-directory-city-title {
	color: var(--es-navy); margin: 0 0 1rem; padding-bottom: .5rem;
	border-bottom: 2px solid var(--es-bronze); font-size: 1.4rem;
}
.es-directory-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem;
}
.es-intervenant-card {
	display: flex; gap: 1rem; align-items: center; padding: 1rem;
	background: #fff; border: 1px solid var(--es-border); border-radius: 12px;
	text-decoration: none; color: var(--es-text);
	transition: border-color .15s, box-shadow .15s, transform .05s;
}
.es-intervenant-card:hover {
	border-color: var(--es-bronze); box-shadow: 0 6px 20px rgba(31,58,95,.08); transform: translateY(-1px);
}
.es-intervenant-avatar {
	flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%;
	overflow: hidden; display: flex; align-items: center; justify-content: center;
	background: var(--es-bg); border: 1px solid var(--es-border);
}
.es-intervenant-avatar img { width: 100%; height: 100%; object-fit: cover; }
.es-intervenant-initials {
	font-weight: 700; color: var(--es-bronze-dark); font-size: 1.25rem; letter-spacing: .5px;
}
.es-intervenant-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.es-intervenant-name { color: var(--es-navy); font-size: 1.05rem; }
.es-intervenant-city { color: var(--es-muted); font-size: .85rem; }

.es-rating { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; }
.es-stars { color: var(--es-bronze); letter-spacing: 1px; }
.es-rating-num { font-weight: 700; color: var(--es-navy); }
.es-rating-count { color: var(--es-muted); }
.es-badge-new {
	display: inline-block; background: rgba(169,138,85,.15); color: var(--es-bronze-dark);
	padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
}

/* Fiche intervenant */
.es-intervenant-profile { max-width: 760px; margin: 2rem auto; }
.es-directory-back { margin: 0 0 1rem; }
.es-directory-back a { color: var(--es-bronze-dark); text-decoration: none; }
.es-directory-back a:hover { color: var(--es-navy); }
.es-intervenant-hero {
	display: flex; gap: 1.5rem; align-items: center; padding: 1.5rem;
	background: #fff; border: 1px solid var(--es-border); border-top: 4px solid var(--es-bronze);
	border-radius: 14px; box-shadow: 0 8px 28px rgba(31,58,95,.06);
}
.es-intervenant-avatar--lg { width: 110px; height: 110px; }
.es-intervenant-avatar--lg .es-intervenant-initials { font-size: 2.2rem; }
.es-intervenant-hero-body { min-width: 0; }
.es-intervenant-hero .es-intervenant-name { font-size: 1.6rem; margin: 0 0 .25rem; }
.es-rating--lg { font-size: 1.05rem; gap: .5rem; }
.es-rating--lg .es-stars { font-size: 1.2rem; }

.es-intervenant-bio {
	margin: 1.5rem 0; padding: 1.25rem 1.5rem; background: var(--es-bg);
	border-radius: 12px; color: var(--es-text); line-height: 1.6;
}
.es-intervenant-bio p { margin: 0 0 .6rem; }
.es-intervenant-bio p:last-child { margin-bottom: 0; }

.es-intervenant-reviews { margin-top: 2rem; }
.es-intervenant-reviews-title { color: var(--es-navy); margin: 0 0 1rem; }
.es-review {
	padding: 1.1rem 1.25rem; margin-bottom: 1rem; background: #fff;
	border: 1px solid var(--es-border); border-radius: 12px;
}
.es-review-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.es-review-score { color: var(--es-navy); }
.es-review-meta { color: var(--es-muted); font-size: .85rem; }
.es-review-comment {
	margin: .25rem 0 0; padding-left: 1rem; border-left: 3px solid var(--es-border); color: var(--es-text);
}
.es-review-reply {
	margin-top: .85rem; padding: .75rem 1rem; background: var(--es-bg);
	border-radius: 8px; border-left: 3px solid var(--es-bronze);
}
.es-review-reply strong { color: var(--es-bronze-dark); font-size: .85rem; }
.es-review-reply p { margin: .35rem 0 0; }

@media (max-width: 600px) {
	.es-intervenant-hero { flex-direction: column; text-align: center; }
	.es-intervenant-hero .es-rating { justify-content: center; }
}
