/* YS Forms — Devis guidé : habillage par-dessus le formulaire YS Forms. */
.ysg {
	--ysg-navy: #1a2755;
	--ysg-gold: rgb(201, 176, 134);
	--ysg-slate: #64748b;
	--ysg-line: #e2e8f0;
	--ysg-bg: #f8fafc;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 40px;
	align-items: start;
	max-width: 1040px;
	margin: 0 auto;
	color: var(--ysg-navy);
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
	line-height: 1.5;
	text-align: left;
}

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

.ysg [hidden] {
	display: none !important;
}

/* Avant l'initialisation, on évite d'afficher les quatre pages d'un coup. */
.ysg:not(.is-ready) .ysg-main {
	visibility: hidden;
	max-height: 420px;
	overflow: hidden;
}

/* Le formulaire d'origine cède sa navigation au parcours guidé. */
.ysg .ysf-wrap {
	max-width: none;
	margin: 0;
}

.ysg .ysf-steps,
.ysg .ysf-summary,
.ysg .ysf-nav,
.ysg .ysf-message,
.ysg .ysf-field[data-ysg-off] {
	display: none !important;
}

.ysg .ysf-grid {
	gap: 22px 20px;
}

.ysg .ysf-page + .ysf-page .ysf-grid:has(.ysf-field:not([data-ysg-off]):not([hidden])) {
	margin-top: 22px;
}

.ysg .ysf-w-third {
	grid-column: span 6;
}

.ysg .ysf-choice {
	position: relative;
	padding: 14px 18px;
	font-size: 15px;
}

.ysg .ysf-label {
	line-height: 18px;
	margin: 0 0 8px;
}

@media (min-width: 681px) {
	.ysg .ysf-w-half.ysf-float:has(+ .ysf-w-half:not(.ysf-float):not([hidden]):not([data-ysg-off])),
	.ysg .ysf-w-half:not(.ysf-float):not([hidden]):not([data-ysg-off]) + .ysf-w-half.ysf-float {
		padding-top: 26px;
	}

	.ysg .ysf-w-half.ysf-float:has(+ .ysf-w-half:not(.ysf-float):not([hidden]):not([data-ysg-off])) + .ysf-w-half:not(.ysf-float) .ysf-choice,
	.ysg .ysf-w-half:not(.ysf-float):has(+ .ysf-w-half.ysf-float:not([hidden]):not([data-ysg-off])) .ysf-choice,
	.ysg .ysf-w-half.ysf-float:has(+ .ysf-w-half:not(.ysf-float):not([hidden]):not([data-ysg-off])) + .ysf-w-half:not(.ysf-float) .ysf-input,
	.ysg .ysf-w-half:not(.ysf-float):has(+ .ysf-w-half.ysf-float:not([hidden]):not([data-ysg-off])) .ysf-input {
		min-height: 58px;
	}
}

.ysg .ysf-type-radio .ysf-choice input[type="radio"] {
	position: absolute !important;
	opacity: 0 !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	pointer-events: none !important;
}

.ysg .ysf-type-radio .ysf-choice:has(input:checked) {
	border-color: var(--ysg-navy);
	background: rgba(26, 39, 85, 0.045);
	box-shadow: 0 4px 12px rgba(26, 39, 85, 0.1), inset 0 0 0 0.5px var(--ysg-navy);
	font-weight: 600;
}

.ysg .ysf-choice-ico {
	flex: 0 0 auto;
	width: 19px;
	height: 19px;
	color: var(--ysg-slate);
	transition: color 0.2s ease, transform 0.2s ease;
}

.ysg .ysf-choice:hover .ysf-choice-ico,
.ysg .ysf-choice:has(input:checked) .ysf-choice-ico {
	color: var(--ysg-navy);
}

.ysg .ysf-choice input:checked ~ span {
	color: var(--ysg-navy);
	font-weight: 600;
}

/* Progression : quatre escales, sans durée affichée */
.ysg-head {
	margin: 0 0 28px;
}

