/* =========================================================
   Projet — Arithmetibox
   Compatible ataraXy V2
   ========================================================= */

.projet-arithmetibox {
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px;
}

.projet-arithmetibox * {
	box-sizing: border-box;
}

.projet-arithmetibox .titre {
	font-size: 2rem;
	font-weight: 800;
	margin-bottom: 8px;
	color: var(--couleur-texte, #202124);
}

.arithmetibox-intro {
	max-width: 760px;
	margin: 0 0 24px;
	line-height: 1.6;
	color: #4b5563;
}

/* =========================================================
   Onglets
   ========================================================= */

.arithmetibox-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 26px 0 22px;
	padding: 8px;
	border-radius: 999px;
	background: rgba(17, 24, 39, .06);
}

.arithmetibox-tab {
	flex: 1 1 180px;
	min-height: 44px;
	padding: 10px 16px;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: #374151;
	font-weight: 800;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.arithmetibox-tab:hover {
	background: rgba(255, 255, 255, .75);
	transform: translateY(-1px);
}

.arithmetibox-tab.is-active {
	background: #4f46e5;
	color: #fff;
	box-shadow: 0 8px 18px rgba(79, 70, 229, .24);
}

/* =========================================================
   Panneau principal
   ========================================================= */

.arithmetibox-panel-wrap {
	margin-top: 18px;
}

.arithmetibox-panel {
	display: none;
	padding: 28px;
	border-radius: 28px;
	background: #fff;
	box-shadow: 0 14px 36px rgba(0, 0, 0, .10);
}

.arithmetibox-panel.is-active {
	display: block;
}

.arithmetibox-panel h2 {
	margin: 0 0 10px;
	font-size: 1.45rem;
	font-weight: 800;
	color: #111827;
}

.arithmetibox-panel p {
	margin: 0 0 20px;
	line-height: 1.55;
	color: #4b5563;
}

/* =========================================================
   Formulaires
   ========================================================= */

.arithmetibox-panel form {
	margin: 20px 0 0;
	padding: 20px;
	border-radius: 22px;
	background: #f8fafc;
	border: 1px solid rgba(17, 24, 39, .08);
}

.arithmetibox-panel label {
	display: grid;
	grid-template-columns: 120px 1fr;
	align-items: center;
	gap: 14px;
	margin: 12px 0;
}

.arithmetibox-panel label span {
	font-weight: 800;
	color: #111827;
}

.arithmetibox-form-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 14px;
}

.arithmetibox-form-row label {
	grid-template-columns: 38px 1fr;
	margin: 0;
}

.arithmetibox-form-row label span {
	text-align: right;
}

.arithmetibox-panel input[type="text"] {
	width: 100%;
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid rgba(17, 24, 39, .30);
	border-radius: 14px;
	background: #fff;
	color: #111827;
	font-size: 1rem;
	text-align: center;
}

.arithmetibox-panel input[type="text"]:focus {
	outline: none;
	border-color: #4f46e5;
	box-shadow: 0 0 0 4px rgba(79, 70, 229, .13);
}

.arithmetibox-panel input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 11px 20px;
	margin-top: 14px;
	border: none;
	border-radius: 999px;
	background: #4f46e5;
	color: #fff;
	font-weight: 800;
	font-size: .95rem;
	cursor: pointer;
	box-shadow: 0 8px 20px rgba(79, 70, 229, .22);
	transition: transform .15s ease, opacity .15s ease;
}

.arithmetibox-panel input[type="submit"]:hover {
	transform: translateY(-1px);
	opacity: .92;
}

/* =========================================================
   Résultats
   ========================================================= */

.arithmetibox-resultat {
	margin-top: 24px;
	padding: 20px;
	border-radius: 22px;
	background: linear-gradient(135deg, rgba(79, 70, 229, .09), rgba(79, 70, 229, .025));
	border: 1px solid rgba(79, 70, 229, .12);
	line-height: 1.6;
}

.arithmetibox-resultat:empty {
	display: none;
}

.arithmetibox-resultat ol {
	margin: 12px 0 0;
	padding-left: 22px;
}

.arithmetibox-resultat li {
	margin: 10px 0;
}

/* =========================================================
   MathJax — sans scroll, panneaux adaptatifs
   ========================================================= */

.projet-arithmetibox mjx-container[display="true"] {
	display: block;
	width: max-content;
	max-width: 100%;
	margin: 14px auto;
	overflow: visible;
}

.projet-arithmetibox mjx-container {
	max-width: 100%;
	overflow: visible;
}

/* =========================================================
   Copyright
   ========================================================= */

#copyright {
	display: block;
	max-width: 900px;
	margin: 36px auto 12px;
	padding: 14px 18px;
	border-radius: 16px;
	background: rgba(0, 0, 0, .04);
	font-size: .82rem;
	line-height: 1.45;
	text-align: left;
	color: rgba(0, 0, 0, .68);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 800px) {
	.projet-arithmetibox {
		padding: 16px;
	}

	.projet-arithmetibox .titre {
		font-size: 1.65rem;
	}

	.arithmetibox-tabs {
		border-radius: 22px;
	}

	.arithmetibox-tab {
		flex: 1 1 100%;
	}

	.arithmetibox-panel {
		padding: 20px;
		border-radius: 22px;
	}

	.arithmetibox-panel label,
	.arithmetibox-form-row label {
		grid-template-columns: 1fr;
		gap: 6px;
	}

	.arithmetibox-form-row label span {
		text-align: left;
	}

	.arithmetibox-panel form {
		padding: 16px;
	}
}