/* BP Calculateur Configurator - front-end styles.
 *
 * "Configurez votre application." section for the standalone
 * Calculateur page.
 *
 *   - Centered eyebrow + serif title + subtitle
 *   - 2-column card (light cream form + dark-green premium
 *     result panel) inside a single rounded container
 *   - Background botanical decorations sit OUTSIDE the card
 *     and bleed to the screen edges via the 100vw +
 *     calc(50% - 50vw) breakout; only the card itself stays
 *     inside the 1140px content width.
 *
 * Approved palette only (#374F37 / #EDDBC3 / #B8B25A / #FFFFFF
 * + existing neutral tokens). Logical CSS properties keep
 * the same ruleset valid for /ar/ without a mirror file.
 */

/* ============================================================
 * Root + full-bleed breakout
 * ============================================================ */
.bp-cfg {
	--bp-cfg-cream:        #FBF6EC;
	--bp-cfg-cream-deep:   #F3EADB;
	--bp-cfg-card-bg:      #FFFFFF;
	--bp-cfg-form-bg:      #F8F4ED;
	--bp-cfg-border:       #E4DCCB;
	--bp-cfg-border-soft:  #EFE7D5;
	--bp-cfg-ink:          #1F2A1F;
	--bp-cfg-ink-muted:    #5C6A5C;
	--bp-cfg-green:        #374F37;
	--bp-cfg-green-deep:   #283528;
	--bp-cfg-olive:        #B8B25A;
	--bp-cfg-radius:       22px;
	--bp-cfg-pad:          clamp(20px, 2.6vw, 32px);
	--bp-cfg-step-gap:     18px;
	--bp-cfg-eyebrow:      #B8B25A;
	--bp-cfg-shadow:       0 12px 32px rgba(31, 42, 31, 0.08);
	--bp-cfg-inner-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
	--bp-cfg-font:         var(--bp-font-body, 'Manrope', system-ui, sans-serif);
	--bp-cfg-display:      var(--bp-font-display, 'DM Serif Display', Georgia, serif);

	position: relative;
	isolation: isolate;
	overflow: visible;
	overflow-x: clip;
	inline-size: 100vw;
	margin-inline-start: calc(50% - 50vw);
	max-inline-size: 100vw;
	box-sizing: border-box;
	/* Section padding removed: open + integrated with page */
	padding-block: 0;
	padding-inline: 0;
	/* Section background removed: transparent to let page bg show through */
	background: transparent;
	font-family: var(--bp-cfg-font);
	color: var(--bp-cfg-ink);
	/* Spacing below the hero section above. */
	margin-block-start: 0;
}

/* The immediate Elementor widget wrapper + container that own a
 * background must also stay transparent so the page background
 * shows through under the calculator section. The `.bp-cfg__card`
 * and the right result panel re-paint their own surfaces, so they
 * are intentionally not touched here. Scoped to the widget root
 * via the data-widget_type attribute Elementor adds, so the rule
 * never leaks to other sections. */
[data-widget_type="bp-calculateur-configurator.default"] > .elementor-widget-container,
.elementor-element:has(> .elementor-widget-container .bp-cfg) {
	background: transparent;
	background-color: transparent;
}

/* Soft background pattern overlay (subtle agronomic feel) — disabled to keep
 * the section on the page's uniform cream/transparent background. */
.bp-cfg::before {
	display: none;
}

/* ============================================================
 * Background decorations (bleed to screen edges)
 * ============================================================ */
.bp-cfg__decor {
	position: absolute;
	z-index: 0;
	pointer-events: none;
	user-select: none;
	display: flex;
	align-items: center;
	inset-block: 0;
	max-inline-size: 50%;
}

.bp-cfg__decor--start {
	/* Physical anchor: same FR side in /ar/ (no RTL mirror). */
	left: -160px;
	right: auto;
	justify-content: flex-start;
	transform: translate(var(--bp-cfg-decor-l-x, 0px), var(--bp-cfg-decor-l-y, 0px)) rotate(var(--bp-cfg-decor-l-rot, 0deg));
	transform-origin: center center;
	will-change: transform;
}