.ysg-stage {
	margin: 0 0 10px;
	color: var(--ysg-slate);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ysg-legs {
	display: flex;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ysg-leg {
	flex: 1 1 0;
	height: 4px;
	margin: 0;
	border-radius: 2px;
	background: var(--ysg-line);
	overflow: hidden;
}

.ysg-leg span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: 2px;
	background: var(--ysg-navy);
	transition: width 0.45s ease;
}

.ysg-leg.is-current span {
	background: var(--ysg-gold);
}

/* Question */
.ysg .ysg-q {
	margin: 0 0 6px;
	color: var(--ysg-navy);
	font-size: 28px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0;
	text-transform: none;
}

.ysg .ysg-h {
	margin: 0 0 4px;
	color: var(--ysg-slate);
	font-size: 15px;
}

.ysg-form {
	margin-top: 24px;
}

.ysg-msg {
	margin-top: 20px;
	padding: 12px 16px;
	border-left: 3px solid #dc2626;
	background: #fef2f2;
	color: #991b1b;
	font-size: 14px;
}

/* Recherche du modèle */
.ysg-search {
	margin-top: 24px;
}

.ysg-search-box {
	position: relative;
}

.ysg .ysg-search-input {
	display: block;
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 14px 16px;
	border: 0;
	border-bottom: 2px solid var(--ysg-line);
	border-radius: 6px 6px 0 0;
	background: var(--ysg-bg);
	color: var(--ysg-navy);
	font: inherit;
	font-size: 17px;
	box-shadow: none;
	outline: none;
	transition: background-color 0.3s ease, border-color 0.3s ease;
}

.ysg .ysg-search-input:focus {
	border-bottom-color: var(--ysg-gold);
	background: #fff;
}

.ysg-results {
	margin: 8px 0 0;
	padding: 6px;
	list-style: none;
	border: 1px solid var(--ysg-line);
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 16px 36px rgba(26, 39, 85, 0.12);
}

.ysg-results li {
	margin: 0;
}

.ysg .ysg-result {
	display: block;
	width: 100%;
	padding: 11px 12px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--ysg-navy);
	font: inherit;
	font-size: 15px;
	text-align: left;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: none;
}

.ysg .ysg-result:hover,
.ysg .ysg-result:focus-visible {
	background: rgba(201, 176, 134, 0.22);
	color: var(--ysg-navy);
}

.ysg-search-status {
	margin: 10px 0 0;
	color: var(--ysg-slate);
	font-size: 14px;
}

.ysg .ysg-link {
	display: inline;
	margin: 14px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ysg-navy);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-align: left;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: none;
}

.ysg .ysg-link:hover,
.ysg .ysg-link:focus-visible {
	background: none;
	color: var(--ysg-gold);
}

.ysg-picked {
	margin: 18px 0 0;
	color: var(--ysg-slate);
	font-size: 14px;
}

.ysg-picked .ysg-link {
	margin: 0;
}

/* Navigation */
.ysg-nav {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 16px;
	margin-top: 32px;
}

.ysg .ysg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 12px 38px;
	border: 2px solid var(--ysg-navy);
	border-radius: 999px;
	background: var(--ysg-navy);
	color: #fff;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(26, 39, 85, 0.18);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ysg .ysg-btn:hover,
.ysg .ysg-btn:focus-visible {
	background: var(--ysg-navy);
	color: #fff;
	transform: scale(1.03);
	box-shadow: 0 10px 24px rgba(26, 39, 85, 0.26);
}

.ysg .ysg-btn:disabled {
	opacity: 0.6;
	cursor: wait;
	transform: none;
}

.ysg .ysg-btn-ghost {
	margin-right: auto;
	padding: 12px 6px;
	border-color: transparent;
	background: transparent;
	color: var(--ysg-slate);
	box-shadow: none;
}

.ysg .ysg-btn-ghost:hover,
.ysg .ysg-btn-ghost:focus-visible {
	background: transparent;
	color: var(--ysg-navy);
	transform: none;
	box-shadow: none;
}

/* Fiches récapitulatives (navire + propriétaire) */
.ysg-side {
	position: sticky;
	top: 120px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.ysg-card {
	padding: 22px 22px 18px;
	border: 1px solid var(--ysg-line);
	border-top: 3px solid var(--ysg-gold);
	border-radius: 0 0 12px 12px;
	background: #fff;
	box-shadow: 0 14px 34px rgba(26, 39, 85, 0.08);
}

.ysg-card-owner,
.ysg-card-navy {
	border-top-color: var(--ysg-navy);
}

.ysg-card-top {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 14px;
}

.ysg-card-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--ysg-navy);
	color: var(--ysg-gold);
}

.ysg-card-icon .ysg-ico {
	display: none;
}

.ysg-card-icon:not([data-kind]) .ysg-ico-anchor,
.ysg-card-icon[data-kind="anchor"] .ysg-ico-anchor,
.ysg-card-icon[data-kind="sail"] .ysg-ico-sail,
.ysg-card-icon[data-kind="motor"] .ysg-ico-motor {
	display: block;
}

