/* ==========================================================================
   CS Calculateur papillote poisson
   Charte alignée sur le calculateur rôti de bœuf : carte jaune, bouton sombre.
   Tous les sélecteurs sont préfixés .cs-papillote pour éviter les conflits.
   ========================================================================== */

.cs-papillote {
	--cs-pap-bg: #fff4b3;
	--cs-pap-border: #efdf90;
	--cs-pap-rule: #e7d989;
	--cs-pap-dark: #0e1420;
	--cs-pap-text: #111827;
	--cs-pap-muted: #4b5563;
	--cs-pap-radius: 26px;

	background: var(--cs-pap-bg);
	border: 1.5px solid var(--cs-pap-border);
	border-radius: var(--cs-pap-radius);
	box-shadow: 0 14px 40px rgba(0, 0, 0, .10);
	padding: 1.5rem 1.75rem 1.5rem;
	max-width: 760px;
	margin: 2rem auto;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--cs-pap-text);
	box-sizing: border-box;
}

.cs-papillote *,
.cs-papillote *::before,
.cs-papillote *::after {
	box-sizing: inherit;
}

/* L'attribut hidden doit l'emporter sur toute regle display du widget :
   une regle d'auteur ecrase la feuille du navigateur, et les champs
   conditionnels resteraient visibles. */
.cs-papillote [hidden] {
	display: none !important;
}

.cs-papillote .cs-pap-titre {
	text-align: center;
	font-weight: 800;
	letter-spacing: .2px;
	margin: 0 0 1rem;
	font-size: 1.3rem;
	line-height: 1.3;
	color: var(--cs-pap-text);
}

.cs-papillote .cs-pap-titre::after {
	content: "";
	display: block;
	height: 1px;
	background: var(--cs-pap-rule);
	margin: .75rem -1.25rem 0;
}

/* --- Grille de champs --- */

.cs-papillote .cs-pap-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem 1.25rem;
	margin-bottom: 1rem;
}

.cs-papillote .cs-pap-champ--full {
	grid-column: 1 / -1;
}

.cs-papillote .cs-pap-grid > .cs-pap-champ--full:first-child {
	padding: .75rem;
	border: 2px dotted #e8db92;
	border-radius: 14px;
	background: rgba(255, 255, 255, .55);
}

.cs-papillote label {
	display: block;
	font-weight: 700;
	margin-bottom: .4rem;
	font-size: .95rem;
	line-height: 1.4;
}

.cs-papillote .cs-pap-champ--full label input[type="checkbox"] {
	width: auto;
	margin-right: .5rem;
	vertical-align: middle;
	accent-color: var(--cs-pap-dark);
}

.cs-papillote input[type="number"],
.cs-papillote select {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	padding: .7rem .85rem;
	height: 46px;
	border: 1.5px solid #e3e2da;
	border-radius: 12px;
	background: #fff;
	line-height: 1.2;
	font-size: 16px; /* évite le zoom automatique sur iOS */
	font-family: inherit;
	color: var(--cs-pap-text);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

.cs-papillote select {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234b5563' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .9rem center;
	padding-right: 2.2rem;
}

.cs-papillote .cs-pap-input-unit {
	position: relative;
}

.cs-papillote .cs-pap-unit {
	position: absolute;
	right: .9rem;
	top: 50%;
	transform: translateY(-50%);
	font-weight: 700;
	color: var(--cs-pap-muted);
	pointer-events: none;
}

.cs-papillote .cs-pap-input-unit input {
	padding-right: 2.6rem;
}

/* --- Bouton --- */

.cs-papillote .cs-pap-btn {
	width: 100%;
	padding: .85rem 1rem;
	border: 0;
	border-radius: 14px;
	background: var(--cs-pap-dark);
	color: #fff;
	font-weight: 800;
	font-size: 1rem;
	font-family: inherit;
	box-shadow: 0 6px 18px rgba(14, 20, 32, .25);
	transition: transform .04s ease, background-color .2s ease;
	cursor: pointer;
}

.cs-papillote .cs-pap-btn:hover {
	background: #0b101a;
}

.cs-papillote .cs-pap-btn:active {
	transform: translateY(1px);
}

.cs-papillote input:focus-visible,
.cs-papillote select:focus-visible,
.cs-papillote .cs-pap-btn:focus-visible {
	outline: 2px solid rgba(14, 20, 32, .55);
	outline-offset: 2px;
}

/* --- Résultat --- */

.cs-papillote .cs-pap-resultat:empty {
	display: none;
}

.cs-papillote .cs-pap-resultat {
	margin-top: 1.25rem;
}

.cs-papillote table {
	width: 100%;
	border-collapse: collapse;
	font-size: .98rem;
	border: 1px solid #e9e2b5;
	border-radius: 14px;
	overflow: hidden;
	background: rgba(255, 255, 255, .45);
	margin: 0;
}

.cs-papillote th,
.cs-papillote td {
	padding: .7rem .8rem;
	border-bottom: 1px solid #efe6be;
	text-align: left;
}

.cs-papillote th {
	width: 52%;
	font-weight: 700;
	color: var(--cs-pap-text);
	background: transparent;
}

.cs-papillote tr:last-child th,
.cs-papillote tr:last-child td {
	border-bottom: 0;
}

.cs-papillote .cs-pap-emph td,
.cs-papillote .cs-pap-emph th {
	font-weight: 800;
	font-size: 1.08rem;
	background: rgba(255, 255, 255, .7);
}

.cs-papillote .cs-pap-notes {
	margin: 1rem 0 0;
	padding: .9rem 1rem;
	background: rgba(255, 255, 255, .55);
	border-radius: 14px;
	font-size: .93rem;
	color: var(--cs-pap-muted);
	line-height: 1.55;
}

.cs-papillote .cs-pap-notes p {
	margin: 0 0 .5rem;
}

.cs-papillote .cs-pap-notes p:last-child {
	margin-bottom: 0;
}

.cs-papillote .cs-pap-notes strong {
	color: var(--cs-pap-text);
}

.cs-papillote .cs-pap-alerte {
	margin: 1rem 0 0;
	padding: .8rem 1rem;
	border: 1.5px solid #c8762e;
	background: rgba(200, 118, 46, .08);
	border-radius: 14px;
	font-size: .93rem;
	line-height: 1.5;
}

/* --- Mobile --- */

@media (max-width: 640px) {
	.cs-papillote {
		padding: 1.25rem 1rem;
		border-radius: 20px;
		margin: 1.5rem auto;
	}

	.cs-papillote .cs-pap-grid {
		grid-template-columns: 1fr;
	}

	.cs-papillote .cs-pap-titre {
		font-size: 1.15rem;
	}

	.cs-papillote th {
		width: 50%;
	}

	.cs-papillote th,
	.cs-papillote td {
		padding: .6rem .55rem;
		font-size: .92rem;
	}
}

/* --- Impression --- */

@media print {
	.cs-papillote {
		box-shadow: none;
		background: #fff;
		border: 1px solid #999;
	}

	.cs-papillote .cs-pap-btn {
		display: none;
	}
}