.bp-cfg__decor--end {
	right: -160px;
	left: auto;
	justify-content: flex-end;
	transform: translate(var(--bp-cfg-decor-r-x, 0px), var(--bp-cfg-decor-r-y, 0px)) rotate(var(--bp-cfg-decor-r-rot, 0deg));
	transform-origin: center center;
	will-change: transform;
}

.bp-cfg__decor img {
	display: block;
	inline-size: 100%;
	block-size: auto;
	max-inline-size: 100%;
	max-block-size: 100%;
	object-fit: contain;
}

/* ============================================================
 * Intro (eyebrow + title + subtitle)
 * ============================================================ */
.bp-cfg__intro {
	position: relative;
	z-index: 1;
	max-inline-size: 720px;
	margin: 0 auto clamp(16px, 2vw, 24px);
	padding-inline: clamp(16px, 4vw, 24px);
	text-align: center;
}

.bp-cfg__eyebrow {
	margin: 0 0 12px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--bp-cfg-eyebrow);
}

.bp-cfg__title {
	margin: 0 0 28px;
	font-family: var(--bp-cfg-display);
	font-weight: 400;
	font-size: clamp(28px, 4vw, 44px);
	line-height: 1.15;
	letter-spacing: -0.005em;
	color: #374F3C;
}

/* Calculator — title→divider→subtitle rhythm.
 * The widget now ships its own real `.bp-cfg__divider`
 * (line / diamond / line) under the title (renamed from
 * the unrelated `.bp-field-results__divider` in 0.1.378).
 * The shared Barbary divider pattern matches the
 * reference title rhythm: 10px above, 22px below,
 * centered under the title. */
.bp-cfg__intro > .bp-cfg__divider {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-block: 10px 22px !important;
	margin-inline: auto !important;
	max-inline-size: 100%;
}
.bp-cfg__divider-line {
	display: block;
	inline-size: 40px;
	block-size: 1px;
	background-color: #B8B25A;
}
.bp-cfg__divider-diamond {
	display: block;
	inline-size: 6px;
	block-size: 6px;
	background-color: #B8B25A;
	transform: rotate(45deg);
	flex: 0 0 auto;
}

.bp-cfg__subtitle {
	margin: 0;
	font-size: clamp(14px, 1.4vw, 16px);
	line-height: 1.6;
	color: var(--bp-cfg-ink-muted);
}

/* ============================================================
 * Inner container + 2-column card
 * ============================================================ */
.bp-cfg__inner {
	position: relative;
	z-index: 1;
}

.bp-cfg__card {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: 0;
	max-inline-size: 1140px;
	margin: 0 auto;
	background-color: #FBF6EC;
	border: 1px solid #B8B25A;
	border-radius: 22px;
	box-shadow: none;
	overflow: hidden;
}

/* ============================================================
 * LEFT — Configuration form
 * ============================================================ */
.bp-cfg__form {
	position: relative;
	background:
		linear-gradient(180deg, #FBF6EC 0%, #F8F4ED 100%);
	padding: var(--bp-cfg-pad);
	display: flex;
	flex-direction: column;
	gap: var(--bp-cfg-step-gap);
}

.bp-cfg__step {
	display: grid;
	grid-template-columns: 40px 1fr;
	gap: 14px;
	align-items: start;
	padding-block: 4px;
}

.bp-cfg__step-icon {
	inline-size: 40px;
	block-size: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background-color: #FFFFFF;
	border: 1px solid var(--bp-cfg-border);
	color: var(--bp-cfg-green);
	flex-shrink: 0;
	box-shadow: 0 1px 2px rgba(31, 42, 31, 0.04);
}

.bp-cfg__step-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-inline-size: 0;
}

.bp-cfg__step-title {
	margin: 0;
	font-family: var(--bp-cfg-display);
	font-weight: 400;
	font-size: clamp(15px, 1.4vw, 18px);
	color: var(--bp-cfg-ink);
	letter-spacing: 0.01em;
}