.ysg-card-name {
	display: block;
	color: var(--ysg-navy);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.ysg-card-sub {
	display: block;
	color: var(--ysg-slate);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ysg-rows {
	margin: 0;
}

.ysg-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 9px 6px;
	margin: 0 -6px;
	border-top: 1px solid var(--ysg-line);
	border-radius: 6px;
	font-size: 14px;
	transition: background-color 0.15s ease;
}

.ysg:not(.is-done) .ysg-card-top[data-screen],
.ysg:not(.is-done) .ysg-row[data-screen] {
	cursor: pointer;
}

.ysg:not(.is-done) .ysg-row[data-screen]:hover {
	background: rgba(201, 176, 134, 0.14);
}

.ysg:not(.is-done) .ysg-card-top[data-screen]:hover .ysg-card-name {
	color: var(--ysg-gold);
}

.ysg-card-head-price {
	margin-left: auto;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(26, 39, 85, 0.08);
	color: var(--ysg-navy);
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

.ysg-price {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 7px;
	border-radius: 999px;
	background: rgba(201, 176, 134, 0.22);
	color: var(--ysg-navy);
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

.ysg-card-pricing {
	margin: 12px -6px 0;
	padding: 12px 12px 10px;
	border-radius: 8px;
	background: var(--ysg-navy);
	color: #fff;
}

.ysg-card-pricing-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.ysg-card-pricing-row + .ysg-card-pricing-row {
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px solid rgba(255, 255, 255, 0.18);
	font-size: 12px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.88);
}

.ysg-card-pricing-val {
	color: var(--ysg-gold);
	font-size: 15px;
	font-weight: 800;
	white-space: nowrap;
}

.ysg-card-pricing-row + .ysg-card-pricing-row .ysg-card-pricing-val {
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.ysg-row dt {
	flex: 0 0 auto;
	margin: 0;
	color: var(--ysg-slate);
	font-weight: 400;
}

.ysg-row dd {
	margin: 0;
	color: #cbd5e1;
	font-weight: 600;
	text-align: right;
	overflow-wrap: anywhere;
}

.ysg-row.is-filled dd {
	color: var(--ysg-navy);
}

.ysg-row.is-new dd {
	animation: ysg-pop 0.6s ease;
}

@keyframes ysg-pop {
	0% {
		color: var(--ysg-gold);
		transform: translateY(4px);
		opacity: 0;
	}
	60% {
		color: var(--ysg-gold);
		transform: none;
		opacity: 1;
	}
	100% {
		color: var(--ysg-navy);
	}
}

.ysg-card-note {
	margin: 12px 0 0;
	color: var(--ysg-slate);
	font-size: 12px;
}

/* Après l'envoi : il ne reste que la confirmation et la fiche */
.ysg.is-done .ysg-head,
.ysg.is-done .ysg-q,
.ysg.is-done .ysg-h,
.ysg.is-done .ysg-search,
.ysg.is-done .ysg-picked,
.ysg.is-done .ysg-msg,
.ysg.is-done .ysg-nav,
.ysg.is-done .ysg-card-note {
	display: none !important;
}

.ysg.is-done .ysg-form {
	margin-top: 0;
}

@media (max-width: 900px) {
	.ysg {
		grid-template-columns: minmax(0, 1fr);
		gap: 22px;
	}

	.ysg-side {
		position: static;
		gap: 14px;
	}

	.ysg-card {
		padding: 14px 16px;
		box-shadow: none;
	}

	.ysg-card-top {
		margin: 0;
	}

	.ysg-card-icon {
		width: 36px;
		height: 36px;
	}

	.ysg-rows {
		display: flex;
		flex-wrap: wrap;
		gap: 6px;
		margin-top: 10px;
	}

	.ysg-row {
		display: none;
		padding: 4px 10px;
		border: 1px solid var(--ysg-line);
		border-radius: 999px;
		font-size: 12px;
	}

	.ysg-row.is-filled {
		display: inline-flex;
	}

	.ysg-row dt {
		display: none;
	}

	.ysg-card-note {
		display: none;
	}

	.ysg .ysg-q {
		font-size: 23px;
	}

	.ysg .ysf-w-third,
	.ysg .ysf-w-half {
		grid-column: span 12;
	}

	.ysg .ysg-btn {
		flex: 1 1 auto;
		padding: 12px 20px;
	}

	.ysg .ysg-btn-ghost {
		flex: 0 0 auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ysg-leg span,
	.ysg .ysg-btn {
		transition: none;
	}

	.ysg-row.is-new dd {
		animation: none;
	}
}