/* --- Segmented selector (Step 1 — Culture) --- */
.bp-cfg__segmented {
	position: relative;
	display: flex;
	flex-wrap: nowrap;
	gap: 6px;
	align-items: stretch;
	background-color: #FFFFFF;
	border: 1px solid var(--bp-cfg-border);
	border-radius: 12px;
	padding: 5px;
}

.bp-cfg__segmented-btn {
	flex: 1 1 0;
	min-inline-size: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 10px;
	border: 0;
	border-radius: 8px;
	background-color: transparent;
	color: var(--bp-cfg-ink-muted);
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bp-cfg__segmented-btn:hover {
	background-color: rgba(55, 79, 55, 0.04);
	color: var(--bp-cfg-green);
}

.bp-cfg__segmented-btn.is-selected {
	background-color: var(--bp-cfg-green);
	color: #FFFFFF;
	box-shadow: 0 2px 6px rgba(55, 79, 55, 0.25);
}

.bp-cfg__segmented-btn.is-selected .bp-cfg__segmented-ico {
	color: #FFFFFF;
}

.bp-cfg__segmented-ico {
	display: inline-flex;
	color: var(--bp-cfg-green);
	flex-shrink: 0;
}

.bp-cfg__segmented-label {
	display: inline-block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bp-cfg__segmented-chev {
	flex: 0 0 auto;
	inline-size: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: transparent;
	border: 0;
	color: var(--bp-cfg-ink-muted);
	cursor: default;
	padding: 0;
}

/* --- Pill buttons (Step 2 + Step 3) --- */
.bp-cfg__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.bp-cfg__pill {
	flex: 1 1 auto;
	min-inline-size: 80px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1px solid var(--bp-cfg-border);
	border-radius: 999px;
	background-color: #FFFFFF;
	color: var(--bp-cfg-ink);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.bp-cfg__pill:hover {
	border-color: var(--bp-cfg-green);
	color: var(--bp-cfg-green);
}

.bp-cfg__pill.is-selected {
	background-color: var(--bp-cfg-green);
	border-color: var(--bp-cfg-green);
	color: #FFFFFF;
	box-shadow: 0 2px 6px rgba(55, 79, 55, 0.25);
}

.bp-cfg__pill--wide {
	flex: 1 1 calc(50% - 4px);
	padding-block: 12px;
}

.bp-cfg__pill-text {
	display: inline-block;
}

.bp-cfg__pill-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 20px;
	block-size: 20px;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.18);
	color: #FFFFFF;
}

/* --- Surface input (Step 4) --- */
.bp-cfg__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bp-cfg__field-label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--bp-cfg-ink-muted);
}

.bp-cfg__input-shell {
	position: relative;
	display: flex;
	align-items: center;
	background-color: #FFFFFF;
	border: 1px solid var(--bp-cfg-border);
	border-radius: 10px;
	padding-inline: 14px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bp-cfg__input-shell:focus-within {
	border-color: var(--bp-cfg-green);
	box-shadow: 0 0 0 3px rgba(55, 79, 55, 0.12);
}

.bp-cfg__input {
	flex: 1 1 auto;
	min-inline-size: 0;
	inline-size: 100%;
	border: 0;
	background: transparent;
	padding-block: 12px;
	padding-inline: 0;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	color: var(--bp-cfg-ink);
	outline: none;
}

.bp-cfg__input-affix {
	font-size: 13px;
	font-weight: 600;
	color: var(--bp-cfg-ink-muted);
	margin-inline-start: 6px;
}

.bp-cfg__input-ico {
	display: inline-flex;
	margin-inline-start: 10px;
	color: var(--bp-cfg-ink-muted);
}

/* --- CTA button --- */
.bp-cfg__cta {
	margin-block-start: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 16px 22px;
	background-color: var(--bp-cfg-green);
	color: #FFFFFF;
	border: 0;
	border-radius: 14px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.01em;
	cursor: pointer;
	box-shadow: 0 8px 20px rgba(55, 79, 55, 0.25);
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.bp-cfg__cta:hover {
	background-color: var(--bp-cfg-green-deep);
	transform: translateY(-1px);
	box-shadow: 0 10px 24px rgba(55, 79, 55, 0.3);
}

.bp-cfg__cta:active {
	transform: translateY(0);
}

.bp-cfg__cta-ico {
	display: inline-flex;
	color: #FFFFFF;
	flex-shrink: 0;
}

.bp-cfg__cta-label {
	flex: 1 1 auto;
	text-align: start;
}

.bp-cfg__cta-arrow {
	display: inline-flex;
	color: #FFFFFF;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.bp-cfg__cta:hover .bp-cfg__cta-arrow {
	transform: translateX(3px);
}

html[dir="rtl"] .bp-cfg__cta:hover .bp-cfg__cta-arrow {
	transform: translateX(-3px);
}

/* ============================================================
 * RIGHT — Premium dark-green estimation panel
 * ============================================================ */
.bp-cfg__result {
	position: relative;
	background:
		radial-gradient(ellipse at 100% 0%, rgba(184, 178, 90, 0.12) 0%, rgba(184, 178, 90, 0) 55%),
		radial-gradient(ellipse at 0% 100%, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 50%),
		linear-gradient(155deg, #3B5638 0%, #2C3F2C 60%, #233123 100%);
	color: #FFFFFF;
	padding: var(--bp-cfg-pad);
	display: flex;
	flex-direction: column;
	gap: 18px;
	overflow: hidden;
	isolation: isolate;
}

/* Faint topographic line overlay inside the dark panel */
.bp-cfg__result-pattern {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	opacity: 0.18;
	background-image:
		repeating-radial-gradient(
			ellipse at 85% 15%,
			transparent 0,
			transparent 14px,
			rgba(255, 255, 255, 0.08) 14px,
			rgba(255, 255, 255, 0.08) 15px
		),
		repeating-radial-gradient(
			ellipse at 15% 90%,
			transparent 0,
			transparent 18px,
			rgba(184, 178, 90, 0.18) 18px,
			rgba(184, 178, 90, 0.18) 19px
		);
	mix-blend-mode: screen;
}

.bp-cfg__result > * {
	position: relative;
	z-index: 1;
}

.bp-cfg__result-head {
	display: flex;
	align-items: center;
	gap: 10px;
}

.bp-cfg__result-ico {
	display: inline-flex;
	inline-size: 28px;
	block-size: 28px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background-color: rgba(184, 178, 90, 0.18);
	color: var(--bp-cfg-olive);
	flex-shrink: 0;
}

.bp-cfg__result-eyebrow {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--bp-cfg-olive);
}

.bp-cfg__result-value {
	margin: 4px 0 0;
	font-family: var(--bp-cfg-display);
	font-weight: 400;
	font-size: clamp(40px, 5vw, 60px);
	line-height: 1;
	letter-spacing: -0.01em;
	color: #FFFFFF;
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.bp-cfg__result-number {
	display: inline-block;
	overflow: visible;
	line-height: 1.1;
	padding-block: 0.08em;
	background: linear-gradient(180deg, #FFFFFF 0%, #E9DFC2 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.bp-cfg__result-caption {
	margin: -4px 0 4px;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.78);
}

.bp-cfg__result-caption strong {
	color: var(--bp-cfg-olive);
	font-weight: 700;
}

.bp-cfg__summary {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bp-cfg__summary li {
	display: grid;
	grid-template-columns: 28px 1fr auto;
	gap: 10px;
	align-items: center;
	padding-block: 10px;
	border-block-end: 1px dashed rgba(255, 255, 255, 0.14);
}

.bp-cfg__summary li:last-child {
	border-block-end: 0;
}

.bp-cfg__summary-ico {
	display: inline-flex;
	inline-size: 28px;
	block-size: 28px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background-color: rgba(184, 178, 90, 0.16);
	color: var(--bp-cfg-olive);
}

.bp-cfg__summary-label {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.7);
}

.bp-cfg__summary-value {
	font-size: 14px;
	font-weight: 700;
	color: #FFFFFF;
}

/* --- Preparation box --- */
.bp-cfg__prep {
	margin-block-start: 4px;
	padding: 16px;
	background:
		linear-gradient(180deg, rgba(184, 178, 90, 0.14) 0%, rgba(184, 178, 90, 0.06) 100%);
	border: 1px solid rgba(184, 178, 90, 0.28);
	border-radius: 14px;
}

.bp-cfg__prep-title {
	margin: 0 0 12px;
	text-align: center;
	font-family: var(--bp-cfg-display);
	font-weight: 400;
	font-size: 15px;
	color: #FFFFFF;
}

.bp-cfg__prep-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.bp-cfg__prep-cell {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	min-inline-size: 70px;
	padding: 8px 6px;
	border-radius: 10px;
	background-color: rgba(255, 255, 255, 0.04);
}

.bp-cfg__prep-cell--result {
	background-color: rgba(184, 178, 90, 0.16);
}

.bp-cfg__prep-ico {
	display: inline-flex;
	color: var(--bp-cfg-olive);
}

.bp-cfg__prep-amount {
	font-size: 13px;
	font-weight: 700;
	color: #FFFFFF;
	white-space: nowrap;
}

.bp-cfg__prep-tag {
	font-size: 11px;
	font-weight: 600;
	color: var(--bp-cfg-olive);
	letter-spacing: 0.04em;
}

.bp-cfg__prep-op {
	display: inline-flex;
	color: rgba(255, 255, 255, 0.5);
	font-size: 16px;
	font-weight: 600;
}

/* ============================================================
 * RTL — automatic via logical properties + one icon mirror
 * ============================================================ */
html[dir="rtl"] .bp-cfg__result-eyebrow,
html[lang="ar"] .bp-cfg__result-eyebrow {
	letter-spacing: 0;
}

html[dir="rtl"] .bp-cfg__cta-label,
html[lang="ar"] .bp-cfg__cta-label {
	text-align: end;
}

/* ============================================================
 * Responsive — tablet
 * ============================================================ */
@media (max-width: 960px) {
	.bp-cfg__card {
		grid-template-columns: 1fr;
	}

	.bp-cfg__result {
		border-block-start: 1px solid rgba(255, 255, 255, 0.08);
	}

	.bp-cfg__decor {
		max-inline-size: 40%;
	}

	.bp-cfg__decor--start {
		/* Physical anchor: same FR side in /ar/ (no RTL mirror). */
		left: -100px;
		right: auto;
	}

	.bp-cfg__decor--end {
		right: -100px;
		left: auto;
	}
}

/* ============================================================
 * Responsive — mobile
 * ============================================================ */
@media (max-width: 640px) {
	.bp-cfg {
		padding-block: 0;
	}

	.bp-cfg__card {
		border-radius: 18px;
	}

	.bp-cfg__form,
	.bp-cfg__result {
		padding: 20px;
	}

	.bp-cfg__step {
		grid-template-columns: 36px 1fr;
		gap: 12px;
	}

	.bp-cfg__step-icon {
		inline-size: 36px;
		block-size: 36px;
	}

	.bp-cfg__segmented {
		flex-wrap: wrap;
	}

	.bp-cfg__segmented-btn {
		flex: 1 1 calc(50% - 4px);
		padding: 8px 6px;
		font-size: 11.5px;
	}

	.bp-cfg__segmented-chev {
		display: none;
	}

	.bp-cfg__pill {
		flex: 1 1 calc(50% - 4px);
		padding: 10px 8px;
		font-size: 12px;
	}

	.bp-cfg__pill--wide {
		flex: 1 1 100%;
	}

	.bp-cfg__result-value {
		font-size: clamp(36px, 10vw, 48px);
	}

	.bp-cfg__prep-row {
		gap: 6px;
	}

	.bp-cfg__prep-cell {
		min-inline-size: 60px;
		padding: 6px 4px;
	}

	.bp-cfg__cta {
		padding: 14px 18px;
		font-size: 14px;
	}

	.bp-cfg__decor {
		opacity: 0.4;
	}
}

@media (max-width: 420px) {
	.bp-cfg__step {
		grid-template-columns: 1fr;
	}

	.bp-cfg__step-icon {
		display: none;
	}

	.bp-cfg__decor {
		display: none;
	}
}
